CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
TrVisMetafilePlayback.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// GLES2 metafile inverse converter
24
25#ifndef ODTRVISMETAFILEPLAYBACK
26#define ODTRVISMETAFILEPLAYBACK
27
28#include "TD_PackPush.h"
29
30#include "TrVisDefs.h"
31#include "TrVisMetafileStream.h"
33#include "MetafileTransformStack.h"
34#define STL_USING_SET
35#include "OdaSTL.h"
36
38
47{
48 public:
49 virtual void metafilePlayMetafile(OdTrVisDisplayId /*metafileId*/) { }
50 virtual void metafilePushTransform(const OdGeMatrix3d & /*mTransform*/) { }
51 virtual void metafilePopTransform() { }
52 virtual const OdTrVisTtfFontsCacheClient *metafileTtfFontsCache() { return NULL; }
53
54 virtual void metafileProcessUserEntry(OdUInt32 /*dataLength*/, const OdUInt8 * /*pData*/) { }
56 virtual const OdTrVisDisplayId *metafileBlockMetaList(OdTrVisBlockId /*blockId*/, OdUInt32 & /*numListEntries*/) { return NULL; }
57
58 virtual bool metafileSelectMarker(OdTrVisGsMarker /*gsMarker*/, const OdBaseMetafileContainer * /*pContainer*/) { return true; }
59
60 virtual bool metafilePointProc(const OdGePoint3d * /*pVertex*/) { return true; }
61 virtual bool metafilePolyPointProc(const OdGePoint3d * /*pVertex*/, const OdGsMarker * /*pSubEntMarkers*/) { return true; }
62 virtual bool metafileLineProc(const OdGePoint3d * /*pVertex*/) { return true; }
63 virtual bool metafileTriangleProc(const OdGePoint3d * /*pVertex*/) { return true; }
64 virtual bool metafileGeomVisibility(OdTrVisGeomType /*geomType*/) { return true; }
65};
66
75{
76 public:
78 {
82 };
84 {
88 };
89 protected:
91 {
92 kIgnoreSelGeom = (1 << 0), // Ignore selection-only geometry (can't be set with kIgnoreNonSelGeom)
93 kIgnoreNonSelGeom = (1 << 1), // Ignore geometry which can't be selected (can't be set with kIgnoreSelGeom)
94 kClientStream = (1 << 2), // Client-side metafile stream
95 kIgnore2d = (1 << 3), // Ignore geometry marked as 2d
96 kIgnore3d = (1 << 4) // Ignore geometry marked as 3d
97 };
98 protected:
99 // Player->Owner communication
101 // Interprocess context for nested play() calls
103 {
104 // Current selection markers
106 // Number of selection markers
108 // Selection markers activity
110 // Suppress flags
111 enum {
112 kSuppressByGeom = (1 << 0),
114 kSuppressByMf = (1 << 2)
115 };
117
118 // Default initializer
124 // Configuration flags
126 // Inclusion metafile filers
127 typedef std::set<OdTrVisMetafileId> FilterMfsMap;
129 // Marker till which the Drawable PE will perform selection itself
131 public:
133 bool bClientStream = false, PlayMode playMode = kPlayModeUndefined)
134 : m_pCallback(pCallback)
135 , m_configFlags((bClientStream) ? kClientStream : 0)
136 , m_nMarkerBorder(0)
139 {
140 }
141
143 {
144 m_pCallback = pCallback;
145 }
147 {
148 return m_pCallback;
149 }
150
153 switch (playType)
156 default: break;
157 }
158 }
159 inline PlayType playType() const
160 {
162 }
163
166 switch (playMode)
169 default: break;
170 };
171 }
172 inline PlayMode playMode() const
173 {
176 return kPlayModeUndefined;
177 }
178
179 inline void setFilterMetafile(OdTrVisMetafileId mfId) { m_filterMfs.clear(); m_filterMfs.insert(mfId); }
180 inline void addFilterMetafile(OdTrVisMetafileId mfId) { m_filterMfs.insert(mfId); }
181 inline void removeFilterMetafile(OdTrVisMetafileId mfId) { m_filterMfs.erase(mfId); }
183 inline void setFilterMetafiles(const OdTrVisMetafileId *pMfIds, OdUInt32 nMfs)
184 { m_filterMfs.clear(); for (OdUInt32 nMf = 0; nMf < nMfs; nMf++) m_filterMfs.insert(pMfIds[nMf]); }
185 inline void resetFilterMetafiles() { m_filterMfs.clear(); }
187 inline bool hasFilterMetafiles() const { return !m_filterMfs.empty(); }
188 inline bool isMetafileFiltered(OdTrVisMetafileId mfId) const { return m_filterMfs.find(mfId) != m_filterMfs.end(); }
189
190 bool play(const OdBaseMetafileContainer *pContainer, bool bCheckMarks = true, bool bHighlighted = false);
191 protected:
193
194 bool canDrawablePerformSelectionItself(OdUInt64* nMarkerBorder = NULL);
195
197};
198
207{
208 protected:
209 // Conveyor communication interfaces
212 // Actual readdress callback
214 // Callback redirection
215 virtual void metafilePlayMetafile(OdTrVisDisplayId metafileId);
216 virtual void metafilePushTransform(const OdGeMatrix3d &mtx);
217 virtual void metafilePopTransform();
219 virtual void metafileProcessUserEntry(OdUInt32 dataLength, const OdUInt8 *pData);
221 virtual bool metafileSelectMarker(OdTrVisGsMarker gsMarker, const OdBaseMetafileContainer *pContainer);
222 virtual const OdTrVisDisplayId *metafileBlockMetaList(OdTrVisBlockId blockId, OdUInt32 &numListEntries);
223
224 // Internal callback implementations
225 virtual bool metafilePointProc(const OdGePoint3d *pVertex);
226 virtual bool metafilePolyPointProc(const OdGePoint3d * pVertex, const OdGsMarker * pSubEntMarkers);
227 virtual bool metafileLineProc(const OdGePoint3d *pVertex);
228 virtual bool metafileTriangleProc(const OdGePoint3d *pVertex);
230 public:
232 bool bClientStream = false, PlayMode playMode = kPlayModeUndefined)
233 : OdTrVisMetafilePlayback(NULL, playType, bClientStream, playMode)
234 , m_pActualCallback(pCallback)
235 {
237 }
239 {
240 }
241
243 {
244 m_pActualCallback = pCallback;
245 }
247 {
248 return m_pActualCallback;
249 }
251 {
252 return m_pCtx;
253 }
254
255 void play(const OdBaseMetafileContainer *pContainer, OdGiConveyorGeometry *pGeom, OdGiConveyorContext *pCtx,
256 bool bCheckMarks = true, bool bHighlighted = false);
257};
258
259#include "TD_PackPop.h"
260
261#endif // ODTRVISMETAFILEPLAYBACK
ptrdiff_t OdGsMarker
unsigned int OdUInt32
int OdInt32
unsigned char OdUInt8
#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
@ OdTrVisMetaRecMarkerType_Selection
@ OdTrVisMetaRecMarkerType_NTypes
@ OdTrVisMetaRecMarkerType_Metafile
OdTrVisGeomType
virtual const OdTrVisDisplayId * metafileBlockMetaList(OdTrVisBlockId blockId, OdUInt32 &numListEntries)
OdGiConveyorContext * context() const
OdTrVisMetafilePlaybackCallback * m_pActualCallback
virtual bool metafileTriangleProc(const OdGePoint3d *pVertex)
void setCallback(OdTrVisMetafilePlaybackCallback *pCallback)
virtual bool metafileLineProc(const OdGePoint3d *pVertex)
OdTrVisMetafileConveyorPlayback(OdTrVisMetafilePlaybackCallback *pCallback=NULL, PlayType playType=kPlayForSelection, bool bClientStream=false, PlayMode playMode=kPlayModeUndefined)
virtual void metafilePlayMetafile(OdTrVisDisplayId metafileId)
void play(const OdBaseMetafileContainer *pContainer, OdGiConveyorGeometry *pGeom, OdGiConveyorContext *pCtx, bool bCheckMarks=true, bool bHighlighted=false)
virtual bool metafileSelectMarker(OdTrVisGsMarker gsMarker, const OdBaseMetafileContainer *pContainer)
virtual bool metafileGeomVisibility(OdTrVisGeomType geomType)
virtual bool metafilePolyPointProc(const OdGePoint3d *pVertex, const OdGsMarker *pSubEntMarkers)
OdTrVisMetafilePlaybackCallback * callback() const
virtual const OdTrVisTtfFontsCacheClient * metafileTtfFontsCache()
virtual void metafilePlayExtensionObject(OdTrVisExtensionId extId)
virtual void metafilePushTransform(const OdGeMatrix3d &mtx)
virtual void metafileProcessUserEntry(OdUInt32 dataLength, const OdUInt8 *pData)
virtual bool metafilePointProc(const OdGePoint3d *pVertex)
virtual bool metafileSelectMarker(OdTrVisGsMarker, const OdBaseMetafileContainer *)
virtual void metafilePlayMetafile(OdTrVisDisplayId)
virtual void metafileProcessUserEntry(OdUInt32, const OdUInt8 *)
virtual const OdTrVisTtfFontsCacheClient * metafileTtfFontsCache()
virtual void metafilePlayExtensionObject(OdTrVisExtensionId)
virtual const OdTrVisDisplayId * metafileBlockMetaList(OdTrVisBlockId, OdUInt32 &)
virtual bool metafileLineProc(const OdGePoint3d *)
virtual bool metafilePolyPointProc(const OdGePoint3d *, const OdGsMarker *)
virtual void metafilePushTransform(const OdGeMatrix3d &)
virtual bool metafileTriangleProc(const OdGePoint3d *)
virtual bool metafileGeomVisibility(OdTrVisGeomType)
virtual bool metafilePointProc(const OdGePoint3d *)
struct OdTrVisMetafilePlayback::InprocRegisters m_inprocContext
void setCallback(OdTrVisMetafilePlaybackCallback *pCallback)
friend struct OdTrVisMetafilePlaybackMarkersIterator
std::set< OdTrVisMetafileId > FilterMfsMap
bool isMetafileFiltered(OdTrVisMetafileId mfId) const
OdGsMarker getCurrentSelectionMarker()
bool play(const OdBaseMetafileContainer *pContainer, bool bCheckMarks=true, bool bHighlighted=false)
void setFilterMetafiles(const OdTrVisMetafileId *pMfIds, OdUInt32 nMfs)
void setPlayType(PlayType playType)
void addFilterMetafile(OdTrVisMetafileId mfId)
void annihilateInprocMarkers(InprocRegisters &inprocCtx, OdInt32 first, OdInt32 count)
OdTrVisMetafilePlaybackCallback * callback() const
bool canDrawablePerformSelectionItself(OdUInt64 *nMarkerBorder=NULL)
void removeFilterMetafile(OdTrVisMetafileId mfId)
OdTrVisMetafilePlayback(OdTrVisMetafilePlaybackCallback *pCallback=NULL, PlayType playType=kPlayForSelection, bool bClientStream=false, PlayMode playMode=kPlayModeUndefined)
OdTrVisMetafilePlaybackCallback * m_pCallback
void setPlayMode(PlayMode playMode)
void setFilterMetafile(OdTrVisMetafileId mfId)
GLsizei GLsizei * count
Definition: gles2_ext.h:276
const OdTrVisDefProcMark * pMarks[OdTrVisMetaRecMarkerType_NTypes]
OdUInt32 nMarks[OdTrVisMetaRecMarkerType_NTypes]