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