00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef INC_GRE_SCRIPTCONTEXT_H
00019 #define INC_GRE_SCRIPTCONTEXT_H
00020
00021 #ifndef INC_GRE_BASE
00022 #include <gre/base.h>
00023 #endif
00024
00025 #ifndef INC_MI32_SML_H
00026 #include <mi32/sml.h>
00027 #endif
00028
00029 #ifndef INC_MI32_MGD2_H
00030 #include <mi32/mgd2.h>
00031 #endif
00032
00033 #ifndef INC_RVC_CAD_H
00034 #include <rvc/cad.h>
00035 #endif
00036
00037 namespace RVC {
00038 class STYLE;
00039 }
00040
00041
00042
00043 class GRE_SCRIPTCONTEXT_DRAW {
00044 public:
00045
00046
00047 GRE_SCRIPTCONTEXT_DRAW (
00048 );
00049
00050
00051 virtual ~GRE_SCRIPTCONTEXT_DRAW (
00052 );
00053
00054
00055
00056
00057
00058 void AttachContext (
00059 SMLCONTEXT *& context
00060 );
00061
00062
00063 ERRVALUE CreateContext (
00064 RVC::GEOMETRIC& GeoObj
00065 );
00066
00067
00068 void DestroyContext (
00069 ) { if (m_context != 0) { m_context->Destroy(); m_context = 0; } }
00070
00071
00072
00073 SMLCONTEXT * GetContext (
00074 ) const { return (m_context); }
00075
00076
00077 bool HasContext (
00078 ) const { return (m_context != 0); }
00079
00080
00081 ERRVALUE InitDraw (
00082 GRE_LAYER *layer,
00083 MGD::CONTEXT *gc,
00084 const TRANS2D_MAPGEN& trans,
00085 bool Is3D = false
00086 );
00087
00088
00089 ERRVALUE InitDraw (
00090 GRE_LAYERDC& layerdc
00091 );
00092
00093 protected:
00094
00095 virtual void CreateSymbols (
00096 );
00097
00098 private:
00099 #ifndef GENERATING_DOXYGEN_OUTPUT
00100
00101
00102 struct DRAWSYMS {
00103 SMLSYMBOL *CurMapScale;
00104 SMLSYMBOL *LayoutMapScale;
00105 SMLSYMBOL *DesignScale;
00106 };
00107
00108 SMLCONTEXT *m_context;
00109 DRAWSYMS m_drawsym;
00110
00111 GRE_SCRIPTCONTEXT_DRAW (const GRE_SCRIPTCONTEXT_DRAW&);
00112 GRE_SCRIPTCONTEXT_DRAW& operator= (const GRE_SCRIPTCONTEXT_DRAW&);
00113
00114 #endif // GENERATING_DOXYGEN_OUTPUT
00115 };
00116
00117
00118 class GRE_SCRIPTCONTEXT_STYLE : public GRE_SCRIPTCONTEXT_DRAW {
00119 public:
00120
00121
00122 GRE_SCRIPTCONTEXT_STYLE (
00123 );
00124
00125
00126 virtual ~GRE_SCRIPTCONTEXT_STYLE (
00127 );
00128
00129
00130
00131 int CreateSegment (
00132 ELEMTYPE elemtype,
00133 const MIUNICODE *scriptstr
00134 );
00135
00136 ERRVALUE Evaluate (
00137 int segment,
00138 INT32 ElemNum,
00139 const RVC::STYLE& StyleObj,
00140 POINTSTYLE& style,
00141 const DPOINT2D* pt = 0,
00142 bool bDrawingLegendView = false
00143 ) const;
00144
00145 ERRVALUE Evaluate (
00146 int segment,
00147 INT32 ElemNum,
00148 const RVC::STYLE& StyleObj,
00149 LINESTYLE& style,
00150 const SIMPLE_ARRAY<DPOINT2D>* pt = 0,
00151 bool bDrawingLegendView = false
00152 ) const;
00153
00154 ERRVALUE Evaluate (
00155 int segment,
00156 INT32 ElemNum,
00157 const RVC::STYLE& StyleObj,
00158 POLYSTYLE& style,
00159 const SIMPLE_ARRAY<DPOINT2D>* pt = 0,
00160 bool bDrawingLegendView = false
00161 ) const;
00162
00163 ERRVALUE Evaluate (
00164 int segment,
00165 RVC::CAD::ELEMENT& Element,
00166 const RVC::STYLE& StyleObj,
00167 const SIMPLE_ARRAY<DPOINT2D>* pt = 0,
00168 bool bDrawingLegendView = false
00169 ) const;
00170
00171
00172 void SetSampleRect (
00173 const DRECT2D& rect
00174 ) { m_stylesym.rect = rect; }
00175
00176 protected:
00177
00178 virtual void CreateSymbols (
00179 );
00180
00181 private:
00182 #ifndef GENERATING_DOXYGEN_OUTPUT
00183
00184
00185 struct STYLESYMS {
00186 SMLSYMBOL *Style;
00187 SMLSYMBOL *Symbol;
00188 SMLSYMBOL *DrawPatt;
00189 SMLSYMBOL *FillPatt;
00190 SMLSYMBOL *DrawColor;
00191 SMLSYMBOL *FillColor;
00192 SMLSYMBOL *LineScale;
00193 SMLSYMBOL *XScale;
00194 SMLSYMBOL *YScale;
00195 SMLSYMBOL *Angle;
00196 SMLSYMBOL *UseStyle;
00197 SMLSYMBOL *DrawSymbol;
00198 SMLSYMBOL *DrawLinePatt;
00199 SMLSYMBOL *DrawBitmapPatt;
00200 SMLSYMBOL *FillBitmapPatt;
00201 SMLSYMBOL *FillHatchPatt;
00202 SMLSYMBOL *FillInside;
00203 SMLSYMBOL *DrawBorder;
00204 SMLSYMBOL *MapScale;
00205 SMLSYMBOL *DrawDone;
00206 SMLSYMBOL *DrawTransPct;
00207 SMLSYMBOL *FillTransPct;
00208 SMLSYMBOL *DrawingSample;
00209 SMLSYMBOL *DrawingLegendView;
00210 SMLSYMBOL *SampleRect;
00211 DRECT2D rect;
00212 };
00213
00214 STYLESYMS m_stylesym;
00215
00216 void GetColor (
00217 SMLSYMBOL*,
00218 SMLSYMBOL*,
00219 COLOR& color
00220 ) const;
00221
00222 GRE_SCRIPTCONTEXT_STYLE (const GRE_SCRIPTCONTEXT_STYLE&);
00223 GRE_SCRIPTCONTEXT_STYLE& operator= (const GRE_SCRIPTCONTEXT_STYLE&);
00224
00225 #endif // GENERATING_DOXYGEN_OUTPUT
00226 };
00227
00228
00229 class GRE_SCRIPTCONTEXT_LABEL : public GRE_SCRIPTCONTEXT_DRAW {
00230 public:
00231
00232
00233 GRE_SCRIPTCONTEXT_LABEL (
00234 );
00235
00236
00237 virtual ~GRE_SCRIPTCONTEXT_LABEL (
00238 );
00239
00240 void GetFrameParms (
00241 LABELFRAMEPARMS& parms
00242 ) const;
00243
00244 double GetPriority (
00245 ) const;
00246
00247 void SetFrameParms (
00248 const LABELFRAMEPARMS& parms
00249 );
00250
00251 void SetPriority (
00252 double priority
00253 );
00254
00255 protected:
00256
00257 virtual void CreateSymbols (
00258 );
00259
00260 private:
00261 #ifndef GENERATING_DOXYGEN_OUTPUT
00262
00263
00264 struct LABELSYMS {
00265 SMLSYMBOL *Priority;
00266 SMLSYMBOL *Frame;
00267 };
00268
00269 LABELSYMS m_labelsym;
00270 LABELFRAMEPARMS* m_FrameParms;
00271
00272 GRE_SCRIPTCONTEXT_LABEL (const GRE_SCRIPTCONTEXT_LABEL&);
00273 GRE_SCRIPTCONTEXT_LABEL& operator= (const GRE_SCRIPTCONTEXT_LABEL&);
00274
00275 #endif // GENERATING_DOXYGEN_OUTPUT
00276 };
00277
00278
00279
00280 #endif // INC_GRE_SCRIPTCONTEXT_H