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
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106 #ifndef INC_GRE_LAYERDC_H
00107 #define INC_GRE_LAYERDC_H
00108
00109 #ifndef INC_GRE_VIEW_H
00110 #include <gre/view.h>
00111 #endif
00112
00113 #ifndef INC_GRE_GROUP_H
00114 #include <gre/group.h>
00115 #endif
00116
00117 #ifndef INC_GRE_LAYERVIEW_H
00118 #include <gre/layerview.h>
00119 #endif
00120
00121 #ifndef INC_GRE_GROUPVIEW_H
00122 #include <gre/groupview.h>
00123 #endif
00124
00125 #ifndef INC_GRE_LRSURFACE_H
00126 #include <gre/lrsurface.h>
00127 #endif
00128
00129 #ifndef INC_MI32_REGION2D_H
00130 #include <mi32/region2d.h>
00131 #endif
00132
00133 #ifndef INC_MI32_SML_H
00134 #include <mi32/sml.h>
00135 #endif
00136
00137
00138
00139
00140
00141 class GRE_LAYERDC : public POLYLINE::CLIP {
00142 public:
00143
00144
00145 GRE_LAYERDC (
00146 GRE_LAYER *layer,
00147 GRE_VIEW *view,
00148 MGD::DEVICE* pDevice = 0,
00149 GRE::DRAWFLAGS drawflags = GRE::DRAWFLAG_None
00150 );
00151
00152
00153
00154 GRE_LAYERDC (
00155 GRE_VIEW *view,
00156 MGD::DEVICE* pDevice,
00157 const TRANS2D_MAPGEN& ObjectToDevice,
00158 GRE::DRAWFLAGS drawflags = GRE::DRAWFLAG_None
00159 );
00160
00161
00162 virtual ~GRE_LAYERDC ();
00163
00164
00165
00166 bool CanDrawLayer (
00167 ) const;
00168
00169
00170 bool CheckColorLock (
00171 MGD::COLORLOCK& colorlock
00172 );
00173
00174
00175 bool CheckColorLock (
00176 MGD::COLORLOCK& colorlock,
00177 ELEMTYPE ElemType,
00178 INT32 ElemNum,
00179 const BITSET& HighlightSet
00180 );
00181
00182
00183 bool CheckColorOverride (
00184 COLOR& color
00185 );
00186
00187 void ClearAllDrawnSets (
00188 );
00189
00190
00191
00192 ERRVALUE DrawLine2D (
00193 POLYLINE& PolyLine
00194 ) { return (OnClip(PolyLine)); }
00195
00196
00197
00198 int DrawLineClipped2D (
00199 POLYLINE& PolyLine
00200 ) const;
00201
00202
00203
00204 int DrawLineClipped2DNoTrans (
00205 POLYLINE& PolyLine
00206 ) const;
00207
00208
00209
00210 int DrawLineClipped3D (
00211 POLYLINE& PolyLine
00212 ) const;
00213
00214
00215
00216 int DrawLineClipped3D (
00217 DPOINT3D* points,
00218 INT32 NumPoints
00219 ) const;
00220
00221
00222
00223 int DrawSegment3D (
00224 const DPOINT3D& point1,
00225 const DPOINT3D& point2
00226 ) const;
00227
00228
00229
00230 bool Fill3dFlatPolygon (
00231 const DPOINT3D *points,
00232 INT32 numPoints
00233 ) const;
00234
00235
00236
00237 bool Fill3dTriangle (
00238 const DPOINT3D *tp[3]
00239 ) const;
00240
00241
00242 double Get3dDepthScale (
00243 ) const { return (m_pLayerView->Get3dDepthScale()); }
00244
00245
00246 const GRE::SCENE3D& Get3dScene (
00247 ) const { return (m_Scene3D); }
00248
00249
00250 GRE::SCENE3D& Get3dScene (
00251 ) { return (m_Scene3D); }
00252
00253
00254 double Get3dSurfaceIncrement (
00255 ) const { return (m_pLayerView->Get3dSurfaceIncrement()); }
00256
00257
00258 GRE::SCENE3D::STEREOVIEW Get3dStereoView (
00259 ) const { return (m_Scene3D.GetStereoView()); }
00260
00261
00262 double Get3dZScale (
00263 ) const { return (m_pLayerView->Get3dZScale()); }
00264
00265
00266 const REGION2D& GetClipRegion (
00267 ) const { return (m_ClipRegion); }
00268
00269
00270 double GetDesignScale (
00271 ) const { return (m_DesignScale); }
00272
00273
00274 GRE::DRAWFLAGS GetDrawFlags (
00275 ) const { return (m_drawflags); }
00276
00277
00278 MGD::CONTEXT* GetDrawingContext (
00279 ) const { return (m_ggc); }
00280
00281
00282 MGD::DEVICE* GetDrawingDevice (
00283 ) const { return (m_ggc == 0 ? 0 : &m_ggc->GetDevice()); }
00284
00285
00286 double GetDrawingScale (
00287 ) const { return (m_DrawingScale); }
00288
00289
00290 GRE::RENDERTARGET GetRenderTarget (
00291 ) const { return (m_RenderTarget); }
00292
00293
00294
00295 BITSET* GetElemDrawnSet (
00296 ELEMTYPE ElemType = ELEMTYPE_All
00297 ) const;
00298
00299
00300 GRE_LAYER* GetLayer (
00301 ) const { return (m_layer); }
00302
00303
00304 const GRE::LAYERVIEW* GetLayerView (
00305 ) const { return (m_pLayerView); }
00306
00307
00308 GRE::LAYERVIEW* GetLayerView (
00309 ) { return (m_pLayerView); }
00310
00311 bool GetNoDrawActive (
00312 ) const { return (m_NoDrawActive); }
00313
00314
00315 const DRECT2D& GetObjectClipRect (
00316 ) const { return (m_ObjClipRect); }
00317
00318
00319 const DPOINT2D& GetPixelSizeMM (
00320 ) const { return (m_PixelSizeMM); }
00321
00322
00323 double GetRotationAngle (
00324 ) const { return (m_RotationAngle); }
00325
00326
00327 double GetRotationCos (
00328 ) const { return (m_pGroupView->GetRotationCos()); }
00329
00330
00331 double GetRotationSin (
00332 ) const { return (m_pGroupView->GetRotationSin()); }
00333
00334
00335 GRE_LAYER_SURFACE* GetSurfaceLayer (
00336 ) const { return (m_pLayerView->GetSurfaceLayer()); }
00337
00338
00339 ERRVALUE GetSurfaceZ (
00340 DPOINT3D* points,
00341 INT32 NumPoints
00342 ) const;
00343
00344
00345 ERRVALUE GetSurfaceZ (
00346 POLYLINE& polyline
00347 ) const;
00348
00349
00350 const TRANS2D_MAPGEN& GetTransLayerDevice (
00351 ) const { return (m_pLayerView->GetTransLayerDevice()); }
00352
00353
00354 const TRANS2D_MAPGEN& GetTransLayerSurface (
00355 ) const { return (m_pLayerView->GetTransLayerSurface()); }
00356
00357 GRE_VIEW* GetView (
00358 ) const { return (m_view); }
00359
00360
00361 bool HasSurfaceLayer (
00362 ) const { return (m_pLayerView->GetSurfaceLayer() != 0); }
00363
00364
00365 bool HasSurfaceNulls (
00366 ) const { return (m_pLayerView->HasSurfaceNulls()); }
00367
00368
00369 bool Is3D (
00370 ) const { return (m_pLayerView->Is3D()); }
00371
00372
00373 bool IsHidden (
00374 ) const { return (m_IsHidden); }
00375
00376
00377 bool IsSurfaceUsed (
00378 ) const { return (m_pLayerView->IsSurfaceUsed()); }
00379
00380
00381 void NotifyDrawElementBegin (
00382 const RVC::ELEMENT& element
00383 ) const { m_view->NotifyDrawElementBegin(m_layer,element); }
00384
00385
00386 void NotifyDrawElementBegin (
00387 ELEMTYPE ElemType,
00388 INT32 ElemNum
00389 ) const { m_view->NotifyDrawElementBegin(m_layer,RVC::ELEMENT(ElemNum,ElemType)); }
00390
00391
00392 void NotifyDrawElementEnd (
00393 const RVC::ELEMENT& element
00394 ) const { m_view->NotifyDrawElementEnd(m_layer,element); }
00395
00396
00397 void NotifyDrawElementEnd (
00398 ELEMTYPE ElemType,
00399 INT32 ElemNum
00400 ) const { m_view->NotifyDrawElementEnd(m_layer,RVC::ELEMENT(ElemNum,ElemType)); }
00401
00402
00403 void Set3dElemScaled (
00404 bool IsScaled
00405 ) { m_ScaleToMap3D = IsScaled; }
00406
00407 void Set3dStereoView (
00408 GRE::SCENE3D::STEREOVIEW StereoView
00409 );
00410
00411
00412 void SetDrawFlags (
00413 GRE::DRAWFLAGS drawflags
00414 );
00415
00416
00417 void SetDrawingDevice (
00418 MGD::DEVICE *pDevice
00419 );
00420
00421
00422
00423 int TransPoint3D (
00424 DPOINT3D& ipoint,
00425 DPOINT3D& opoint
00426 ) const;
00427
00428 private:
00429 #ifndef GENERATING_DOXYGEN_OUTPUT
00430
00431 static SMLAUTOCLASS_NOALLOC_T<GRE_LAYERDC> s_SML_AutoClass;
00432
00433 static void SML_Register ();
00434
00435 GRE::GROUPVIEW *m_pGroupView;
00436 GRE::LAYERVIEW *m_pLayerView;
00437 GRE_LAYER *m_layer;
00438 GRE_VIEW *m_view;
00439 MGD::CONTEXT* m_ggc;
00440 GRE::DRAWFLAGS m_drawflags;
00441 REGION2D m_ClipRegion;
00442 DRECT2D m_ObjClipRect;
00443 DPOINT2D m_PixelSizeMM;
00444 double m_DesignScale;
00445 double m_DrawingScale;
00446 double m_RotationAngle;
00447 bool m_OwnGroupView;
00448 bool m_OwnLayerView;
00449 bool m_IsHidden;
00450 bool m_NoDrawActive;
00451 bool m_ScaleToMap3D;
00452 GRE::SCENE3D m_Scene3D;
00453 GRE::RENDERTARGET m_RenderTarget;
00454
00455 void SetupForDrawFlags ();
00456 void SetupForStereoView ();
00457
00458
00459 GRE_LAYERDC (const GRE_LAYERDC&);
00460 GRE_LAYERDC& operator= (const GRE_LAYERDC&);
00461
00462 virtual ERRVALUE OnClip (const POLYLINE& PolyLine);
00463
00464 #endif // GENERATING_DOXYGEN_OUTPUT
00465 };
00466
00467
00468
00469 #endif // INC_GRE_LAYERDC_H