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

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