00001 /** 00002 * \file gre/elemparms.h <gre/elemparms.h> 00003 * \brief GRE element parameter definitions 00004 * 00005 * \if NODOC 00006 * $Id: elemparms.h_v 1.4 2006/09/28 13:14:57 mju Exp $ 00007 * 00008 * $Log: elemparms.h_v $ 00009 * Revision 1.4 2006/09/28 13:14:57 mju 00010 * Use legendparms hdr. 00011 * 00012 * Revision 1.3 2006/09/28 13:04:04 mju 00013 * Use datatip hdr. 00014 * 00015 * Revision 1.2 2006/09/27 16:17:39 mju 00016 * Move extruded parm classes to own hdr. 00017 * 00018 * Revision 1.1 2006/09/21 22:00:32 mju 00019 * Initial revision 00020 * 00021 * \endif 00022 **/ 00023 00024 #ifndef INC_GRE_ELEMPARMS_H 00025 #define INC_GRE_ELEMPARMS_H 00026 00027 #ifndef INC_GRE_BASE_H 00028 #include <gre/base.h> 00029 #endif 00030 00031 #ifndef INC_MI32_SERIALIZERBASE_H 00032 #include <mi32/serializerbase.h> 00033 #endif 00034 00035 #ifndef INC_RVC_STYLETYPE_H 00036 #include <rvc/styletype.h> 00037 #endif 00038 00039 #ifndef INC_MI32_GREMODE_H 00040 #include <mi32/gremode.h> 00041 #endif 00042 00043 #ifndef INC_MI32_LABLSTYL_H 00044 #include <mi32/lablstyl.h> 00045 #endif 00046 00047 #ifndef INC_GRE_DATATIP_H 00048 #include <gre/datatip.h> 00049 #endif 00050 00051 #ifndef INC_GRE_LEGENDPARMS_H 00052 #include <gre/legendparms.h> 00053 #endif 00054 00055 00056 #ifndef GENERATING_DOXYGEN_OUTPUT 00057 namespace RVC { 00058 class DBASE; 00059 } 00060 #endif 00061 00062 00063 namespace GRE { 00064 //=================================================================================================================== 00065 00066 #define LABELSELECT_None 0x0000 00067 #define LABELSELECT_AllDrawnElem 0x0001 //!< Show labels for all "drawn" elements 00068 #define LABELSELECT_IfFit 0x0002 //!< If label fits inside/alongside element 00069 00070 #define LABELTEXT_None 0x0000 00071 #define LABELTEXT_ByAttribute 0x0001 00072 #define LABELTEXT_ByField LABELTEXT_ByAttribute 00073 #define LABELTEXT_ByScript 0x0002 00074 #define LABELTEXT_ByQuery LABELTEXT_ByScript 00075 00076 #define LABELPOSN_Default 0 00077 00078 #define LABELPOSN_PointAboveLeft 1 00079 #define LABELPOSN_PointAboveCenter 2 00080 #define LABELPOSN_PointAboveRight 3 00081 #define LABELPOSN_PointCenterLeft 4 00082 #define LABELPOSN_PointCenter 5 00083 #define LABELPOSN_PointCenterRight 6 00084 #define LABELPOSN_PointBelowLeft 7 00085 #define LABELPOSN_PointBelowCenter 8 00086 #define LABELPOSN_PointBelowRight 9 00087 00088 #define AUTOLABELOPTM_None 0x00 00089 #define AUTOLABELOPTM_Fast 0x01 00090 #define AUTOLABELOPTM_Full 0x02 00091 #define AUTOLABELOPTM_HideOverlap 0x04 00092 00093 #define AUTOLABELPRIORITY_AllSame 0 00094 #define AUTOLABELPRIORITY_ByField 1 00095 #define AUTOLABELPRIORITY_ByScript 2 00096 00097 00098 //=================================================================================================================== 00099 // Parameters needed for various element types 00100 00101 //! Selection parameters for determining which elements to draw 00102 struct SELECTPARMS { 00103 public: 00104 UINT16 Mode; //!< Selection mode - SELECTMODE_... 00105 INT16 Table; //!< 'Selection' table number 00106 MIUNICODE *QueryStr; //!< Query script for selection by query 00107 RVC::OBJECTNAME TableName; //!< 'Selection' table name 00108 00109 SELECTPARMS ( //! Default constructor 00110 ); 00111 SELECTPARMS ( //! Copy constructor 00112 const SELECTPARMS& rhs 00113 ); 00114 ~SELECTPARMS (); //! Destructor 00115 00116 SELECTPARMS& operator= ( //! Assignment 00117 const SELECTPARMS& rhs 00118 ); 00119 00120 //! Check and validate for specified database and optionally fix mode if none valid. 00121 void CheckTable ( 00122 const RVC::DBASE& db, //!< Database object 00123 bool fixmode //!< Fix selection mode if necessary 00124 ); 00125 00126 //! Determine if need to have a valid database table. 00127 bool NeedTable ( 00128 ) const { return ((Mode & SELECTMODE_NeedsTable) != 0); } 00129 00130 //! Validate settings and fix if necessary. 00131 void Validate (); 00132 }; 00133 00134 //! Basic style parameters for element drawing 00135 struct STYLEPARMS { 00136 public: 00137 UINT16 Mode; //!< Selection mode - STYLEMODE_... 00138 INT16 Table; //!< 'Style assignment' table number 00139 MIUNICODE *QueryStr; //!< Query string for styling by scipt 00140 RVC::OBJECTNAME TableName; //!< 'Style Assignment' table name 00141 00142 STYLEPARMS ( //! Default constructor 00143 ); 00144 STYLEPARMS ( //! Copy constructor 00145 const STYLEPARMS& rhs 00146 ); 00147 ~STYLEPARMS (); //! Destructor 00148 00149 STYLEPARMS& operator= ( //! Assignment 00150 const STYLEPARMS& rhs 00151 ); 00152 00153 //! Check and validate for specified database and optionally fix mode if none valid. 00154 void CheckTable ( 00155 const RVC::DBASE& db, //!< Database object 00156 bool fixmode, //!< Fix selection mode if necessary 00157 const RVC::STYLETYPE styletype = RVC::STYLETYPE_NumTypes 00158 ); 00159 00160 //! Determine if need to have a valid database table. 00161 bool NeedTable ( 00162 ) const { return ((Mode & STYLEMODE_NeedsTable) != 0); } 00163 00164 //! Validate settings and fix if necessary. 00165 void Validate (); 00166 }; 00167 00168 //! Automatic labeling parameters 00169 struct AUTOLABELPARMS { 00170 public: 00171 static const SERIALIZERITEM *GetSerialItemDef(); 00172 UINT8 SelectMode; //!< LABELSELECT_... 00173 UINT8 TextMode; //!< LABELTEXT_... 00174 UINT8 Posn; //!< LABELPOSN_... Label position relative to element 00175 UINT8 Optm; //!< AUTOLABELOPTM_... Optimization 00176 UINT8 Priority; //!< AUTOLABELPRIORITY_... priority mode 00177 RVC::OBJECTNAME TableName; //!< Table name for LABELMODE_ByField 00178 RVC::OBJECTNAME FieldName; //!< Field name for LABELMODE_ByField 00179 MIUNICODE *QueryStr; //!< Query string for LABELMODE_ByScript 00180 TEXTSTYLE Style; //!< Label style 00181 LABELFRAMEPARMS FrameParms; //!< Label Frame Parameters 00182 RVC::OBJECTNAME PriorityTableName; //!< Table name for AUTOLABELPRIORITY_ByField 00183 RVC::OBJECTNAME PriorityFieldName; //!< Field name for AUTOLABELPRIORITY_ByField 00184 double m_MinScaleVisible; //!< Minimum scale at which labels are visible 00185 double m_MaxScaleVisible; //!< Maximum scale at which labels are visible 00186 00187 //! Default constructor 00188 AUTOLABELPARMS ( 00189 ); 00190 00191 //! Copy constructor 00192 AUTOLABELPARMS ( 00193 const AUTOLABELPARMS& rhs 00194 ); 00195 00196 //! Destructor 00197 ~AUTOLABELPARMS ( 00198 ); 00199 00200 //! Assignment 00201 AUTOLABELPARMS& operator= ( 00202 const AUTOLABELPARMS& rhs 00203 ); 00204 00205 //! Check and validate for specified database and optionally fix mode if none valid. 00206 void CheckTable ( 00207 const RVC::DBASE& db, //!< Database object 00208 bool fixmode //!< Fix mode if necessary 00209 ); 00210 00211 //! Determine if labels are selected and visible at specified scale. 00212 bool IsSelected ( 00213 double scale //!< Map scale 00214 ) const { return (SelectMode != LABELSELECT_None && scale >= m_MinScaleVisible && (m_MaxScaleVisible <= 0.0 || scale <= m_MaxScaleVisible)); } 00215 00216 void Validate (); 00217 00218 private: 00219 #ifndef GENERATING_DOXYGEN_OUTPUT 00220 void Copy (const AUTOLABELPARMS& rhs); 00221 #endif // GENERATING_DOXYGEN_OUTPUT 00222 }; 00223 00224 //! Point/Node element parameters. 00225 struct POINTPARMS { 00226 public: 00227 00228 struct POINTSTYLEPARMS : public STYLEPARMS { 00229 POINTSTYLE Normal; //!< Style to use in normal drawing 00230 }; 00231 00232 SELECTPARMS Select; 00233 POINTSTYLEPARMS Style; 00234 DATATIPPARMS DataTip; //!< DataTip parameters 00235 AUTOLABELPARMS AutoLabel; 00236 LEGENDPARMS Legend; 00237 RVC::OBJECTNAME LegendElemTableName; 00238 00239 POINTPARMS (); 00240 POINTPARMS (const POINTPARMS& rhs); 00241 ~POINTPARMS (); 00242 00243 POINTPARMS& operator= (const POINTPARMS& rhs); 00244 void Validate (); 00245 }; 00246 00247 //! Line element parameters 00248 struct LINEPARMS { 00249 public: 00250 00251 struct LINESTYLEPARMS : public STYLEPARMS { 00252 LINESTYLE Normal; //!< Style to use in normal drawing 00253 }; 00254 00255 SELECTPARMS Select; 00256 LINESTYLEPARMS Style; 00257 DATATIPPARMS DataTip; //!< DataTip parameters 00258 AUTOLABELPARMS AutoLabel; 00259 LEGENDPARMS Legend; 00260 RVC::OBJECTNAME LegendElemTableName; 00261 00262 LINEPARMS (); 00263 LINEPARMS (const LINEPARMS& rhs); 00264 ~LINEPARMS (); 00265 00266 LINEPARMS& operator= (const LINEPARMS& rhs); 00267 void Validate (); 00268 }; 00269 00270 //! Polygon/Area element parameters 00271 struct POLYPARMS { 00272 public: 00273 00274 struct POLYSTYLEPARMS : public STYLEPARMS { 00275 POLYSTYLE Normal; //!< Style to use in normal drawing 00276 }; 00277 00278 SELECTPARMS Select; 00279 POLYSTYLEPARMS Style; 00280 DATATIPPARMS DataTip; //!< DataTip parameters 00281 AUTOLABELPARMS AutoLabel; 00282 LEGENDPARMS Legend; 00283 LEGENDPARMS LegendInt; //!< Label inside the polygon sample 00284 RVC::OBJECTNAME LegendElemTableName; 00285 bool ShowInteriorLabel; //!< Show the label inside the polygon sample 00286 bool ShowLabel; //!< Show the label outside the polygon sample 00287 00288 POLYPARMS (); 00289 POLYPARMS (const POLYPARMS& rhs); 00290 ~POLYPARMS (); 00291 00292 POLYPARMS& operator= (const POLYPARMS& rhs); 00293 void Validate (); 00294 }; 00295 00296 //! Label/Text element parameters 00297 struct LABELPARMS { 00298 public: 00299 00300 struct LABELSTYLEPARMS : public STYLEPARMS { 00301 TEXTSTYLE Normal; //!< Style to use in normal drawing 00302 LABELFRAMEPARMS FrameParms; 00303 00304 LABELSTYLEPARMS (); 00305 }; 00306 00307 SELECTPARMS Select; 00308 LABELSTYLEPARMS Style; 00309 DATATIPPARMS DataTip; //!< DataTip parameters 00310 double MinScaleVisible; //!< Minimum scale at which labels are visible 00311 double MaxScaleVisible; //!< Maximum scale at which labels are visible 00312 00313 LABELPARMS (); 00314 LABELPARMS (const LABELPARMS& rhs); 00315 ~LABELPARMS (); 00316 00317 LABELPARMS& operator= (const LABELPARMS& rhs); 00318 00319 //! Determine if labels are visible at specified scale. 00320 bool IsVisibleAtScale ( 00321 double scale //!< Map scale 00322 ) const { return (scale >= MinScaleVisible && (MaxScaleVisible <= 0.0 || scale <= MaxScaleVisible)); } 00323 void Validate (); 00324 }; 00325 00326 //=================================================================================================================== 00327 } // End namespace GRE 00328 #endif // INC_GRE_ELEMPARMS_H
1.5.2