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 #ifndef INC_GRE_LAYERVIEW_H
00049 #define INC_GRE_LAYERVIEW_H
00050
00051 #ifndef INC_GRE_BASE_H
00052 #include <gre/base.h>
00053 #endif
00054
00055 #ifndef INC_GRE_LABELPLACEMENT_H
00056 #include <gre/labelplacement.h>
00057 #endif
00058
00059 #ifndef INC_MI32_RENDERBUFFER_H
00060 #include <mi32/renderbuffer.h>
00061 #endif
00062
00063 #ifndef INC_MI32_TRANS2DC_H
00064 #include <mi32/trans2dc.h>
00065 #endif
00066
00067
00068 namespace GRE {
00069
00070
00071
00072
00073 class LAYERVIEW {
00074 public:
00075
00076
00077 enum RENDERTYPE {
00078 RENDERTYPE_Layer = 0,
00079 RENDERTYPE_Labels = 1,
00080 RENDERTYPE_Highlight = 2
00081 };
00082
00083 virtual ~LAYERVIEW ();
00084
00085
00086 void CheckRendered (
00087 );
00088
00089
00090
00091 void ClearAllDrawnSets (
00092 bool UseHighlighted
00093 );
00094
00095
00096 void ClearLabelPlacement (
00097 );
00098
00099
00100 ERRVALUE ComputeTrans (
00101 );
00102
00103
00104 ERRVALUE DrawElementToBuffer (
00105 ELEMTYPE ElemType,
00106 INT32 ElemNum,
00107 GRE::LAYERVIEW::RENDERTYPE RenderType,
00108 GRE::DRAWFLAGS drawflags
00109 );
00110
00111
00112 ERRVALUE DrawElementToDevice (
00113 ELEMTYPE ElemType,
00114 INT32 ElemNum,
00115 MGD::DEVICE *pDevice,
00116 GRE::DRAWFLAGS drawflags
00117 );
00118
00119
00120 ERRVALUE DrawElementsToBuffer (
00121 ELEMTYPE ElemType,
00122 const UINT8 *ElemSet,
00123 GRE::LAYERVIEW::RENDERTYPE RenderType,
00124 GRE::DRAWFLAGS drawflags
00125 );
00126
00127
00128 ERRVALUE DrawElementsToDevice (
00129 ELEMTYPE ElemType,
00130 const UINT8 *ElemSet,
00131 MGD::DEVICE *pDevice,
00132 GRE::DRAWFLAGS drawflags
00133 );
00134
00135
00136 double Get3dDepthScale (
00137 ) const { return (m_3dDepthScale); }
00138
00139
00140 double Get3dSurfaceIncrement (
00141 ) const { return (m_3dSurfaceIncrement); }
00142
00143
00144 const GRE::VIEWPOINT3D* Get3dViewPoint (
00145 ) const { return (m_pViewPoint3D); }
00146
00147
00148 double Get3dZScale (
00149 ) const { return (m_3dZScale); }
00150
00151
00152 double GetDesignScale (
00153 ) const { return (m_DesignScale); }
00154
00155
00156
00157
00158
00159 const LRECT2D& GetDeviceRectUsed (
00160 ) const { return (m_CurDevRectUsed); }
00161
00162
00163
00164
00165
00166 const BITSET* GetElemDrawnSet (
00167 ELEMTYPE ElemType,
00168 bool UseHighlighted
00169 ) const { return (const_cast<LAYERVIEW*>(this)->v_GetElemDrawnSet(ElemType,UseHighlighted)); }
00170
00171
00172
00173
00174
00175 BITSET* GetElemDrawnSet (
00176 ELEMTYPE ElemType,
00177 bool UseHighlighted
00178 ) { return (v_GetElemDrawnSet(ElemType,UseHighlighted)); }
00179
00180
00181
00182 LABELPLACEMENT* GetLabelPlacement (
00183 bool ReturnNullIfEmpty = true
00184 );
00185
00186
00187 GRE::LAYER* GetLayer (
00188 ) const { return (m_layer); }
00189
00190
00191 const RENDERBUFFER& GetRenderBuffer (
00192 RENDERTYPE RenderType
00193 ) const { return (m_RenderBuffer[RenderType]); }
00194
00195
00196 RENDERBUFFER& GetRenderBuffer (
00197 RENDERTYPE RenderType
00198 ) { return (m_RenderBuffer[RenderType]); }
00199
00200
00201 GRE::LAYER_SURFACE* GetSurfaceLayer (
00202 ) const { return (m_pSurfaceLayer); }
00203
00204
00205 const TRANS2D_MAPGEN& GetTransLayerDevice (
00206 ) const { return (m_TransLayerDevice); }
00207
00208
00209 const TRANS2D_MAPGEN& GetTransLayerSurface (
00210 ) const { return (m_TransLayerSurface); }
00211
00212
00213 const TRANS2D_MAPGEN& GetTransLayerView (
00214 ) const { return (m_TransLayerView); }
00215
00216
00217 GRE::VIEW* GetView (
00218 ) const { return (m_view); }
00219
00220
00221 bool HasSurfaceNulls (
00222 ) const { return (m_HasSurfaceNulls); }
00223
00224
00225 bool Is3D (
00226 ) const { return (m_Is3D); }
00227
00228
00229 bool Is3dStereo (
00230 ) const;
00231
00232
00233 bool IsSurfaceUsed (
00234 ) const { return (m_IsSurfaceUsed); }
00235
00236
00237 bool IsLayerOverlappedDevice (
00238 ) const { return (m_LayerOverlapsDevice); }
00239
00240
00241
00242 bool OverlayBufferIfRendered (
00243 RENDERTYPE RenderType,
00244 MGD::DEVICE *pDevTarget,
00245 const LRECT2D *pClipRect = 0
00246 );
00247
00248
00249 void ResetAllDrawnSets (
00250 );
00251
00252
00253 void ResetRendered (
00254 GRE::RENDERTARGET target = GRE::RENDERTARGET_LayerAll
00255 );
00256
00257 protected:
00258
00259
00260 LAYERVIEW (
00261 GRE::LAYER *layer,
00262 GRE::VIEW *view
00263 );
00264
00265 private:
00266 #ifndef GENERATING_DOXYGEN_OUTPUT
00267 GRE::LAYER *m_layer;
00268 GRE::VIEW *m_view;
00269 RENDERBUFFER m_RenderBuffer[3];
00270 TRANS2D_MAPGEN m_TransLayerView;
00271 TRANS2D_MAPGEN m_TransLayerDevice;
00272 TRANS2D_MAPGEN m_TransLayerSurface;
00273 GRE::VIEWPOINT3D *m_pViewPoint3D;
00274 GRE::LAYER_SURFACE *m_pSurfaceLayer;
00275 DRECT2D m_NewTgtRectFull;
00276 DRECT2D m_CurTgtRectFull;
00277 DRECT2D m_PrevObjRectFull;
00278 LRECT2D m_NewDevRectUsed;
00279 LRECT2D m_CurDevRectUsed;
00280 double m_DesignScale;
00281 double m_3dSurfaceIncrement;
00282 double m_3dDepthScale;
00283 double m_3dZScale;
00284 bool m_Is3D;
00285 bool m_IsSurfaceUsed;
00286 bool m_HasSurfaceNulls;
00287 bool m_LayerOverlapsDevice;
00288 bool m_TransChanged;
00289
00290 void DestroyRenderDevices (
00291 );
00292
00293 void SetTransLayerDevice (
00294 const TRANS2D_MAPGEN& TransLayerDevice
00295 ) { m_TransLayerDevice = TransLayerDevice; }
00296
00297 LAYERVIEW (const LAYERVIEW&);
00298 LAYERVIEW& operator= (const LAYERVIEW&);
00299
00300 friend class GRE::LAYER;
00301 friend class GRE::LAYERDC;
00302 #endif // GENERATING_DOXYGEN_OUTPUT
00303
00304
00305
00306
00307
00308 virtual BITSET* v_GetElemDrawnSet (
00309 ELEMTYPE ElemType,
00310 bool UseHighlighted
00311 );
00312
00313
00314
00315 virtual LABELPLACEMENT* v_GetLabelPlacement (
00316 );
00317
00318 };
00319
00320
00321
00322 class LAYERVIEW_GEOMETRIC : public LAYERVIEW {
00323 public:
00324
00325
00326 LAYERVIEW_GEOMETRIC (
00327 GRE::LAYER *layer,
00328 GRE::VIEW *view
00329 );
00330
00331 virtual ~LAYERVIEW_GEOMETRIC ();
00332
00333 private:
00334 #ifndef GENERATING_DOXYGEN_OUTPUT
00335
00336 unsigned m_NumComponents;
00337 BITSET *m_ElemDrawnSetsNormal;
00338 BITSET *m_ElemDrawnSetsHighlighted;
00339
00340 virtual BITSET* v_GetElemDrawnSet (
00341 ELEMTYPE ElemType,
00342 bool UseHighlighted
00343 );
00344
00345 LAYERVIEW_GEOMETRIC (const LAYERVIEW_GEOMETRIC&);
00346 LAYERVIEW_GEOMETRIC& operator= (const LAYERVIEW_GEOMETRIC&);
00347
00348 #endif // GENERATING_DOXYGEN_OUTPUT
00349 };
00350
00351
00352
00353
00354 class LAYERVIEW_LABELED : public LAYERVIEW_GEOMETRIC {
00355 public:
00356
00357
00358 LAYERVIEW_LABELED (
00359 GRE::LAYER *layer,
00360 GRE::VIEW *view
00361 );
00362
00363 virtual ~LAYERVIEW_LABELED ();
00364
00365 private:
00366 #ifndef GENERATING_DOXYGEN_OUTPUT
00367 LABELPLACEMENT m_LabelPlacement;
00368
00369 virtual LABELPLACEMENT* v_GetLabelPlacement (
00370 );
00371
00372 LAYERVIEW_LABELED (const LAYERVIEW_LABELED&);
00373 LAYERVIEW_LABELED& operator= (const LAYERVIEW_LABELED&);
00374
00375 #endif // GENERATING_DOXYGEN_OUTPUT
00376 };
00377
00378
00379 }
00380
00381 #endif // INC_GRE_LAYERVIEW_H