gre/lrregion.h

Go to the documentation of this file.
00001 /**
00002  * gre/lrregion - GRE_LAYER_REGION class definition.
00003  *
00004  * \if NODOC
00005  * $Id: lrregion.h_v 1.4 2003/09/23 13:16:53 mju Exp $
00006  *
00007  * $Log: lrregion.h_v $
00008  * Revision 1.4  2003/09/23 13:16:53  mju
00009  * Explicit init base in dispparm copy ctor.
00010  *
00011  * Revision 1.3  2003/09/15 13:48:59  fileserver!dwilliss
00012  * Doxygen
00013  *
00014  * Revision 1.2  2003/07/30 15:25:59  mju
00015  * Ignore private sections.
00016  *
00017  * Revision 1.1  2003/06/13 22:09:27  scowan
00018  * Initial revision
00019  *
00020  * \endif
00021 **/
00022 
00023 #ifndef  INC_GRE_LRREGION_H
00024 #define  INC_GRE_LRREGION_H
00025 
00026 #ifndef  INC_MI32_GRE_H
00027 #include <mi32/gre.h>
00028 #endif
00029 
00030 #ifndef  INC_MI32_REGION2D_H
00031 #include <mi32/region2d.h>
00032 #endif
00033 
00034 class GRE_LAYER_REGION : public GRE_LAYER {
00035    public:
00036 
00037       // GRE_LAYER_REGION::DISPPARM
00038       class DISPPARM : public GRE_LAYER::DISPPARM {
00039          public:
00040 
00041             class DLG;
00042 
00043             RVC::OBJITEM m_ObjItem;
00044             RVC::OBJITEM m_ObjItemStyle;
00045             POLYSTYLE m_Style;
00046 
00047             DISPPARM ();
00048             DISPPARM (
00049                const DISPPARM& rhs
00050                ): GRE_LAYER::DISPPARM(rhs) { Copy(rhs); }
00051             ~DISPPARM (
00052                ) { Free(); }
00053 
00054             DISPPARM& operator= (const DISPPARM& rhs) {
00055                if (this != &rhs) {
00056                   Free();
00057                   Copy(rhs);
00058                   }
00059                return (*this);
00060                }
00061 
00062             //! Set to use specified object.
00063             ERRVALUE SetObject (
00064                const RVCOBJITEM& objitem,    //!< Object to set
00065                GRE_LAYER_REGION* layer,
00066                bool keepsettings = false     //!< Retain current display settings
00067                );
00068                
00069          protected:
00070             virtual const SERIALIZER::ITEMDEF* SerialGetItemDef (SERIALIZER& serializer) const;
00071 
00072          private:
00073             #ifndef GENERATING_DOXYGEN_OUTPUT
00074             void Copy (const DISPPARM&);
00075             void Free ();
00076             static ERRVALUE SerializerCB_StyleFileName (SERIALIZER&, const SERIALIZER::ITEMDEF *, void *, SERIALIZER::ITEMDEF::ACTION);
00077 
00078             virtual ERRVALUE v_SetObjItem (const RVC::OBJITEM& objitem, bool replace);
00079             virtual ERRVALUE v_Validate ();
00080             friend class GRE_LAYER_REGION;
00081             #endif //!< GENERATING_DOXYGEN_OUTPUT
00082          }; // End of GRE_LAYER_REGION::DISPPARM
00083 
00084       //! Construct instance of this layer type
00085       static int Construct (
00086          GRE_GROUP *group,                      //!< Group to contain layer
00087          GRE_LAYER **retlayer,                  //!< Layer returned
00088          GRE_LAYER *reflayer,                   //!< Reference layer for insertion
00089          UINT32 flags                           //!< Creation flags
00090          );
00091 
00092       //! Register this layer type
00093       static void RegisterType (
00094          );
00095 
00096       //! Construct layer and insert into list
00097       explicit GRE_LAYER_REGION (
00098          GRE_GROUP *group,                      //!< Group to contain layer
00099          GRE_LAYER *reflayer = 0,               //!< Reference layer for insertion
00100          UINT32 flags = MDISPCREATE_InsertAfter //!< MDISPCREATE flags
00101          );
00102 
00103       //! Destructor.
00104       virtual ~GRE_LAYER_REGION ();
00105 
00106       //! Clear region.
00107       void ClearRegion (
00108          );
00109 
00110       //! Retrieve layer-specific display parameters.
00111       const DISPPARM& GetDispParm (
00112          ) const { return (m_dispparm); }
00113 
00114       //! Set layer-specific display parameters.
00115       //! This is the recommended method for changing how an existing layer is to be
00116       //! rendered.  Validation will be performed on the specified parameters and
00117       //! adjustments made to the layer's copy if necessary.  Use of this method
00118       //! usually result in a ChangeBegin / ChangeEnd message pair, and will also
00119       //! generate a ChangeObject message if the spatial object used in the layer
00120       //! is changed.
00121       ERRVALUE SetDispParm (
00122          const DISPPARM& dispparm               //!< Parameters to set
00123          );
00124 
00125    protected:
00126 
00127       DISPPARM m_dispparm;                      //!< Layer-specific display parameters
00128 
00129    private:
00130       #ifndef GENERATING_DOXYGEN_OUTPUT
00131 
00132       static void LegendMsgHandler (GRAPHICTREEITEM_MSG *msg);
00133 
00134       GRE_LEGEND_POLY m_Legend;
00135       REGION2D m_Region2D;       //!< Temporary until GRE_LAYER::m_Region is changed
00136 
00137       int DrawSetup (void*, GRE_LAYERDC&);
00138 
00139       //! Overrides from GRE_LAYER.
00140    #ifdef WIN32_MFC
00141       virtual void v_AddTreeViewLegend (GRE_MFC_TREEVIEW& TreeView, HTREEITEM hParent, HTREEITEM hInsertAfter);
00142    #endif
00143       virtual ERRVALUE v_AssignObject (const RVC::OBJITEM& objitem);
00144    #if defined(X_NATIVE) || defined(WIN32_MFC)
00145       virtual int v_ControlPanel (MDLGPARENT dlgparent,UINT32 flags = 0);
00146    #endif
00147       virtual ERRVALUE v_Draw (GRE_LAYERDC& layerdc);
00148       virtual const GRE_LEGEND* v_GetLegend (ELEMTYPE ElemType);
00149       virtual const RVC::OBJITEM& v_GetObjItem (int component) const;
00150    #ifdef WIN32_MFC
00151       virtual bool v_HasTreeViewLegend () const;
00152    #endif
00153    #if defined(X_NATIVE) || defined(WIN32_MFC)
00154       virtual ERRVALUE v_PromptObject (bool OpenCtrlPanel, MDLGPARENT dlgparent);
00155    #endif
00156       virtual const char* v_SerialGetTagName () const;
00157       virtual void v_SetDftName (bool ReplaceExisting);
00158       virtual void v_SetLegendSampleFlags (MgdSAMPLEFLAGS SampleFlags);
00159       virtual ERRVALUE v_SetStyleObjItem (const RVC::OBJITEM& ObjItem);
00160       virtual int v_UpdateExtents (bool forceupdate);
00161       virtual bool v_UsesTransparency (const MGD::CONTEXT* gc = 0) const;
00162 
00163       GRE_LAYER_REGION (const GRE_LAYER_REGION&);
00164       GRE_LAYER_REGION& operator= (const GRE_LAYER_REGION&);
00165       
00166       class PRIVDRAWDATA;
00167       friend class PRIVDRAWDATA;
00168       friend class DISPPARM;
00169 
00170       #endif //!< GENERATING_DOXYGEN_OUTPUT     
00171    };
00172 
00173 
00174 #endif   //!< INC_GRE_LRREGION_H

Generated on Thu Aug 12 06:18:26 2004 for TNTsdk by doxygen 1.3.4-20031026