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
00045 #ifndef INC_GRE_LAYERDC_H
00046 #define INC_GRE_LAYERDC_H
00047
00048 #ifndef INC_MI32_GRE_H
00049 #include <mi32/gre.h>
00050 #endif
00051
00052 #ifndef INC_MI32_REGION2D_H
00053 #include <mi32/region2d.h>
00054 #endif
00055
00056
00057
00058
00059 class GRE_LAYERDC : public POLYLINE::CLIP {
00060 public:
00061
00062 GRE_LAYER *layer;
00063 GRE_VIEW *view;
00064 MGD::CONTEXT* ggc;
00065 GRE_VIEWPOINT3D *ViewPoint;
00066 GRE_LAYER_SURFACE *surflayer;
00067 const GRE_LAYER_SURFACE::DISPPARM *surfdp;
00068 DRECT2D ObjClipRect;
00069 double LayoutScale;
00070 double MapScale;
00071 double RotAngle;
00072 double cosrot, sinrot;
00073 double xpixelsize, ypixelsize;
00074 double surfinc;
00075 double MapScaleZ;
00076 COLOR BackgroundColor;
00077 UINT32 drawflags;
00078 UINT32 Clip3DFlags;
00079 bool Is3D;
00080 bool UseSurface;
00081 bool SurfHasNull;
00082 bool NoDrawActive;
00083 UINT8 ViewIndex;
00084 bool ScaleToMap3D;
00085
00086
00087 explicit GRE_LAYERDC (
00088 GRE_LAYER *layer,
00089 GRE_VIEW *view = 0,
00090 MGD::CONTEXT* ggc = 0,
00091 UINT32 drawflags = 0
00092 );
00093
00094
00095
00096
00097 GRE_LAYERDC (
00098 GRE_VIEW *view,
00099 MGD::CONTEXT* ggc,
00100 const TRANS2D_MAPGEN& ObjectToDevice,
00101 UINT32 drawflags = 0
00102 );
00103
00104
00105 virtual ~GRE_LAYERDC ();
00106
00107
00108
00109 ERRVALUE DrawLine2D (
00110 POLYLINE& PolyLine
00111 ) { return (OnClip(PolyLine)); }
00112
00113
00114
00115 int DrawLineClipped2D (
00116 POLYLINE& PolyLine
00117 ) const;
00118
00119
00120
00121 int DrawLineClipped2DNoTrans (
00122 POLYLINE& PolyLine
00123 ) const;
00124
00125
00126
00127 int DrawLineClipped3D (
00128 POLYLINE& PolyLine
00129 ) const;
00130
00131
00132
00133 int DrawLineClipped3D (
00134 DPOINT3D* points,
00135 INT32 NumPoints
00136 ) const;
00137
00138
00139
00140 int DrawSegment3D (
00141 const DPOINT3D& point1,
00142 const DPOINT3D& point2
00143 ) const;
00144
00145
00146 const REGION2D& GetClipRegion (
00147 ) const { return (m_ClipRegion); }
00148
00149
00150 GRE_LAYER* GetLayer (
00151 ) const { return (layer); }
00152
00153
00154 const DRECT2D& GetObjectClipRect (
00155 ) const { return (this->ObjClipRect); }
00156
00157
00158 ERRVALUE GetSurfaceZ (
00159 DPOINT3D* points,
00160 INT32 NumPoints
00161 ) const;
00162
00163
00164 ERRVALUE GetSurfaceZ (
00165 POLYLINE& polyline
00166 ) const;
00167
00168
00169 const TRANS2D_MAPGEN& GetTransLayerDevice (
00170 ) const { return (m_Trans); }
00171
00172
00173 const TRANS2D_MAPGEN& GetTransLayerSurface (
00174 ) const { return (m_ObjToSurf); }
00175
00176
00177 bool IsHidden (
00178 ) const { return (m_IsHidden); }
00179
00180
00181 void NotifyDrawElementBegin (
00182 const RVC::ELEMENT& element
00183 ) const { view->NotifyDrawElementBegin(layer,element); }
00184
00185
00186 void NotifyDrawElementBegin (
00187 ELEMTYPE ElemType,
00188 INT32 ElemNum
00189 ) const { view->NotifyDrawElementBegin(layer,RVC::ELEMENT(ElemNum,ElemType)); }
00190
00191
00192 void NotifyDrawElementEnd (
00193 const RVC::ELEMENT& element
00194 ) const { view->NotifyDrawElementEnd(layer,element); }
00195
00196
00197 void NotifyDrawElementEnd (
00198 ELEMTYPE ElemType,
00199 INT32 ElemNum
00200 ) const { view->NotifyDrawElementEnd(layer,RVC::ELEMENT(ElemNum,ElemType)); }
00201
00202
00203 void SetTransLayerDevice (
00204 const TRANS2D_MAPGEN& tmg
00205 ) { m_Trans = tmg; }
00206
00207
00208
00209 ERRVALUE Setup2D (
00210 );
00211
00212
00213
00214 ERRVALUE Setup3D (
00215 const GRE_VIEWPOINT3D& ViewPoint,
00216 int ViewIndex = 0
00217 );
00218
00219
00220
00221 int TransPoint3D (
00222 DPOINT3D& ipoint,
00223 DPOINT3D& opoint
00224 ) const;
00225
00226 private:
00227 #ifndef GENERATING_DOXYGEN_OUTPUT
00228
00229 TRANS2D_MAPGEN m_Trans;
00230 TRANS2D_MAPGEN m_ObjToSurf;
00231 REGION2D m_ClipRegion;
00232 bool m_CheckVisible;
00233 bool m_IsHidden;
00234
00235 GRE_LAYERDC (const GRE_LAYERDC&);
00236 GRE_LAYERDC& operator= (const GRE_LAYERDC&);
00237
00238 virtual ERRVALUE OnClip (const POLYLINE& PolyLine);
00239
00240 #endif
00241 };
00242
00243
00244
00245 #endif