00001
00093 #ifndef INC_GRE_LAYERVIEW_H
00094 #define INC_GRE_LAYERVIEW_H
00095
00096 #ifndef INC_GRE_BASE_H
00097 #include <gre/base.h>
00098 #endif
00099
00100 #ifndef INC_GRE_LABELPLACEMENT_H
00101 #include <gre/labelplacement.h>
00102 #endif
00103
00104 #ifndef INC_MI32_RENDERBUFFER_H
00105 #include <mi32/renderbuffer.h>
00106 #endif
00107
00108 #ifndef INC_MI32_TRANS2DC_H
00109 #include <mi32/trans2dc.h>
00110 #endif
00111
00112 #ifndef INC_MI32_CRITSEC_H
00113 #include <mi32/critsec.h>
00114 #endif
00115
00116
00117 class UNSIGNEDSET;
00118 namespace MITHREAD {
00119 class QUEUE;
00120 }
00121
00122
00123 namespace GRE {
00124
00125
00126
00128 class LAYERVIEW {
00129 public:
00130
00132 LAYERVIEW (
00133 GRE::LAYER *layer,
00134 GRE::VIEW *view
00135 );
00136
00139 LAYERVIEW (
00140 GRE::LAYER *layer,
00141 GRE::VIEW *view,
00142 const TRANS2D_MAPGEN& TransObjectToDevice,
00143 INT32 DevSizeX,
00144 INT32 DevSizeY
00145 );
00146
00148 virtual ~LAYERVIEW ();
00149
00151 void AttachSection (
00152 GRE::LAYERSECTION *& pLayerSection,
00153 bool NotifyView = true
00154 );
00155
00157 void CheckRendered ();
00158
00160 void ClearLabelPlacement ();
00161
00163 ERRVALUE ComputeTrans ();
00164
00167 bool DetachSection (
00168 const LAYERSECTION *pLayerSection
00169 );
00170
00172 ERRVALUE DrawElementToBuffer (
00173 ELEMTYPE ElemType,
00174 ELEMNUM ElemNum,
00175 GRE::RENDERTARGET content,
00176 GRE::DRAWFLAGS drawflags
00177 );
00178
00180 ERRVALUE DrawElementToDevice (
00181 ELEMTYPE ElemType,
00182 ELEMNUM ElemNum,
00183 MGD::DEVICE *pDevice,
00184 GRE::DRAWFLAGS drawflags
00185 );
00186
00188 ERRVALUE DrawElementsToBuffer (
00189 ELEMTYPE ElemType,
00190 const UNSIGNEDSET *pElemSet,
00191 GRE::RENDERTARGET content,
00192 GRE::DRAWFLAGS drawflags
00193 );
00194
00196 ERRVALUE DrawElementsToDevice (
00197 ELEMTYPE ElemType,
00198 const UNSIGNEDSET *pElemSet,
00199 MGD::DEVICE *pDevice,
00200 GRE::DRAWFLAGS drawflags
00201 );
00202
00204 ERRVALUE DrawHighlightedToBuffer (
00205 GRE::DRAWFLAGS drawflags
00206 );
00207
00209 double Get3dDepthScale (
00210 ) const { return (m_3dDepthScale); }
00211
00213 double Get3dSurfaceIncrement (
00214 ) const { return (m_3dSurfaceIncrement); }
00215
00217 const GRE::VIEWPOINT3D* Get3dViewPoint (
00218 ) const { return (m_pViewPoint3D); }
00219
00221 double Get3dZScale (
00222 ) const { return (m_3dZScale); }
00223
00225 double GetDesignScale (
00226 ) const { return (m_DesignScale); }
00227
00232 const LRECT2D& GetDeviceRectUsed (
00233 ) const { return (m_CurDevRectUsed); }
00234
00239 const UNSIGNEDSET* GetElemDrawnSet (
00240 ELEMTYPE ElemType,
00241 bool UseHighlighted
00242 ) const;
00243
00248 UNSIGNEDSET* GetElemDrawnSet (
00249 ELEMTYPE ElemType,
00250 bool UseHighlighted
00251 );
00252
00255 LABELPLACEMENT* GetLabelPlacement (
00256 bool ReturnNullIfEmpty = true
00257 );
00258
00260 GRE::LAYER* GetLayer (
00261 ) const { return (m_layer); }
00262
00265 const LAYERSECTION* GetSection (
00266 ) const { return (m_pSectionUntiled); }
00267
00270 LAYERSECTION* GetSection (
00271 ) { return (m_pSectionUntiled); }
00272
00274 GRE::LAYER_SURFACE* GetSurfaceLayer (
00275 ) const { return (m_pSurfaceLayer); }
00276
00278 const TRANS2D_MAPGEN& GetTransLayerDevice (
00279 ) const { return (m_TransLayerDevice); }
00280
00282 const TRANS2D_MAPGEN& GetTransLayerSurface (
00283 ) const { return (m_TransLayerSurface); }
00284
00286 const TRANS2D_MAPGEN& GetTransLayerView (
00287 ) const { return (m_TransLayerView); }
00288
00290 GRE::VIEW* GetView () const
00291 { return (m_view); }
00292
00294 bool HasRendered (
00295 RENDERTARGET content = RENDERTARGET_LayerAll
00296 ) const;
00297
00299 bool Is3D () const
00300 { return (m_Is3D); }
00301
00303 bool Is3dStereo () const;
00304
00306 bool IsAttachedToView () const;
00307
00309 bool IsSurfaceUsed (
00310 ) const { return (m_IsSurfaceUsed); }
00311
00313 bool IsLayerOverlappedDevice (
00314 ) const { return (m_LayerOverlapsDevice); }
00315
00318 bool OverlayBufferIfRendered (
00319 GRE::RENDERTARGET content,
00320 MGD::DEVICE *pDevTarget,
00321 const LRECT2D *pClipRect = 0
00322 ) const;
00323
00325 ERRVALUE QueueJobRenderFull (
00326 MITHREAD::QUEUE& Queue
00327 );
00328
00330 void ResetAllDrawnSets ();
00331
00333 void ResetRendered (
00334 GRE::RENDERTARGET target = GRE::RENDERTARGET_LayerAll
00335 );
00336
00337 private:
00338 #ifndef GENERATING_DOXYGEN_OUTPUT
00339 GRE::LAYER *m_layer;
00340 GRE::VIEW *m_view;
00341 LAYERSECTION *m_pSectionUntiled;
00342 TRANS2D_MAPGEN m_TransLayerView;
00343 TRANS2D_MAPGEN m_TransLayerDevice;
00344 TRANS2D_MAPGEN m_TransLayerSurface;
00345 GRE::VIEWPOINT3D *m_pViewPoint3D;
00346 GRE::LAYER_SURFACE *m_pSurfaceLayer;
00347 DRECT2D m_NewTgtRectFull;
00348 DRECT2D m_CurTgtRectFull;
00349 DRECT2D m_PrevObjRectFull;
00350 LRECT2D m_NewDevRectUsed;
00351 LRECT2D m_CurDevRectUsed;
00352 double m_DesignScale;
00353 double m_3dSurfaceIncrement;
00354 double m_3dDepthScale;
00355 double m_3dZScale;
00356 bool m_Is3D;
00357 bool m_IsSurfaceUsed;
00358 bool m_LayerOverlapsDevice;
00359 bool m_TransChanged;
00360 mutable MITHREAD::CRITICALSECTION m_CritSec;
00361
00362 LAYERVIEW (const LAYERVIEW&);
00363 LAYERVIEW& operator= (const LAYERVIEW&);
00364
00365 #endif // GENERATING_DOXYGEN_OUTPUT
00366
00367 };
00368
00369
00370 }
00371
00372 #endif // INC_GRE_LAYERVIEW_H