00001 /** 00002 * \file lrscaleb.h <gre/lrscaleb.h> 00003 * \brief GRE_LAYER_SCALEBAR class definitions. 00004 * 00005 * \if NODOC 00006 * $Id: lrscaleb.h_v 1.6 2005/02/25 23:39:43 scowan Exp $ 00007 * 00008 * $Log: lrscaleb.h_v $ 00009 * Revision 1.6 2005/02/25 23:39:43 scowan 00010 * Added copy virtual method implementation. 00011 * 00012 * Revision 1.5 2005/01/20 16:57:19 mju 00013 * Redesign layer type registration. 00014 * 00015 * Revision 1.4 2004/03/05 21:29:15 mju 00016 * Make dtor virtual if virtual fns. 00017 * 00018 * Revision 1.3 2003/09/15 13:48:59 fileserver!dwilliss 00019 * Doxygen 00020 * 00021 * Revision 1.2 2003/07/30 15:27:04 mju 00022 * Ignore private sections. 00023 * 00024 * Revision 1.1 2002/09/20 17:37:19 mju 00025 * Initial revision 00026 * \endif 00027 **/ 00028 00029 #ifndef INC_GRE_LRSCALEB_H 00030 #define INC_GRE_LRSCALEB_H 00031 00032 #ifndef INC_GRE_LAYER_H 00033 #include <gre/layer.h> 00034 #endif 00035 00036 //=================================================================================================================== 00037 //! GRE "scale bar" layer. 00038 class GRE_LAYER_SCALEBAR : public GRE_LAYER { 00039 public: 00040 00041 class DISPPARM : public GRE_LAYER::DISPPARM { 00042 public: 00043 00044 class DLG; 00045 00046 double Length; //!< length in whatever units user choose 00047 double BarWidth; //!< bar thickness in users choice of units 00048 double Scale; //!< scale for width/sizes, etc 00049 int MajorDiv; 00050 int MinorDiv; //!< Number of major/minor divisions 00051 UINT8 LengthUnits; 00052 UINT8 BarWidthUnits; 00053 UINT8 LineWidthUnits; 00054 TEXTSTYLE TextStyle; 00055 LINESTYLE Style[4]; //!< Colors and such 00056 MISTRING UnitLabel; 00057 00058 DISPPARM (); 00059 DISPPARM (const DISPPARM& rhs) { 00060 Copy(rhs); 00061 } 00062 virtual ~DISPPARM () { 00063 Free(); 00064 } 00065 00066 DISPPARM& operator= (const DISPPARM& rhs) { 00067 if (this != &rhs) { 00068 Free(); 00069 Copy(rhs); 00070 } 00071 return (*this); 00072 } 00073 00074 protected: 00075 virtual const SERIALIZER::ITEMDEF* SerialGetItemDef (SERIALIZER& serializer) const; 00076 00077 private: 00078 #ifndef GENERATING_DOXYGEN_OUTPUT 00079 void Copy (const DISPPARM&); 00080 void Free (); 00081 #endif //!< GENERATING_DOXYGEN_OUTPUT 00082 }; 00083 00084 //! Register this layer type 00085 static void RegisterType ( 00086 ); 00087 00088 //! Install SML class, called by internal SML function. 00089 static void SMLClassInstall ( 00090 SMLCONTEXT *context 00091 ); 00092 00093 //! Construct layer and insert into list 00094 explicit GRE_LAYER_SCALEBAR ( 00095 GRE_GROUP *group, //!< Group to contain layer 00096 CREATEFLAGS createflags = CREATEFLAG_None, //!< Creation flags 00097 GRE::LISTPOS listpos = GRE::LISTPOS_Last, //!< Position in list 00098 GRE_LAYER *reflayer = 0 //!< Reference layer for insertion 00099 ); 00100 00101 //! Destructor. 00102 virtual ~GRE_LAYER_SCALEBAR (); 00103 00104 #ifndef GENERATING_DOXYGEN_OUTPUT 00105 int DrawScaleBar (GRE_LAYERDC&, void*); 00106 #endif //!< GENERATING_DOXYGEN_OUTPUT 00107 00108 //! Retrieve layer-specific display parameters. 00109 const DISPPARM& GetDispParm ( 00110 ) const { return (m_dispparm); } 00111 00112 //! Set layer-specific display parameters. 00113 //! This is the recommended method for changing how an existing layer is to be 00114 //! rendered. Validation will be performed on the specified parameters and 00115 //! adjustments made to the layer's copy if necessary. Use of this method 00116 //! usually result in a ChangeBegin / ChangeEnd message pair, and will also 00117 //! generate a ChangeObject message if the spatial object used in the layer 00118 //! is changed. 00119 ERRVALUE SetDispParm ( 00120 const DISPPARM& dispparm //!< Parameters to set 00121 ); 00122 00123 protected: 00124 00125 DISPPARM m_dispparm; //!< Layer-specific display parameters 00126 00127 private: 00128 #ifndef GENERATING_DOXYGEN_OUTPUT 00129 00130 void ReadDefaultsIni (); 00131 void SaveDefaultsIni (); 00132 00133 //! Overrides from GRE_LAYER. 00134 #if defined(X_NATIVE) || defined(WIN32_MFC) 00135 virtual int v_ControlPanel (MDLGPARENT dlgparent,UINT32 flags = 0); 00136 #endif 00137 virtual GRE_LAYER* v_Copy (GRE_GROUP *group) const; 00138 virtual ERRVALUE v_Draw (GRE_LAYERDC& layerdc); 00139 virtual const char* v_SerialGetTagName () const; 00140 virtual void v_SetDftName (bool ReplaceExisting); 00141 virtual int v_UpdateExtents (bool forceupdate); 00142 00143 GRE_LAYER_SCALEBAR (const GRE_LAYER_SCALEBAR&); 00144 GRE_LAYER_SCALEBAR& operator= (const GRE_LAYER_SCALEBAR&); 00145 00146 #endif //!< GENERATING_DOXYGEN_OUTPUT 00147 }; 00148 00149 #define SCALEBARDISPFLAG_NegativePart 0x00000001 00150 #define SCALEBARDISPFLAG_CenterLine 0x00000002 00151 #define SCALEBARDISPFLAG_ShowTicks 0x00000004 00152 #define SCALEBARDISPFLAG_TextOnBottom 0x00000008 00153 #define SCALEBARDISPFLAG_ShowUnits 0x00000010 00154 #define SCALEBARDISPFLAG_CenterUnits 0x00000020 00155 #define SCALEBARDISPFLAG_LayoutScale 0x00000040 00156 00157 //=================================================================================================================== 00158 00159 #endif //!< INC_GRE_LRSCALEB_H
1.3.8-20040913