CFx SDK Documentation  2022 SP0
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
true
Definition: DimVarDefs.h:2046
#define NULL
Definition: GsProperties.h:177
unsigned int OdUInt32
unsigned short OdUInt16
#define SETBIT(flags, bit, value)
Definition: OdaDefs.h:497
#define SETBIT_0(flags, bit)
Definition: OdaDefs.h:500
#define GETBIT(flags, bit)
Definition: OdaDefs.h:498
#define SETBIT_1(flags, bit)
Definition: OdaDefs.h:501
bool isAttached(OdTrVisViewportId vpId) const
bool isMultiViewCompatible() const
OdSmartPtr< OdTrGL2LocalTransient > Ptr
OdRxObject * viewportData(OdTrVisViewportId id)
OdTrRndLocalTransientManager * m_pOwner
virtual void draw(OdTrVisMetafileBuilderPtr mfBuilder, const OdTrGL2LocalRenderer *pRenderer)=0
OdTrRndLocalTransientManager * owner() const
std::map< OdTrVisViewportId, OdRxObjectPtr > MetaDataMap
void setAutoRegen(bool bSet)
void setMultiViewCompatible(bool bSet)
void invalidate(OdTrVisViewportId vpId)
void invalidateTransient(OdTrGL2LocalTransient *pTransient)
void update(OdTrGL2LocalRenderer *pRenderer)
std::map< OdTrVisViewportId, ViewportSpec > ViewData
void detachTransient(OdTrGL2LocalTransient *pTransient)
void getExtents(OdTrVisViewportId vpId, OdGeExtents3d &extents)
void invalidate(OdTrVisViewportId vpId)
void detachAll(OdTrVisViewportId vpId)
void invalidateTransient(OdTrVisViewportId vpId, OdTrGL2LocalTransient *pTransient)
void draw(const OdTrGL2LocalRenderer *pRenderer, OdTrVisViewportId vpId)
void attachTransient(OdTrVisViewportId vpId, OdTrGL2LocalTransient *pTransient)
void detachTransient(OdTrVisViewportId vpId, OdTrGL2LocalTransient *pTransient)
virtual void getExtents(OdTrVisViewportId, OdGeExtents3d &)
virtual void invalidate(OdTrVisViewportId vpId)
virtual void detachTransient(OdTrVisViewportId, OdTrGL2LocalTransient *)
virtual void update(OdTrGL2LocalRenderer *)
virtual void attachTransient(OdTrVisViewportId, OdTrGL2LocalTransient *)
virtual void detachTransient(OdTrGL2LocalTransient *)
virtual void draw(const OdTrGL2LocalRenderer *, OdTrVisViewportId)
virtual void invalidateTransient(OdTrVisViewportId, OdTrGL2LocalTransient *)
virtual void invalidateTransient(OdTrGL2LocalTransient *)
virtual void detachAll(OdTrVisViewportId)