00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #ifndef INC_GRE_LRMAPGRD_H
00045 #define INC_GRE_LRMAPGRD_H
00046
00047 #ifndef INC_MI32_GRE_H
00048 #include <mi32/gre.h>
00049 #endif
00050
00051
00052
00053
00054
00055 class GRE_LAYER_MAPGRID : public GRE_LAYER {
00056 public:
00057
00058 class DISPPARM : public GRE_LAYER::DISPPARM {
00059 public:
00060
00061 class DLG;
00062
00063 TEXTSTYLE CoordLabelStyle;
00064 TEXTSTYLE AxisLabelStyle;
00065 double xinterval;
00066 double yinterval;
00067 double zinterval;
00068 double xdegrees;
00069 double ydegrees;
00070 MAPPROJPARM IntervalProj;
00071 MAPPROJPARM ExtentsProj;
00072 DRECT3D MapExtents;
00073 UINT8 IntervalUnitsXY;
00074 UINT8 IntervalUnitsZ;
00075 UINT8 IntervalLatLonFormat;
00076 UINT8 ExtentsUnits;
00077 UINT8 ExtentsLatLonFormat;
00078 LINESTYLE StyleGrid;
00079 LINESTYLE StyleBorder;
00080 LINESTYLE StyleBorderTickExt;
00081 LINESTYLE StyleInteriorTick;
00082 COLOR BorderTickIntColor1;
00083 COLOR BorderTickIntColor2;
00084 COLOR InteriorTickColor2;
00085 double GridWidth;
00086 double BorderWidth;
00087 double BorderTickExtWidth;
00088 double BorderTickExtLength;
00089 double BorderTickIntWidth;
00090 double BorderTickIntLength;
00091 double InteriorTickWidth;
00092 double InteriorTickLength;
00093 double BorderTextOffset;
00094 double GraphicMapScale;
00095 UINT8 GridWidthUnits;
00096 UINT8 BorderWidthUnits;
00097 UINT8 BorderTickExtWidthUnits;
00098 UINT8 BorderTickExtLengthUnits;
00099 UINT8 BorderTickIntWidthUnits;
00100 UINT8 BorderTickIntLengthUnits;
00101 UINT8 InteriorTickLengthUnits;
00102 UINT8 InteriorTickWidthUnits;
00103 UINT8 BorderTextOffsetUnits;
00104 UINT32 CoordFormatLatLon;
00105 UINT32 CoordFormatProj;
00106 UINT8 OldProjUnits;
00107 UINT8 VerticalAxes;
00108 UINT8 CoordOrient;
00109 UNICODE CoordUnitNameXY[32];
00110 UNICODE CoordUnitNameZ[32];
00111 UNICODE AxisLabelX[64];
00112 UNICODE AxisLabelY[64];
00113 UNICODE AxisLabelZ[64];
00114 DOUBLE_ARRAY<DPOINT2D> m_ToggledTickCoords;
00115
00116 DISPPARM ();
00117 DISPPARM (const DISPPARM& rhs) { Copy(rhs); }
00118 ~DISPPARM () { Free(); }
00119
00120 DISPPARM& operator= (
00121 const DISPPARM& rhs
00122 ) { if (this != &rhs) { Free(); Copy(rhs); } return (*this); }
00123
00124
00125
00126
00127 void InitExtents (
00128 const GRE_LAYER_MAPGRID *layer
00129 );
00130
00131 virtual ERRVALUE Validate ();
00132
00133 protected:
00134 virtual const SERIALIZER::ITEMDEF* SerialGetItemDef (SERIALIZER& serializer) const;
00135 static int SerializerCB_TickToggledCoords (SERIALIZER& serializer, const SERIALIZER::ITEMDEF *itemdef, void *cbdata, SERIALIZER::ITEMDEF::ACTION action);
00136
00137 private:
00138 #ifndef GENERATING_DOXYGEN_OUTPUT
00139 void Copy (const DISPPARM&);
00140 void Free ();
00141 #endif
00142 };
00143
00144
00145 static int Construct (
00146 GRE_GROUP *group,
00147 GRE_LAYER **retlayer,
00148 GRE_LAYER *reflayer,
00149 UINT32 flags
00150 );
00151
00152
00153 static void RegisterType (
00154 );
00155
00156
00157 static void SMLClassInstall (
00158 SMLCONTEXT *context
00159 );
00160
00161
00162 explicit GRE_LAYER_MAPGRID (
00163 GRE_GROUP *group,
00164 GRE_LAYER *reflayer = 0,
00165 UINT32 flags = MDISPCREATE_InsertAfter
00166 );
00167
00168
00169 virtual ~GRE_LAYER_MAPGRID ();
00170
00171
00172 const DISPPARM& GetDispParm (
00173 ) const { return (m_dispparm); }
00174
00175
00176
00177
00178
00179
00180
00181
00182 ERRVALUE SetDispParm (
00183 const DISPPARM& dispparm
00184 );
00185
00186 protected:
00187
00188 DISPPARM m_dispparm;
00189
00190 private:
00191 #ifndef GENERATING_DOXYGEN_OUTPUT
00192
00193 class PRIVDRAWDATA;
00194 friend class PRIVDRAWDATA;
00195
00196 struct TICK {
00197 enum TYPE {
00198 TYPE_Interior = 0,
00199 TYPE_MinX = 1,
00200 TYPE_MaxX = 2,
00201 TYPE_MinY = 3,
00202 TYPE_MaxY = 4
00203 };
00204 enum FLAGS {
00205 FLAG_None = 0x00,
00206 FLAG_Lowest = 0x01,
00207 FLAG_AltColor = 0x02,
00208 FLAG_Corner = 0x04
00209 };
00210 DPOINT2D m_pt;
00211 DPOINT2D m_pt2;
00212 double m_label;
00213 TYPE m_type;
00214 FLAGS m_flags;
00215
00216 TICK (
00217 const DPOINT2D& pt,
00218 const DPOINT2D& pt2,
00219 TYPE type,
00220 FLAGS flags = FLAG_None,
00221 double label = 0
00222 );
00223 };
00224
00225 TRANS2D_MAPGEN m_TransMapToExt;
00226 DRECT2D m_GridRect;
00227 DPOINT2D m_GridInterval;
00228 SIMPLE_ARRAY<TICK> m_Ticks;
00229 int m_ActiveTick;
00230 void *m_LabelList;
00231
00232 #if defined(X_NATIVE)
00233 static void CB_ToggleTickColor (Widget, void*, void*);
00234 #endif
00235 static void SMLGET_MapGridInterval (SMLCONTEXT*, SMLCLASSMEMBER*, void*, SMLARG*);
00236 static void SMLSET_MapGridInterval (SMLCONTEXT*, SMLCLASSMEMBER*, void*, SMLARG*);
00237
00238 ERRVALUE OnToggleTickColor ();
00239 void ReadDefaultsIni ();
00240 void SaveDefaultsIni ();
00241 ERRVALUE TickAddCornerPoints ();
00242 ERRVALUE TickAddEdgePoint (const DPOINT2D& label, const DPOINT2D& pt, const DPOINT2D& pt2, TICK::TYPE type, TICK::FLAGS flags);
00243 ERRVALUE TickCalcPoints ();
00244 ERRVALUE TickLoadToggledCoords ();
00245 ERRVALUE TickSaveToggledCoords ();
00246
00247
00248 #if defined(X_NATIVE)
00249 virtual void v_AppendPopupMenuItems (Widget widget, const DPOINT2D *point, MENUITEMARRAY& menuitems);
00250 #endif
00251 virtual void v_ComputeMargins (double& tmargin, double& bmargin, double& lmargin, double& rmargin);
00252 #if defined(X_NATIVE) || defined(WIN32_MFC)
00253 virtual int v_ControlPanel (MDLGPARENT dlgparent, UINT32 flags = 0);
00254 #endif
00255 virtual ERRVALUE v_Draw (GRE_LAYERDC& layerdc);
00256 virtual const char* v_SerialGetTagName () const;
00257 virtual ERRVALUE v_SerialRead (SERIALIZER& serializer);
00258 virtual void v_SetDftName (bool ReplaceExisting);
00259 virtual int v_UpdateExtents (bool forceupdate);
00260
00261 GRE_LAYER_MAPGRID (const GRE_LAYER_MAPGRID&);
00262 GRE_LAYER_MAPGRID& operator= (const GRE_LAYER_MAPGRID&);
00263
00264 #endif
00265 };
00266
00267 #define MAPGRIDDISPFLAG_SizeRelative (0x00000001)
00268 #define MAPGRIDDISPFLAG_ShowBorderTicksExt (0x00000002)
00269 #define MAPGRIDDISPFLAG_ShowBorderTicksInt (0x00000004)
00270 #define MAPGRIDDISPFLAG_ShowGrid (0x00000010)
00271 #define MAPGRIDDISPFLAG_ShowBorderTicks (0x00000020)
00272 #define MAPGRIDDISPFLAG_ShowCoordText2D (0x00000040)
00273 #define MAPGRIDDISPFLAG_ShowBorder (0x00000080)
00274 #define MAPGRIDDISPFLAG_ShowInteriorTicks (0x00000100)
00275 #define MAPGRIDDISPFLAG_ShowCoordText3D (0x00000200)
00276 #define MAPGRIDDISPFLAG_ShowBorderBottom3D (0x00000400)
00277 #define MAPGRIDDISPFLAG_ShowBorderTop3D (0x00000800)
00278 #define MAPGRIDDISPFLAG_BorderRelative (0x00001000)
00279 #define MAPGRIDDISPFLAG_ShowVerticalTicks (0x00002000)
00280 #define MAPGRIDDISPFLAG_LayoutScale (0x00004000)
00281 #define MAPGRIDDISPFLAG_ShowVerticalScale (0x00008000)
00282 #define MAPGRIDDISPFLAG_ShowMinSec0 (0x00010000)
00283 #define MAPGRIDDISPFLAG_ShowDegOnlyIfMin0 (0x00020000)
00284 #define MAPGRIDDISPFLAG_ShowCornerText2D (0x00040000)
00285 #define MAPGRIDDISPFLAG_ShowCornerText3D (0x00080000)
00286
00287 #define MAPGRIDDISPFLAGS_ShowBorderTicksAny (MAPGRIDDISPFLAG_ShowBorderTicks | MAPGRIDDISPFLAG_ShowBorderTicksExt | MAPGRIDDISPFLAG_ShowBorderTicksInt)
00288
00289 #define MAPGRID_COORDFMTLATLON_MASK 0x000F
00290 #define MAPGRID_COORDFMTLATLON_DDMMSS 0x0000
00291 #define MAPGRID_COORDFMTLATLON_DDdddd 0x0001
00292 #define MAPGRID_COORDFMTLATLON_DDMMmmm 0x0002
00293 #define MAPGRID_COORDFMTLATLON_DDMMSSss 0x0003
00294 #define MAPGRID_COORDFMTLATLON_DDMMSSs 0x0004
00295 #define MAPGRID_COORDFMTLATLON_None 0x000F
00296 #define MAPGRID_COORDFMTLATLON_NoSymbol 0x0020
00297 #define MAPGRID_COORDFMTLATLON_AddSpace 0x0040
00298 #define MAPGRID_COORDFMTLATLON_Leading0Deg 0x0080
00299 #define MAPGRID_COORDFMTLATLON_Leading0MS 0x0100
00300 #define MAPGRID_COORDFMTLATLON_DirFirst 0x0200
00301 #define MAPGRID_COORDFMTLATLON_DirLast 0x0400
00302
00303 #define MAPGRID_COORDFMTPROJ_Space 0
00304 #define MAPGRID_COORDFMTPROJ_Comma 1
00305 #define MAPGRID_COORDFMTPROJ_Period 2
00306 #define MAPGRID_COORDFMTPROJ_NoSpace 3
00307 #define MAPGRID_COORDFMTPROJ_xXXxxxN 4
00308 #define MAPGRID_COORDFMTPROJ_xXXxxx 5
00309 #define MAPGRID_COORDFMTPROJ_xXXxxx_XX 6
00310 #define MAPGRID_COORDFMTPROJ_xXXxxxN_XX 7
00311 #define MAPGRID_COORDFMTPROJ_xXXxxxNp_XX 8
00312
00313 #define MAPGRID_COORDORIENT_Horizontal 0
00314 #define MAPGRID_COORDORIENT_Parallel 1
00315 #define MAPGRID_COORDORIENT_Perpendicular 2
00316 #define MAPGRID_COORDORIENT_AlongTick 3
00317 #define MAPGRID_COORDORIENT_Vertical 4
00318
00319 #define MAPGRID_VERTICALAXES_None 0
00320 #define MAPGRID_VERTICALAXES_Farthest1 1
00321 #define MAPGRID_VERTICALAXES_Farthest2 2
00322 #define MAPGRID_VERTICALAXES_Farthest3 3
00323 #define MAPGRID_VERTICALAXES_All 4
00324
00325
00326
00327
00328 #endif