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

Generated on Tue Dec 14 13:18:14 2004 for TNTsdk by  doxygen 1.3.8-20040913