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

Generated on Thu Apr 26 04:44:39 2007 for TNTsdk by  doxygen 1.5.2