CFx SDK Documentation  2020SP3
TrGL2LocalTransient.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 // GLES2 device local metafile builder
24 
25 #ifndef ODTRGL2LOCALMETAFILEBUILDER
26 #define ODTRGL2LOCALMETAFILEBUILDER
27 
28 #include "TD_PackPush.h"
29 
30 #include "TrRndLocalRenderer.h"
31 #include "TrVisMetafileBuilder.h"
32 
38 
43 {
44  protected:
45  enum Flags
46  {
47  kInvalid = 1,
49  kAutoRegen = 4
50  };
52 
56  bool isValid() const { return !GETBIT(m_flags, kInvalid); }
57 
60 
61  void setAutoRegen(bool bSet) { SETBIT(m_flags, kAutoRegen, bSet); }
62  bool isAutoRegen() const { return GETBIT(m_flags, kAutoRegen); }
63 
64  typedef std::map<OdTrVisViewportId, OdRxObjectPtr> MetaDataMap;
67  public:
69  : m_flags(kInvalid)
70  , m_counter(0)
71  , m_pOwner(NULL)
72  { }
73  virtual ~OdTrGL2LocalTransient() { }
74 
76 
77  void invalidate();
79 
80  bool isAttached(OdTrVisViewportId vpId) const;
81 
83 
84  virtual void draw(OdTrVisMetafileBuilderPtr mfBuilder, const OdTrGL2LocalRenderer* pRenderer) = 0;
85 
87 };
88 
93 {
94 public:
99 
100  virtual void detachAll(OdTrVisViewportId ) {}
101  virtual void detachAll() {}
102 
105  virtual void invalidate(OdTrVisViewportId vpId) {}
106  virtual void invalidate() {}
107 
108  virtual void update(OdTrGL2LocalRenderer *) {}
110 
111  virtual void draw(const OdTrGL2LocalRenderer *, OdTrVisViewportId) {}
112  virtual bool isDrawing() const { return false; }
113 };
114 
119 {
120  protected:
122  {
125 
127  };
129  {
132  bool m_bValid;
135 
137  };
138  typedef std::map<OdTrVisViewportId, ViewportSpec> ViewData;
141  public:
144 
148 
150  void detachAll();
151 
155  void invalidate();
156 
157  void update(OdTrGL2LocalRenderer *pRenderer);
159 
160  void draw(const OdTrGL2LocalRenderer *pRenderer, OdTrVisViewportId vpId);
161  bool isDrawing() const { return m_bDrawing; }
162 };
163 
164 #include "TD_PackPop.h"
165 
166 #endif // ODTRGL2LOCALMETAFILEBUILDER
GETBIT
#define GETBIT(flags, bit)
Definition: OdaDefs.h:498
OdTrGL2LocalTransient::owner
OdTrRndLocalTransientManager * owner() const
Definition: TrGL2LocalTransient.h:75
OdTrGL2LocalTransientManagerImpl::ViewportSpec
Definition: TrGL2LocalTransient.h:129
OdTrGL2LocalTransient::kMViewCompatible
@ kMViewCompatible
Definition: TrGL2LocalTransient.h:48
OdTrGL2LocalTransient::m_pOwner
OdTrRndLocalTransientManager * m_pOwner
Definition: TrGL2LocalTransient.h:66
OdTrGL2LocalTransientManagerImpl::invalidateTransient
void invalidateTransient(OdTrVisViewportId vpId, OdTrGL2LocalTransient *pTransient)
NULL
#define NULL
Definition: GsProperties.h:177
OdTrGL2LocalTransientManagerImpl::detachTransient
void detachTransient(OdTrGL2LocalTransient *pTransient)
OdTrRndLocalTransientManager::invalidateTransient
virtual void invalidateTransient(OdTrGL2LocalTransient *)
Definition: TrGL2LocalTransient.h:103
OdTrGL2LocalTransient::setInvalid
void setInvalid()
Definition: TrGL2LocalTransient.h:54
OdTrGL2LocalTransientManagerImpl::invalidate
void invalidate()
OdTrRndLocalTransientManager::invalidate
virtual void invalidate()
Definition: TrGL2LocalTransient.h:106
OdTrGL2LocalTransientManagerImpl::isDrawing
bool isDrawing() const
Definition: TrGL2LocalTransient.h:161
OdTrGL2LocalTransient::setMultiViewCompatible
void setMultiViewCompatible(bool bSet)
Definition: TrGL2LocalTransient.h:58
OdTrRndLocalTransientManager::~OdTrRndLocalTransientManager
virtual ~OdTrRndLocalTransientManager()
Definition: TrGL2LocalTransient.h:95
SETBIT_1
#define SETBIT_1(flags, bit)
Definition: OdaDefs.h:501
OdTrGL2LocalRenderer
Definition: TrRndLocalRenderer.h:39
OdTrGL2LocalTransient::invalidate
void invalidate()
OdRxObject
Definition: RxObject.h:564
SETBIT
#define SETBIT(flags, bit, value)
Definition: OdaDefs.h:497
OdTrGL2LocalTransient::~OdTrGL2LocalTransient
virtual ~OdTrGL2LocalTransient()
Definition: TrGL2LocalTransient.h:73
OdTrRndLocalTransientManager::getExtents
virtual void getExtents(OdTrVisViewportId, OdGeExtents3d &)
Definition: TrGL2LocalTransient.h:109
OdTrRndLocalTransientManager::attachTransient
virtual void attachTransient(OdTrVisViewportId, OdTrGL2LocalTransient *)
Definition: TrGL2LocalTransient.h:96
OdTrGL2LocalTransientManagerImpl::ViewportSpec::m_bValid
bool m_bValid
Definition: TrGL2LocalTransient.h:132
OdTrGL2LocalTransient::setAutoRegen
void setAutoRegen(bool bSet)
Definition: TrGL2LocalTransient.h:61
TD_PackPop.h
OdTrGL2LocalTransientManagerImpl::invalidate
void invalidate(OdTrVisViewportId vpId)
OdUInt16
unsigned short OdUInt16
Definition: OdPlatformSettings.h:760
OdTrGL2LocalTransientManagerImpl::m_views
ViewData m_views
Definition: TrGL2LocalTransient.h:139
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdTrRndLocalTransientManager::detachTransient
virtual void detachTransient(OdTrVisViewportId, OdTrGL2LocalTransient *)
Definition: TrGL2LocalTransient.h:97
OdTrGL2LocalTransientManagerImpl::getExtents
void getExtents(OdTrVisViewportId vpId, OdGeExtents3d &extents)
OdTrGL2LocalTransient::draw
virtual void draw(OdTrVisMetafileBuilderPtr mfBuilder, const OdTrGL2LocalRenderer *pRenderer)=0
OdTrGL2LocalTransient::m_metaData
MetaDataMap m_metaData
Definition: TrGL2LocalTransient.h:65
OdTrRndLocalTransientManager::isDrawing
virtual bool isDrawing() const
Definition: TrGL2LocalTransient.h:112
OdSmartPtr
Definition: SmartPtr.h:58
OdTrRndLocalTransientManager::invalidateTransient
virtual void invalidateTransient(OdTrVisViewportId, OdTrGL2LocalTransient *)
Definition: TrGL2LocalTransient.h:104
OdTrGL2LocalTransientManagerImpl::ViewData
std::map< OdTrVisViewportId, ViewportSpec > ViewData
Definition: TrGL2LocalTransient.h:138
SETBIT_0
#define SETBIT_0(flags, bit)
Definition: OdaDefs.h:500
OdTrGL2LocalTransientManagerImpl::detachAll
void detachAll(OdTrVisViewportId vpId)
OdTrGL2LocalTransient::Ptr
OdSmartPtr< OdTrGL2LocalTransient > Ptr
Definition: TrGL2LocalTransient.h:86
OdTrGL2LocalTransientManagerImpl::ViewportSpec::m_extents
OdGeExtents3d m_extents
Definition: TrGL2LocalTransient.h:134
OdTrGL2LocalTransientManagerImpl::ViewportSpec::m_pHead
TransientSpec * m_pHead
Definition: TrGL2LocalTransient.h:130
true
true
Definition: DimVarDefs.h:2046
OdTrGL2LocalTransientManagerImpl::invalidateTransient
void invalidateTransient(OdTrGL2LocalTransient *pTransient)
TrRndLocalRenderer.h
OdTrGL2LocalTransient::setValid
void setValid()
Definition: TrGL2LocalTransient.h:55
OdTrGL2LocalTransientManagerImpl::ViewportSpec::m_pTail
TransientSpec * m_pTail
Definition: TrGL2LocalTransient.h:131
OdTrGL2LocalTransientManagerImpl::ViewportSpec::ViewportSpec
ViewportSpec()
Definition: TrGL2LocalTransient.h:136
OdTrGL2LocalTransientManagerImpl::TransientSpec::m_pTransient
OdTrGL2LocalTransient::Ptr m_pTransient
Definition: TrGL2LocalTransient.h:123
OdTrRndLocalTransientManager::detachAll
virtual void detachAll(OdTrVisViewportId)
Definition: TrGL2LocalTransient.h:100
OdTrGL2LocalTransientManagerImpl::~OdTrGL2LocalTransientManagerImpl
~OdTrGL2LocalTransientManagerImpl()
OdTrRndLocalTransientManager::invalidate
virtual void invalidate(OdTrVisViewportId vpId)
Definition: TrGL2LocalTransient.h:105
OdTrRndLocalTransientManager::detachAll
virtual void detachAll()
Definition: TrGL2LocalTransient.h:101
OdTrRndLocalTransientManager::draw
virtual void draw(const OdTrGL2LocalRenderer *, OdTrVisViewportId)
Definition: TrGL2LocalTransient.h:111
OdTrGL2LocalTransientManagerImpl::TransientSpec::m_pNextSpec
TransientSpec * m_pNextSpec
Definition: TrGL2LocalTransient.h:124
OdTrGL2LocalTransient::isValid
bool isValid() const
Definition: TrGL2LocalTransient.h:56
TD_PackPush.h
OdTrGL2LocalTransient::OdTrGL2LocalTransient
OdTrGL2LocalTransient()
Definition: TrGL2LocalTransient.h:68
OdTrGL2LocalTransient::kAutoRegen
@ kAutoRegen
Definition: TrGL2LocalTransient.h:49
OdTrGL2LocalTransientManagerImpl::m_bDrawing
bool m_bDrawing
Definition: TrGL2LocalTransient.h:140
OdTrGL2LocalTransient::kInvalid
@ kInvalid
Definition: TrGL2LocalTransient.h:47
OdTrGL2LocalTransientManagerImpl::update
void update(OdTrGL2LocalRenderer *pRenderer)
OdTrGL2LocalTransient::m_flags
OdUInt16 m_flags
Definition: TrGL2LocalTransient.h:51
OdTrGL2LocalTransient::MetaDataMap
std::map< OdTrVisViewportId, OdRxObjectPtr > MetaDataMap
Definition: TrGL2LocalTransient.h:64
OdTrGL2LocalTransientManagerImpl
Definition: TrGL2LocalTransient.h:119
TrVisMetafileBuilder.h
OdGeExtents3d
Definition: GeExtents3d.h:45
OdTrGL2LocalTransientManagerImpl::OdTrGL2LocalTransientManagerImpl
OdTrGL2LocalTransientManagerImpl()
OdTrGL2LocalTransient
Definition: TrGL2LocalTransient.h:43
OdTrGL2LocalTransientManagerImpl::TransientSpec::TransientSpec
TransientSpec()
Definition: TrGL2LocalTransient.h:126
OdTrGL2LocalTransientManagerImpl::TransientSpec
Definition: TrGL2LocalTransient.h:122
OdTrGL2LocalTransientManagerImpl::detachTransient
void detachTransient(OdTrVisViewportId vpId, OdTrGL2LocalTransient *pTransient)
OdTrGL2LocalTransient::isAutoRegen
bool isAutoRegen() const
Definition: TrGL2LocalTransient.h:62
OdTrGL2LocalTransientManagerImpl::ViewportSpec::m_nAutoRegen
OdUInt32 m_nAutoRegen
Definition: TrGL2LocalTransient.h:133
OdTrGL2LocalTransientManagerImpl::detachAll
void detachAll()
OdTrGL2LocalTransient::isMultiViewCompatible
bool isMultiViewCompatible() const
Definition: TrGL2LocalTransient.h:59
OdTrGL2LocalTransient::isAttached
bool isAttached(OdTrVisViewportId vpId) const
OdTrGL2LocalTransientManagerImpl::draw
void draw(const OdTrGL2LocalRenderer *pRenderer, OdTrVisViewportId vpId)
OdTrGL2LocalTransient::invalidate
void invalidate(OdTrVisViewportId vpId)
OdTrRndLocalTransientManager
Definition: TrGL2LocalTransient.h:93
OdTrGL2LocalTransient::m_counter
OdUInt16 m_counter
Definition: TrGL2LocalTransient.h:51
OdTrGL2LocalTransientManagerImpl::attachTransient
void attachTransient(OdTrVisViewportId vpId, OdTrGL2LocalTransient *pTransient)
OdTrRndLocalTransientManager::detachTransient
virtual void detachTransient(OdTrGL2LocalTransient *)
Definition: TrGL2LocalTransient.h:98
OdTrRndLocalTransientManager::update
virtual void update(OdTrGL2LocalRenderer *)
Definition: TrGL2LocalTransient.h:108
OdTrGL2LocalTransient::viewportData
OdRxObject * viewportData(OdTrVisViewportId id)
OdUInt64
Definition: Int64.h:137
OdTrGL2LocalTransient::Flags
Flags
Definition: TrGL2LocalTransient.h:46