CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
TrRndLocalTransient.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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 Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 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// Standalone renderer transient metafiles manager
24
25#ifndef ODTRRNDLOCALTRANSIENT
26#define ODTRRNDLOCALTRANSIENT
27
28#include "TD_PackPush.h"
29
30#include "TrRndLocalRenderer.h"
31#include "../TrVisMetafileBuilder.h"
32
33// Forward declarations
35
40{
41 protected:
42 enum Flags
43 {
46 kAutoRegen = 4
47 };
49
53 bool isValid() const { return !GETBIT(m_flags, kInvalid); }
54
57
58 void setAutoRegen(bool bSet) { SETBIT(m_flags, kAutoRegen, bSet); }
59 bool isAutoRegen() const { return GETBIT(m_flags, kAutoRegen); }
60
61 typedef std::map<OdTrVisViewportId, OdRxObjectPtr> MetaDataMap;
64 public:
67 , m_counter(0)
68 , m_pOwner(NULL)
69 { }
71
73
74 void invalidate();
76
77 bool isAttached(OdTrVisViewportId vpId) const;
78
80
81 virtual void draw(OdTrVisMetafileBuilderPtr mfBuilder, const OdTrRndLocalRenderer* pRenderer) = 0;
82
84};
85
90{
91public:
96
97 virtual void detachAll(OdTrVisViewportId ) {}
98 virtual void detachAll() {}
99
102 virtual void invalidate(OdTrVisViewportId vpId) {}
103 virtual void invalidate() {}
104
105 virtual bool update(OdTrRndLocalRenderer *) { return false; }
107
109 virtual bool isDrawing() const { return false; }
110};
111
112// OdTrRndLocalTransient inlines section
113
114inline
116{
117 if (m_pOwner)
119}
120
121inline
123{
124 if (m_pOwner)
125 m_pOwner->invalidateTransient(vpId, this);
126}
127
128inline
130{
131 return m_metaData.find(vpId) != m_metaData.end();
132}
133
134inline
136{
137 MetaDataMap::iterator it = m_metaData.find(id);
138 if (it != m_metaData.end())
139 return it->second.get();
140 return NULL;
141}
142
143#include "TD_PackPop.h"
144
145#endif // ODTRRNDLOCALTRANSIENT
unsigned short OdUInt16
#define SETBIT(flags, bit, value)
Definition: OdaDefs.h:516
#define SETBIT_0(flags, bit)
Definition: OdaDefs.h:519
#define GETBIT(flags, bit)
Definition: OdaDefs.h:517
#define SETBIT_1(flags, bit)
Definition: OdaDefs.h:520
OdRxObject * viewportData(OdTrVisViewportId id)
OdTrRndLocalTransientManager * m_pOwner
bool isMultiViewCompatible() const
virtual void draw(OdTrVisMetafileBuilderPtr mfBuilder, const OdTrRndLocalRenderer *pRenderer)=0
std::map< OdTrVisViewportId, OdRxObjectPtr > MetaDataMap
void setAutoRegen(bool bSet)
bool isAttached(OdTrVisViewportId vpId) const
OdTrRndLocalTransientManager * owner() const
OdSmartPtr< OdTrRndLocalTransient > Ptr
friend class OdTrRndLocalTransientManagerImpl
void setMultiViewCompatible(bool bSet)
virtual void invalidateTransient(OdTrVisViewportId, OdTrRndLocalTransient *)
virtual bool update(OdTrRndLocalRenderer *)
virtual void detachTransient(OdTrVisViewportId, OdTrRndLocalTransient *)
virtual void getExtents(OdTrVisViewportId, OdGeExtents3d &)
virtual void draw(const OdTrRndLocalRenderer *, OdTrVisViewportId)
virtual void invalidate(OdTrVisViewportId vpId)
virtual void detachTransient(OdTrRndLocalTransient *)
virtual void invalidateTransient(OdTrRndLocalTransient *)
virtual void attachTransient(OdTrVisViewportId, OdTrRndLocalTransient *)
virtual void detachAll(OdTrVisViewportId)