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.4 2004/03/05 21:29:15 mju Exp $ 00007 * 00008 * $Log: lrscaleb.h_v $ 00009 * Revision 1.4 2004/03/05 21:29:15 mju 00010 * Make dtor virtual if virtual fns. 00011 * 00012 * Revision 1.3 2003/09/15 13:48:59 fileserver!dwilliss 00013 * Doxygen 00014 * 00015 * Revision 1.2 2003/07/30 15:27:04 mju 00016 * Ignore private sections. 00017 * 00018 * Revision 1.1 2002/09/20 17:37:19 mju 00019 * Initial revision 00020 * \endif 00021 **/ 00022 00023 #ifndef INC_GRE_LRSCALEB_H 00024 #define INC_GRE_LRSCALEB_H 00025 00026 #ifndef INC_MI32_GRE_H 00027 #include <mi32/gre.h> 00028 #endif 00029 00030 //=================================================================================================================== 00031 //! GRE "scale bar" layer. 00032 class GRE_LAYER_SCALEBAR : public GRE_LAYER { 00033 public: 00034 00035 class DISPPARM : public GRE_LAYER::DISPPARM { 00036 public: 00037 00038 class DLG; 00039 00040 double Length; //!< length in whatever units user choose 00041 double BarWidth; //!< bar thickness in users choice of units 00042 double Scale; //!< scale for width/sizes, etc 00043 int MajorDiv; 00044 int MinorDiv; //!< Number of major/minor divisions 00045 UINT8 LengthUnits; 00046 UINT8 BarWidthUnits; 00047 UINT8 LineWidthUnits; 00048 TEXTSTYLE TextStyle; 00049 LINESTYLE Style[4]; //!< Colors and such 00050 MISTRING UnitLabel; 00051 00052 DISPPARM (); 00053 DISPPARM (const DISPPARM& rhs) { 00054 Copy(rhs); 00055 } 00056 virtual ~DISPPARM () { 00057 Free(); 00058 } 00059 00060 DISPPARM& operator= (const DISPPARM& rhs) { 00061 if (this != &rhs) { 00062 Free(); 00063 Copy(rhs); 00064 } 00065 return (*this); 00066 } 00067 00068 protected: 00069 virtual const SERIALIZER::ITEMDEF* SerialGetItemDef (SERIALIZER& serializer) const; 00070 00071 private: 00072 #ifndef GENERATING_DOXYGEN_OUTPUT 00073 void Copy (const DISPPARM&); 00074 void Free (); 00075 #endif //!< GENERATING_DOXYGEN_OUTPUT 00076 }; 00077 00078 //! Construct instance of this layer type 00079 static int Construct ( 00080 GRE_GROUP *group, //!< Group to contain layer 00081 GRE_LAYER **retlayer, //!< Layer returned 00082 GRE_LAYER *reflayer, //!< Reference layer for insertion 00083 UINT32 flags //!< Creation flags 00084 ); 00085 00086 //! Register this layer type 00087 static void RegisterType ( 00088 ); 00089 00090 //! Install SML class, called by internal SML function. 00091 static void SMLClassInstall ( 00092 SMLCONTEXT *context 00093 ); 00094 00095 //! Construct layer and insert into list 00096 explicit GRE_LAYER_SCALEBAR ( 00097 GRE_GROUP *group, //!< Group to contain layer 00098 GRE_LAYER *reflayer = 0, //!< Reference layer for insertion 00099 UINT32 flags = MDISPCREATE_InsertAfter //!< MDISPCREATE flags 00100 ); 00101 00102 //! Destructor. 00103 virtual ~GRE_LAYER_SCALEBAR (); 00104 00105 #ifndef GENERATING_DOXYGEN_OUTPUT 00106 int DrawScaleBar (GRE_LAYERDC&, void*); 00107 #endif //!< GENERATING_DOXYGEN_OUTPUT 00108 00109 //! Retrieve layer-specific display parameters. 00110 const DISPPARM& GetDispParm ( 00111 ) const { return (m_dispparm); } 00112 00113 //! Set layer-specific display parameters. 00114 //! This is the recommended method for changing how an existing layer is to be 00115 //! rendered. Validation will be performed on the specified parameters and 00116 //! adjustments made to the layer's copy if necessary. Use of this method 00117 //! usually result in a ChangeBegin / ChangeEnd message pair, and will also 00118 //! generate a ChangeObject message if the spatial object used in the layer 00119 //! is changed. 00120 ERRVALUE SetDispParm ( 00121 const DISPPARM& dispparm //!< Parameters to set 00122 ); 00123 00124 protected: 00125 00126 DISPPARM m_dispparm; //!< Layer-specific display parameters 00127 00128 private: 00129 #ifndef GENERATING_DOXYGEN_OUTPUT 00130 00131 void ReadDefaultsIni (); 00132 void SaveDefaultsIni (); 00133 00134 //! Overrides from GRE_LAYER. 00135 #if defined(X_NATIVE) || defined(WIN32_MFC) 00136 virtual int v_ControlPanel (MDLGPARENT dlgparent,UINT32 flags = 0); 00137 #endif 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