00001 00033 #ifndef INC_GRE_ELEMPARMS_H 00034 #define INC_GRE_ELEMPARMS_H 00035 00036 #ifndef INC_GRE_BASE_H 00037 #include <gre/base.h> 00038 #endif 00039 00040 #ifndef INC_MI32_GREMODE_H 00041 #include <mi32/gremode.h> 00042 #endif 00043 00044 #ifndef INC_MI32_LABLSTYL_H 00045 #include <mi32/lablstyl.h> 00046 #endif 00047 00048 #ifndef INC_GRE_DATATIP_H 00049 #include <gre/datatip.h> 00050 #endif 00051 00052 #ifndef INC_GRE_LEGENDPARMS_H 00053 #include <gre/legendparms.h> 00054 #endif 00055 00056 00057 #ifndef GENERATING_DOXYGEN_OUTPUT 00058 namespace RVC { 00059 class DBASE; 00060 } 00061 #endif 00062 00063 00064 namespace GRE { 00065 //=================================================================================================================== 00066 00067 #define LABELSELECT_None 0x0000 00068 #define LABELSELECT_AllDrawnElem 0x0001 00069 #define LABELSELECT_IfFit 0x0002 00070 00071 #define LABELTEXT_None 0x0000 00072 #define LABELTEXT_ByAttribute 0x0001 00073 #define LABELTEXT_ByField LABELTEXT_ByAttribute 00074 #define LABELTEXT_ByScript 0x0002 00075 #define LABELTEXT_ByQuery LABELTEXT_ByScript 00076 00077 #define LABELPOSN_Default 0 00078 00079 #define LABELPOSN_PointAboveLeft 1 00080 #define LABELPOSN_PointAboveCenter 2 00081 #define LABELPOSN_PointAboveRight 3 00082 #define LABELPOSN_PointCenterLeft 4 00083 #define LABELPOSN_PointCenter 5 00084 #define LABELPOSN_PointCenterRight 6 00085 #define LABELPOSN_PointBelowLeft 7 00086 #define LABELPOSN_PointBelowCenter 8 00087 #define LABELPOSN_PointBelowRight 9 00088 00089 #define AUTOLABELOPTM_None 0x00 00090 #define AUTOLABELOPTM_Fast 0x01 00091 #define AUTOLABELOPTM_Full 0x02 00092 #define AUTOLABELOPTM_HideOverlap 0x04 00093 00094 #define AUTOLABELPRIORITY_AllSame 0 00095 #define AUTOLABELPRIORITY_ByField 1 00096 #define AUTOLABELPRIORITY_ByScript 2 00097 00098 00099 //=================================================================================================================== 00100 // Parameters needed for various element types 00101 00103 struct SELECTPARMS { 00104 public: 00105 UINT16 Mode; 00106 INT16 Table; 00107 MIUNICODE *QueryStr; 00108 RVC::OBJECTNAME TableName; 00109 00110 SELECTPARMS ( 00111 ); 00112 SELECTPARMS ( 00113 const SELECTPARMS& rhs 00114 ); 00115 ~SELECTPARMS (); 00116 00117 SELECTPARMS& operator= ( 00118 const SELECTPARMS& rhs 00119 ); 00120 00122 void CheckTable ( 00123 const RVC::DBASE& db, 00124 bool fixmode 00125 ); 00126 00128 bool NeedTable ( 00129 ) const { return ((Mode & SELECTMODE_NeedsTable) != 0); } 00130 00132 void Validate (); 00133 }; 00134 00136 struct STYLEPARMS { 00137 public: 00138 UINT16 Mode; 00139 INT16 Table; 00140 MIUNICODE *QueryStr; 00141 RVC::OBJECTNAME TableName; 00142 MISTRING m_ImageFieldName; 00143 00144 STYLEPARMS ( 00145 ); 00146 STYLEPARMS ( 00147 const STYLEPARMS& rhs 00148 ); 00149 ~STYLEPARMS (); 00150 00151 STYLEPARMS& operator= ( 00152 const STYLEPARMS& rhs 00153 ); 00154 00156 void CheckTable ( 00157 const RVC::DBASE& db, 00158 bool fixmode, 00159 const RVC::STYLETYPE styletype = RVC::STYLETYPE_NumTypes 00160 ); 00161 00163 bool NeedTable ( 00164 ) const { return ((Mode & STYLEMODE_NeedsTable) != 0); } 00165 00167 void Validate (); 00168 }; 00169 00171 struct AUTOLABELPARMS { 00172 public: 00173 static const SERIALIZERITEM *GetSerialItemDef(); 00174 UINT8 SelectMode; 00175 UINT8 TextMode; 00176 UINT8 Posn; 00177 UINT8 Optm; 00178 UINT8 Priority; 00179 RVC::OBJECTNAME TableName; 00180 RVC::OBJECTNAME FieldName; 00181 MIUNICODE *QueryStr; 00182 TEXTSTYLE Style; 00183 LABELFRAMEPARMS FrameParms; 00184 RVC::OBJECTNAME PriorityTableName; 00185 RVC::OBJECTNAME PriorityFieldName; 00186 double m_MinScaleVisible; 00187 double m_MaxScaleVisible; 00188 00190 AUTOLABELPARMS ( 00191 ); 00192 00194 AUTOLABELPARMS ( 00195 const AUTOLABELPARMS& rhs 00196 ); 00197 00199 ~AUTOLABELPARMS ( 00200 ); 00201 00203 AUTOLABELPARMS& operator= ( 00204 const AUTOLABELPARMS& rhs 00205 ); 00206 00208 void CheckTable ( 00209 const RVC::DBASE& db, 00210 bool fixmode 00211 ); 00212 00214 bool IsSelected ( 00215 double scale 00216 ) const { return (SelectMode != LABELSELECT_None && scale >= m_MinScaleVisible && (m_MaxScaleVisible <= 0.0 || scale <= m_MaxScaleVisible)); } 00217 00218 void Validate (); 00219 00220 private: 00221 #ifndef GENERATING_DOXYGEN_OUTPUT 00222 void Copy (const AUTOLABELPARMS& rhs); 00223 #endif // GENERATING_DOXYGEN_OUTPUT 00224 }; 00225 00227 struct POINTPARMS { 00228 public: 00229 00230 struct POINTSTYLEPARMS : public STYLEPARMS { 00231 POINTSTYLE Normal; 00232 }; 00233 00234 SELECTPARMS Select; 00235 POINTSTYLEPARMS Style; 00236 DATATIPPARMS DataTip; 00237 AUTOLABELPARMS AutoLabel; 00238 LEGENDPARMS Legend; 00239 RVC::OBJECTNAME LegendElemTableName; 00240 00241 POINTPARMS (); 00242 POINTPARMS (const POINTPARMS& rhs); 00243 ~POINTPARMS (); 00244 00245 POINTPARMS& operator= (const POINTPARMS& rhs); 00246 void Validate (); 00247 }; 00248 00250 struct LINEPARMS { 00251 public: 00252 00253 struct LINESTYLEPARMS : public STYLEPARMS { 00254 LINESTYLE Normal; 00255 }; 00256 00257 SELECTPARMS Select; 00258 LINESTYLEPARMS Style; 00259 DATATIPPARMS DataTip; 00260 AUTOLABELPARMS AutoLabel; 00261 LEGENDPARMS Legend; 00262 RVC::OBJECTNAME LegendElemTableName; 00263 00264 LINEPARMS (); 00265 LINEPARMS (const LINEPARMS& rhs); 00266 ~LINEPARMS (); 00267 00268 LINEPARMS& operator= (const LINEPARMS& rhs); 00269 void Validate (); 00270 }; 00271 00273 struct POLYPARMS { 00274 public: 00275 00276 struct POLYSTYLEPARMS : public STYLEPARMS { 00277 POLYSTYLE Normal; 00278 }; 00279 00280 SELECTPARMS Select; 00281 POLYSTYLEPARMS Style; 00282 DATATIPPARMS DataTip; 00283 AUTOLABELPARMS AutoLabel; 00284 LEGENDPARMS Legend; 00285 LEGENDPARMS LegendInt; 00286 RVC::OBJECTNAME LegendElemTableName; 00287 bool ShowInteriorLabel; 00288 bool ShowLabel; 00289 00290 POLYPARMS (); 00291 POLYPARMS (const POLYPARMS& rhs); 00292 ~POLYPARMS (); 00293 00294 POLYPARMS& operator= (const POLYPARMS& rhs); 00295 void Validate (); 00296 }; 00297 00299 struct LABELPARMS { 00300 public: 00301 00302 struct LABELSTYLEPARMS : public STYLEPARMS { 00303 TEXTSTYLE Normal; 00304 LABELFRAMEPARMS FrameParms; 00305 00306 LABELSTYLEPARMS (); 00307 }; 00308 00309 SELECTPARMS Select; 00310 LABELSTYLEPARMS Style; 00311 DATATIPPARMS DataTip; 00312 double MinScaleVisible; 00313 double MaxScaleVisible; 00314 00315 LABELPARMS (); 00316 LABELPARMS (const LABELPARMS& rhs); 00317 ~LABELPARMS (); 00318 00319 LABELPARMS& operator= (const LABELPARMS& rhs); 00320 00322 bool IsVisibleAtScale ( 00323 double scale 00324 ) const { return (scale >= MinScaleVisible && (MaxScaleVisible <= 0.0 || scale <= MaxScaleVisible)); } 00325 void Validate (); 00326 }; 00327 00328 //=================================================================================================================== 00329 } // End namespace GRE 00330 #endif // INC_GRE_ELEMPARMS_H
1.6.1