groupview.h

Go to the documentation of this file.
00001 /**
00002  * \file groupview.h <gre/groupview.h>
00003  * \brief GRE::GROUPVIEW class definitions
00004  *
00005  * \if NODOC
00006  * $Id: groupview.h_v 1.6 2005/09/14 21:51:28 mju Exp $
00007  *
00008  * $Log: groupview.h_v $
00009  * Revision 1.6  2005/09/14 21:51:28  mju
00010  * Add rendertype_ActiveElems.
00011  *
00012  * Revision 1.5  2005/07/19 17:06:54  mju
00013  * Add rendertype_Matte.
00014  *
00015  * Revision 1.4  2005/04/29 17:49:21  mju
00016  * Support rendertarget.
00017  *
00018  * Revision 1.3  2005/04/22 17:35:39  mju
00019  * Use renderbuffer class.
00020  *
00021  * Revision 1.2  2005/03/22 22:00:13  mju
00022  * Add resetRendered.
00023  *
00024  * Revision 1.1  2005/02/25 20:30:54  mju
00025  * Initial revision
00026  *
00027  * \endif
00028 **/
00029 
00030 #ifndef  INC_GRE_GROUPVIEW_H
00031 #define  INC_GRE_GROUPVIEW_H
00032 
00033 #ifndef  INC_GRE_BASE_H
00034    #include <gre/base.h>
00035 #endif
00036 
00037 #ifndef  INC_MI32_RENDERBUFFER_H
00038    #include <mi32/renderbuffer.h>
00039 #endif
00040 
00041 
00042 namespace GRE {
00043 
00044 //===================================================================================================================
00045 
00046 //! Container for layer information retained for each view.
00047 class GROUPVIEW {
00048    public:
00049 
00050       //! Rendering buffer types.
00051       enum RENDERTYPE {
00052          RENDERTYPE_Group =      0,
00053          RENDERTYPE_ActiveElems,
00054          RENDERTYPE_Matte,
00055          RENDERTYPE_Overlay,
00056          RENDERTYPE_COUNT
00057          };
00058 
00059       //! Constructor.
00060       GROUPVIEW (
00061          GRE_GROUP *group,
00062          GRE_VIEW *view
00063          );
00064 
00065       ~GROUPVIEW ();
00066 
00067       //! Check if existing renderings are still valid.
00068       void CheckRendered (
00069          );
00070 
00071       //! Compute all transformations.
00072       ERRVALUE ComputeTrans (
00073          );
00074 
00075       //! Draw all 'active' elements to overlay buffer.
00076       ERRVALUE DrawActiveOverlay (
00077          );
00078 
00079       //! Get 3D viewpoint.
00080       const GRE_VIEWPOINT3D* Get3dViewPoint (
00081          ) const { return (m_pViewPoint3D); }
00082 
00083       //! Get device rectangle used for rendering.
00084       //! This is a nominal rectangle based on layer extents and may not account for
00085       //! symbology and marginalia.  Returned rectangle may not be suitable for clipping
00086       //! during drawing, but will be suitable for selection of source object elements.
00087       const LRECT2D& GetDeviceRectUsed (
00088          ) const { return (m_CurDevRectUsed); }
00089 
00090       //! Get associated GRE_GROUP.
00091       GRE_GROUP* GetGroup (
00092          ) const { return (m_group); }
00093 
00094       //! Get rendering buffer for specified rendering type (const).
00095       const RENDERBUFFER& GetRenderBuffer (
00096          RENDERTYPE RenderType                           //!< Rendering type
00097          ) const { return (m_RenderBuffer[RenderType]); }
00098 
00099       //! Get rendering buffer for specified rendering type (non-const).
00100       RENDERBUFFER& GetRenderBuffer (
00101          RENDERTYPE RenderType                           //!< Rendering type
00102          ) { return (m_RenderBuffer[RenderType]); }
00103 
00104       //! Get rotation angle.
00105       double GetRotationAngle (
00106          ) const { return (m_RotationAngle); }
00107 
00108       //! Get rotation cosine.
00109       double GetRotationCos (
00110          ) const { return (m_RotationCos); }
00111 
00112       //! Get rotation sine.
00113       double GetRotationSin (
00114          ) const { return (m_RotationSin); }
00115 
00116       //! Get associated GRE_VIEW.
00117       GRE_VIEW* GetView (
00118          ) const { return (m_view); }
00119 
00120       //! Determine if drawing in 3D.
00121       bool Is3D (
00122          ) const { return (m_Is3D); }
00123 
00124       //! Determine if drawing 3D in stereo.
00125       bool Is3dStereo (
00126          ) const;
00127 
00128       //! Determine if group overlaps view device display area.
00129       bool IsGroupOverlappedDevice (
00130          ) const { return (m_GroupOverlapsDevice); }
00131 
00132       //! Reset rendered status so redraws.
00133       void ResetRendered (
00134          GRE::RENDERTARGET target = GRE::RENDERTARGET_GroupAll
00135          );
00136 
00137    private:
00138       #ifndef GENERATING_DOXYGEN_OUTPUT
00139       GRE_GROUP *m_group;
00140       GRE_VIEW *m_view;
00141       RENDERBUFFER m_RenderBuffer[RENDERTYPE_COUNT];
00142       GRE_VIEWPOINT3D *m_pViewPoint3D;          // 3D viewpoint
00143       DRECT2D m_NewTgtRectFull;                 // New full rectangle in target device coordinates, based on transformation
00144       DRECT2D m_CurTgtRectFull;                 // Current full rectangle in target device coordinates used by layer
00145       LRECT2D m_NewDevRectUsed;                 // New clipped rectangle on device used, based on transformation
00146       LRECT2D m_CurDevRectUsed;                 // Current clipped rectangle on device used
00147       double m_RotationAngle;                   // Rotation angle
00148       double m_RotationCos;                     // Rotation angle cosine
00149       double m_RotationSin;                     // Rotation angle sine
00150       bool m_Is3D;                              // Set if drawing in 3D
00151       bool m_GroupOverlapsDevice;
00152 
00153       GROUPVIEW (const GROUPVIEW&);
00154       GROUPVIEW& operator= (const GROUPVIEW&);
00155 
00156       #endif // GENERATING_DOXYGEN_OUTPUT
00157    };
00158 
00159 //===================================================================================================================
00160 
00161 }  // End namespace GRE
00162 
00163 #endif   // INC_GRE_GROUPVIEW_H

Generated on Wed May 31 15:26:39 2006 for TNTsdk by  doxygen 1.3.8-20040913