00001
00048 #ifndef INC_GRE_LAYERSECTION_H
00049 #define INC_GRE_LAYERSECTION_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_TRANS2DMAPGEN_H
00064 #include <mi32/trans2dmapgen.h>
00065 #endif
00066
00067
00068 #ifndef GENERATING_DOXYGEN_OUTPUT
00069 class UNSIGNEDSET;
00070 class ZVIEW;
00071 namespace MITHREAD {
00072 class QUEUE;
00073 }
00074 #endif
00075
00076
00077 namespace GRE {
00078
00079
00081 class LAYERSECTION {
00082 public:
00083
00085 explicit LAYERSECTION (
00086 GRE::LAYER *layer,
00087 GRE::VIEW *view
00088 );
00089
00091 void ClearLabelPlacement ();
00092
00094 void CloseZView ();
00095
00097 void ComputeClipRegion (
00098 REGION2D& ClipRegion
00099 );
00100
00105 const UNSIGNEDSET* GetElemDrawnSet (
00106 ELEMTYPE ElemType,
00107 bool UseHighlighted
00108 ) const { return (const_cast<LAYERSECTION*>(this)->v_GetElemDrawnSet(ElemType,UseHighlighted)); }
00109
00114 UNSIGNEDSET* GetElemDrawnSet (
00115 ELEMTYPE ElemType,
00116 bool UseHighlighted
00117 ) { return (v_GetElemDrawnSet(ElemType,UseHighlighted)); }
00118
00121 LABELPLACEMENT* GetLabelPlacement (
00122 bool ReturnNullIfEmpty = true
00123 );
00124
00126 GRE::LAYER* GetLayer (
00127 ) const { return (m_layer); }
00128
00130 const RENDERBUFFER& GetRenderBuffer (
00131 GRE::RENDERTARGET content
00132 ) const;
00133
00135 RENDERBUFFER& GetRenderBuffer (
00136 GRE::RENDERTARGET content
00137 );
00138
00140 const TRANS2D_MAPGEN& GetTransLayerBuffer (
00141 ) const { return (m_TransLayerBuffer); }
00142
00144 GRE::VIEW* GetView (
00145 ) const { return (m_view); }
00146
00149 const ZVIEW* GetZView (bool DoSetup = true)
00150 { return (v_GetZView(DoSetup)); }
00151
00153 bool HasRendered (
00154 GRE::RENDERTARGET content
00155 ) const;
00156
00159 bool OverlayBufferIfRendered (
00160 GRE::RENDERTARGET content,
00161 MGD::DEVICE *pDevTarget,
00162 const LRECT2D *pClipRect = 0
00163 ) const;
00164
00166 ERRVALUE QueueJobRender (
00167 MITHREAD::QUEUE& Queue
00168 );
00169
00171 void Release (
00172 );
00173
00175 void ResetAllDrawnSets (
00176 );
00177
00179 void ResetRendered (
00180 GRE::RENDERTARGET content = GRE::RENDERTARGET_LayerAll
00181 );
00182
00184 void SetTransLayerBuffer (
00185 const TRANS2D_MAPGEN& TransLayerBuffer
00186 ) { m_TransLayerBuffer = TransLayerBuffer; }
00187
00189 ERRVALUE SetupRenderBuffer (
00190 RENDERBUFFER& RenderBuffer,
00191 bool EraseExisting = false
00192 ) const;
00193
00194 protected:
00195
00196 virtual ~LAYERSECTION ();
00197
00198 private:
00199 #ifndef GENERATING_DOXYGEN_OUTPUT
00200 class JOB_RENDER;
00201
00202 LAYER *m_layer;
00203 VIEW *m_view;
00204 JOB_RENDER *m_pJob;
00205 RENDERBUFFER m_RenderBufferNormal;
00206 RENDERBUFFER m_RenderBufferHighlight;
00207 RENDERBUFFER m_RenderBufferLabels;
00208 TRANS2D_MAPGEN m_TransLayerBuffer;
00209
00210
00211 LAYERSECTION (const LAYERSECTION&);
00212 LAYERSECTION& operator= (const LAYERSECTION&);
00213
00214 #endif // GENERATING_DOXYGEN_OUTPUT
00215
00216
00217
00220 virtual UNSIGNEDSET* v_GetElemDrawnSet (
00221 ELEMTYPE ElemType,
00222 bool UseHighlighted
00223 );
00224
00227 virtual LABELPLACEMENT* v_GetLabelPlacement ();
00228
00231 virtual ZVIEW* v_GetZView (bool DoSetup);
00232
00233 };
00234
00235
00236
00238 class LAYERSECTION_GEOMETRIC : public LAYERSECTION {
00239 public:
00240
00242 LAYERSECTION_GEOMETRIC (
00243 GRE::LAYER *layer,
00244 GRE::VIEW *view
00245 );
00246
00247 protected:
00248
00249 virtual ~LAYERSECTION_GEOMETRIC ();
00250
00251 private:
00252 #ifndef GENERATING_DOXYGEN_OUTPUT
00253
00254 unsigned m_NumComponents;
00255 UNSIGNEDSET *m_ElemDrawnSetsNormal;
00256 UNSIGNEDSET *m_ElemDrawnSetsHighlighted;
00257
00258 virtual UNSIGNEDSET* v_GetElemDrawnSet (ELEMTYPE ElemType, bool UseHighlighted);
00259
00260
00261 LAYERSECTION_GEOMETRIC (const LAYERSECTION_GEOMETRIC&);
00262 LAYERSECTION_GEOMETRIC& operator= (const LAYERSECTION_GEOMETRIC&);
00263
00264 #endif // GENERATING_DOXYGEN_OUTPUT
00265 };
00266
00267
00268
00270 class LAYERSECTION_LABELED : public LAYERSECTION_GEOMETRIC {
00271 public:
00272
00274 LAYERSECTION_LABELED (
00275 GRE::LAYER *layer,
00276 GRE::VIEW *view
00277 );
00278
00279 protected:
00280
00281 virtual ~LAYERSECTION_LABELED ();
00282
00283 private:
00284 #ifndef GENERATING_DOXYGEN_OUTPUT
00285 LABELPLACEMENT m_LabelPlacement;
00286
00287 virtual LABELPLACEMENT* v_GetLabelPlacement ();
00288
00289
00290 LAYERSECTION_LABELED (const LAYERSECTION_LABELED&);
00291 LAYERSECTION_LABELED& operator= (const LAYERSECTION_LABELED&);
00292
00293 #endif // GENERATING_DOXYGEN_OUTPUT
00294 };
00295
00296
00297 }
00298
00299 #endif // INC_GRE_LAYERSECTION_H