CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
TrVisRenditionPu.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// Direct rendering accessor for external data
24
25#ifndef ODTRVISRENDITIONPU
26#define ODTRVISRENDITIONPU
27
28#include "TD_PackPush.h"
29
30#include "RxObjectImpl.h"
31#include "StaticRxObject.h"
32#include "TrVisDefs.h"
33#include "TrVisPropertyDef.h"
34
35// Forward declarations
36class OdPerfTimerBase;
37
42{
43 public:
45};
46
51{
52 public:
53 bool incomeDataStream(const OdTrVisDisplayId *pList, OdUInt32 nEntries);
54
55 virtual bool incomeMetafile(OdTrVisDisplayId mfId) = 0;
56
57 virtual bool incomeHighlight(bool /*bHighlight*/) { return true; }
58 virtual bool incomeMatrix(const OdGeMatrix3d* /*pXfm*/) { return true; }
59 virtual bool incomeFade(long /*nEntry*/, bool /*bFade*/) { return true; }
66 virtual bool incomeMarkers(OdTrVisStateBranchType /*brType*/, OdTrVisStateBranchPtr /*pBranch*/) { return true; }
67 virtual bool incomeDrawOrder(const double* /*pDrawOrder*/) { return true; }
68 virtual bool incomeDepthIval(const OdTrVisIvald* /*pDepthXform*/) { return true; }
69 virtual bool incomeExploded(bool /*bExploded*/) { return true; }
70 virtual bool incomeSelectionStyle(OdUInt32 /*nStyle*/) { return true; }
71
78 virtual bool incomeSelectionID(OdTrVisId /*id*/) { return true; }
79};
80
85{
86 protected:
88 virtual bool defRv() const { return false; }
89 public:
91
93 bool hasRedirection() const { return m_pRedirectTo != NULL; }
94 void setRedirection(OdTrVisRenderDataInvoke *pRedirection) { m_pRedirectTo = pRedirection; }
96
98 {
99 if (hasRedirection())
100 return getRedirection()->incomeMetafile(mfId);
101 return defRv();
102 }
103
104 virtual bool incomeHighlight(bool bHighlight)
105 {
106 if (hasRedirection())
107 return getRedirection()->incomeHighlight(bHighlight);
108 return defRv();
109 }
110 virtual bool incomeMatrix(const OdGeMatrix3d *pXfm)
111 {
112 if (hasRedirection())
113 return getRedirection()->incomeMatrix(pXfm);
114 return defRv();
115 }
116 virtual bool incomeFade(long nEntry, bool bFade)
117 {
118 if (hasRedirection())
119 return getRedirection()->incomeFade(nEntry, bFade);
120 return defRv();
121 }
123 {
124 if (hasRedirection())
125 return getRedirection()->incomeMarkers(brType, pBranch);
126 return defRv();
127 }
128 virtual bool incomeDrawOrder(const double* pDrawOrder)
129 {
130 if (hasRedirection())
131 return getRedirection()->incomeDrawOrder(pDrawOrder);
132 return defRv();
133 }
134 virtual bool incomeDepthIval(const OdTrVisIvald *pDepthXform)
135 {
136 if (hasRedirection())
137 return getRedirection()->incomeDepthIval(pDepthXform);
138 return defRv();
139 }
140 virtual bool incomeExploded(bool bExploded)
141 {
142 if (hasRedirection())
143 return getRedirection()->incomeExploded(bExploded);
144 return defRv();
145 }
146 virtual bool incomeSelectionStyle(OdUInt32 nStyle)
147 {
148 if (hasRedirection())
149 return getRedirection()->incomeSelectionStyle(nStyle);
150 return defRv();
151 }
153 {
154 if (hasRedirection())
155 return getRedirection()->incomeSelectionID(id);
156 return defRv();
157 }
158};
159
164{
165 protected:
167 virtual bool defRv() const { return false; }
168 struct RvFlag
169 {
172 void add(bool bSet) { m_bSet = true; m_bRv = bSet; }
173 bool state() const { return m_bRv; }
174 bool generateRv() const { return m_bSet; }
175 };
176 public:
178
180 bool hasRedirectionA() const { return m_pRedirectA != NULL; }
181 void setRedirectionA(OdTrVisRenderDataInvoke *pRedirection) { m_pRedirectA = pRedirection; }
183
185 bool hasRedirectionB() const { return m_pRedirectB != NULL; }
186 void setRedirectionB(OdTrVisRenderDataInvoke *pRedirection) { m_pRedirectB = pRedirection; }
188
190 { RvFlag rv;
191 if (hasRedirectionA())
193 if (hasRedirectionB() && rv.state())
195 return rv.generateRv() ? rv.state() : defRv();
196 }
197
198 virtual bool incomeHighlight(bool bHighlight)
199 { RvFlag rv;
200 if (hasRedirectionA())
201 rv.add(getRedirectionA()->incomeHighlight(bHighlight));
202 if (hasRedirectionB() && rv.state())
203 rv.add(getRedirectionB()->incomeHighlight(bHighlight));
204 return rv.generateRv() ? rv.state() : defRv();
205 }
206 virtual bool incomeMatrix(const OdGeMatrix3d *pXfm)
207 { RvFlag rv;
208 if (hasRedirectionA())
209 rv.add(getRedirectionA()->incomeMatrix(pXfm));
210 if (hasRedirectionB() && rv.state())
211 rv.add(getRedirectionB()->incomeMatrix(pXfm));
212 return rv.generateRv() ? rv.state() : defRv();
213 }
214 virtual bool incomeFade(long nEntry, bool bFade)
215 { RvFlag rv;
216 if (hasRedirectionA())
217 rv.add(getRedirectionA()->incomeFade(nEntry, bFade));
218 if (hasRedirectionB() && rv.state())
219 rv.add(getRedirectionB()->incomeFade(nEntry, bFade));
220 return rv.generateRv() ? rv.state() : defRv();
221 }
223 { RvFlag rv;
224 if (hasRedirectionA())
225 rv.add(getRedirectionA()->incomeMarkers(brType, pBranch));
226 if (hasRedirectionB() && rv.state())
227 rv.add(getRedirectionB()->incomeMarkers(brType, pBranch));
228 return rv.generateRv() ? rv.state() : defRv();
229 }
230 virtual bool incomeDrawOrder(const double* pDrawOrder)
231 { RvFlag rv;
232 if (hasRedirectionA())
233 rv.add(getRedirectionA()->incomeDrawOrder(pDrawOrder));
234 if (hasRedirectionB() && rv.state())
235 rv.add(getRedirectionB()->incomeDrawOrder(pDrawOrder));
236 return rv.generateRv() ? rv.state() : defRv();
237 }
238 virtual bool incomeDepthIval(const OdTrVisIvald *pDepthXform)
239 { RvFlag rv;
240 if (hasRedirectionA())
241 rv.add(getRedirectionA()->incomeDepthIval(pDepthXform));
242 if (hasRedirectionB() && rv.state())
243 rv.add(getRedirectionB()->incomeDepthIval(pDepthXform));
244 return rv.generateRv() ? rv.state() : defRv();
245 }
246 virtual bool incomeExploded(bool bExploded)
247 { RvFlag rv;
248 if (hasRedirectionA())
249 rv.add(getRedirectionA()->incomeExploded(bExploded));
250 if (hasRedirectionB() && rv.state())
251 rv.add(getRedirectionB()->incomeExploded(bExploded));
252 return rv.generateRv() ? rv.state() : defRv();
253 }
254 virtual bool incomeSelectionStyle(OdUInt32 nStyle)
255 { RvFlag rv;
256 if (hasRedirectionA())
258 if (hasRedirectionB() && rv.state())
260 return rv.generateRv() ? rv.state() : defRv();
261 }
263 { RvFlag rv;
264 if (hasRedirectionA())
266 if (hasRedirectionB() && rv.state())
268 return rv.generateRv() ? rv.state() : defRv();
269 }
270};
271
276{
277 protected:
280 public:
284 { }
285
290 pObj->setup(viewportId, overlayId);
291 return pObj;
292 }
293
297 { if (pInvocation) { setup(pInvocation->viewportId(), pInvocation->overlayId()); } }
298
299 // Adds ability to customize OdTrVisRenderDataInvoke interface by invocation.
301 { return static_cast<OdTrVisRenderDataInvoke*>(pInvoke); }
302 virtual const OdTrVisDirectRenderPartialUpdateInvocation *basicInvocation() const { return this; }
303
306};
307
309
313class OdTrVisStaticDirectRenderPartialUpdateInvocation : public OdStaticRxObject<OdTrVisDirectRenderPartialUpdateInvocation>
314{
315 public:
321};
322
326class OdTrVisRenderDataDirectAccessor /*: public OdRxObject*/
327{
328 public:
330};
331
332//typedef OdSmartPtr<OdTrVisRenderDataDirectAccessor> OdTrVisRenderDataDirectAccessorPtr;
333
334#include "TD_PackPop.h"
335
336#endif // ODTRVISRENDITIONPU
true
Definition: DimVarDefs.h:2046
false
Definition: DimVarDefs.h:165
unsigned int OdUInt32
const OdTrVisId kTrVisNullId
Definition: TrVisDefs.h:134
const void * OdTrVisStateBranchPtr
Definition: TrVisDefs.h:162
OdTrVisStateBranchType
Definition: TrVisDefs.h:155
OdSmartPtr< OdTrVisDirectRenderPartialUpdateInvocation > OdTrVisDirectRenderPartialUpdateInvocationPtr
static OdSmartPtr< TInterface > createObject()
Definition: RxObjectImpl.h:107
void setup(const OdTrVisDirectRenderPartialUpdateInvocation *pInvocation)
void setup(OdTrVisViewportId viewportId, OdTrVisOverlayId overlayId)
static OdSmartPtr< OdTrVisDirectRenderPartialUpdateInvocation > createObject()
static OdSmartPtr< OdTrVisDirectRenderPartialUpdateInvocation > createObject(OdTrVisViewportId viewportId, OdTrVisOverlayId overlayId)
virtual OdTrVisRenderDataInvoke * wrapInvoke(OdTrVisRenderDataInvokeHid *pInvoke) const
virtual const OdTrVisDirectRenderPartialUpdateInvocation * basicInvocation() const
virtual bool collectRenderData(const OdTrVisDirectRenderPartialUpdateInvocation *pInvocation, OdTrVisRenderDataInvokeHid *pInvoke)=0
virtual bool incomeMetafile(OdTrVisDisplayId mfId)
virtual bool incomeFade(long nEntry, bool bFade)
virtual bool incomeHighlight(bool bHighlight)
OdTrVisRenderDataInvoke * getRedirectionB() const
void setRedirectionA(OdTrVisRenderDataInvoke *pRedirection)
virtual bool incomeDepthIval(const OdTrVisIvald *pDepthXform)
virtual bool incomeMarkers(OdTrVisStateBranchType brType, OdTrVisStateBranchPtr pBranch)
virtual bool incomeMatrix(const OdGeMatrix3d *pXfm)
OdTrVisRenderDataInvoke * m_pRedirectB
OdTrVisRenderDataInvoke * getRedirectionA() const
virtual bool incomeDrawOrder(const double *pDrawOrder)
virtual bool incomeExploded(bool bExploded)
OdTrVisRenderDataInvoke * m_pRedirectA
void setRedirectionB(OdTrVisRenderDataInvoke *pRedirection)
virtual bool incomeSelectionStyle(OdUInt32 nStyle)
virtual bool incomeSelectionID(OdTrVisId id)
virtual bool incomeSelectionStyle(OdUInt32)
virtual bool incomeExploded(bool)
bool incomeDataStream(const OdTrVisDisplayId *pList, OdUInt32 nEntries)
virtual bool incomeHighlight(bool)
virtual bool incomeDepthIval(const OdTrVisIvald *)
virtual bool incomeMetafile(OdTrVisDisplayId mfId)=0
virtual bool incomeMarkers(OdTrVisStateBranchType, OdTrVisStateBranchPtr)
virtual bool incomeFade(long, bool)
virtual bool incomeMatrix(const OdGeMatrix3d *)
virtual bool incomeSelectionID(OdTrVisId)
virtual bool incomeDrawOrder(const double *)
virtual bool incomeMetafile(OdTrVisDisplayId mfId)
OdTrVisRenderDataInvoke * getRedirection() const
virtual bool incomeMarkers(OdTrVisStateBranchType brType, OdTrVisStateBranchPtr pBranch)
OdTrVisRenderDataInvoke * m_pRedirectTo
virtual bool incomeSelectionID(OdTrVisId id)
virtual bool incomeExploded(bool bExploded)
virtual bool incomeSelectionStyle(OdUInt32 nStyle)
virtual bool incomeFade(long nEntry, bool bFade)
virtual bool incomeDrawOrder(const double *pDrawOrder)
virtual bool incomeMatrix(const OdGeMatrix3d *pXfm)
void setRedirection(OdTrVisRenderDataInvoke *pRedirection)
virtual bool incomeDepthIval(const OdTrVisIvald *pDepthXform)
virtual bool incomeHighlight(bool bHighlight)
OdTrVisDirectRenderPartialUpdateInvocation * getPtr()
OdTrVisStaticDirectRenderPartialUpdateInvocation(OdTrVisViewportId viewportId, OdTrVisOverlayId overlayId)
const OdTrVisDirectRenderPartialUpdateInvocation * getPtr() const