CFx SDK Documentation  2020SP3
TrVisMetafilePlayback.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 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"
32 #include "Gi/GiConveyorGeometry.h"
33 #include "MetafileTransformStack.h"
34 
36 
45 {
46  public:
47  virtual void metafilePlayMetafile(OdTrVisDisplayId /*metafileId*/) { }
48  virtual void metafilePushTransform(const OdGeMatrix3d & /*mTransform*/) { }
49  virtual void metafilePopTransform() { }
51 
52  virtual void metafileProcessUserEntry(OdUInt32 /*dataLength*/, const OdUInt8 * /*pData*/) { }
53 
54  virtual bool metafileSelectMarker(OdTrVisGsMarker /*gsMarker*/, const OdBaseMetafileContainer * /*pContainer*/) { return true; }
55 
56  virtual bool metafilePointProc(const OdGePoint3d * /*pVertex*/) { return true; }
57  virtual bool metafileLineProc(const OdGePoint3d * /*pVertex*/) { return true; }
58  virtual bool metafileTriangleProc(const OdGePoint3d * /*pVertex*/) { return true; }
59  virtual bool metafileGeomVisibility(OdTrVisGeomType /*geomType*/) { return true; }
60 };
61 
70 {
71  public:
72  enum ConfFlags
73  {
74  kIgnoreSelGeom = (1 << 0), // Ignore selection-only geometry (can't be set with kIgnoreNonSelGeom)
75  kIgnoreNonSelGeom = (1 << 1), // Ignore geometry which can't be selected (can't be set with kIgnoreSelGeom)
76  kClientStream = (1 << 2) // Client-side metafile stream
77  };
78  protected:
79  // Player->Owner communication
81  // Interprocess context for nested play() calls
83  {
84  // Current selection markers
86  // Number of selection markers
88  // Processing flags
91 
92  // Default initializer
95  { }
97  // Configuration flags
99  public:
101  : m_pCallback(pCallback)
103  {
104  }
106  {
107  }
108 
110  {
111  m_pCallback = pCallback;
112  }
114  {
115  return m_pCallback;
116  }
117 
119  {
121  }
122  inline OdUInt32 configFlags() const
123  {
124  return m_configFlags;
125  }
126 
127  bool play(const OdBaseMetafileContainer *pContainer, bool bCheckMarks = true);
128  protected:
130 };
131 
140 {
141  protected:
142  // Conveyor communication interfaces
145  // Actual readdress callback
147  // Callback redirection
148  virtual void metafilePlayMetafile(OdTrVisDisplayId metafileId);
149  virtual void metafilePushTransform(const OdGeMatrix3d &mtx);
150  virtual void metafilePopTransform();
152  virtual void metafileProcessUserEntry(OdUInt32 dataLength, const OdUInt8 *pData);
153  virtual bool metafileSelectMarker(OdTrVisGsMarker gsMarker, const OdBaseMetafileContainer *pContainer);
154  // Internal callback implementations
155  virtual bool metafilePointProc(const OdGePoint3d *pVertex);
156  virtual bool metafileLineProc(const OdGePoint3d *pVertex);
157  virtual bool metafileTriangleProc(const OdGePoint3d *pVertex);
158  virtual bool metafileGeomVisibility(OdTrVisGeomType geomType);
159  public:
162  , m_pActualCallback(pCallback)
163  {
165  }
167  {
168  }
169 
171  {
172  m_pActualCallback = pCallback;
173  }
175  {
176  return m_pActualCallback;
177  }
178 
179  void play(const OdBaseMetafileContainer *pContainer, OdGiConveyorGeometry *pGeom, OdGiConveyorContext *pCtx, bool bCheckMarks = true);
180 };
181 
182 #include "TD_PackPop.h"
183 
184 #endif // ODTRVISMETAFILEPLAYBACK
OdTrVisMetafileConveyorPlayback::metafileTriangleProc
virtual bool metafileTriangleProc(const OdGePoint3d *pVertex)
OdTrVisMetafileConveyorPlayback::setCallback
void setCallback(OdTrVisMetafilePlaybackCallback *pCallback)
Definition: TrVisMetafilePlayback.h:170
OdTrVisMetafileConveyorPlayback::metafileLineProc
virtual bool metafileLineProc(const OdGePoint3d *pVertex)
NULL
#define NULL
Definition: GsProperties.h:177
OdTrVisMetafileConveyorPlayback::metafilePushTransform
virtual void metafilePushTransform(const OdGeMatrix3d &mtx)
OdUInt8
unsigned char OdUInt8
Definition: OdPlatformSettings.h:759
OdTrVisMetafilePlayback::m_inprocContext
struct OdTrVisMetafilePlayback::InprocRegisters m_inprocContext
OdTrVisMetafilePlayback::kIgnoreNonSelGeom
@ kIgnoreNonSelGeom
Definition: TrVisMetafilePlayback.h:75
count
GLsizei GLsizei * count
Definition: gles2_ext.h:276
OdTrVisMarkBase
Definition: TrVisMetafileStream.h:276
OdTrVisMetafileConveyorPlayback::metafilePlayMetafile
virtual void metafilePlayMetafile(OdTrVisDisplayId metafileId)
OdTrVisMetafilePlaybackCallback::metafilePointProc
virtual bool metafilePointProc(const OdGePoint3d *)
Definition: TrVisMetafilePlayback.h:56
false
false
Definition: DimVarDefs.h:165
OdTrVisMetafilePlayback::InprocRegisters::pMarks
const OdTrVisSelMark * pMarks
Definition: TrVisMetafilePlayback.h:85
OdTrVisMetafilePlayback::InprocRegisters::bSelGeometry
bool bSelGeometry
Definition: TrVisMetafilePlayback.h:90
OdTrVisMetafilePlayback::InprocRegisters::InprocRegisters
InprocRegisters()
Definition: TrVisMetafilePlayback.h:93
OdTrVisMetafilePlayback::configFlags
OdUInt32 configFlags() const
Definition: TrVisMetafilePlayback.h:122
OdTrVisMetafilePlaybackCallback::metafilePopTransform
virtual void metafilePopTransform()
Definition: TrVisMetafilePlayback.h:49
OdTrVisMetafilePlaybackCallback::metafilePlayMetafile
virtual void metafilePlayMetafile(OdTrVisDisplayId)
Definition: TrVisMetafilePlayback.h:47
OdTrVisMetafileConveyorPlayback::m_pGeom
OdGiConveyorGeometry * m_pGeom
Definition: TrVisMetafilePlayback.h:143
OdTrVisMetafilePlaybackCallback::metafilePushTransform
virtual void metafilePushTransform(const OdGeMatrix3d &)
Definition: TrVisMetafilePlayback.h:48
TD_PackPop.h
OdTrVisMetafileConveyorPlayback::callback
OdTrVisMetafilePlaybackCallback * callback() const
Definition: TrVisMetafilePlayback.h:174
OdTrVisMetafilePlayback::OdTrVisMetafilePlayback
OdTrVisMetafilePlayback(OdTrVisMetafilePlaybackCallback *pCallback=NULL, OdUInt32 configFlags=kIgnoreNonSelGeom)
Definition: TrVisMetafilePlayback.h:100
OdTrVisMetafilePlayback::kIgnoreSelGeom
@ kIgnoreSelGeom
Definition: TrVisMetafilePlayback.h:74
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdGeMatrix3d
Definition: GeMatrix3d.h:73
OdTrVisMetafilePlayback::~OdTrVisMetafilePlayback
virtual ~OdTrVisMetafilePlayback()
Definition: TrVisMetafilePlayback.h:105
OdTrVisMetafileConveyorPlayback::metafileGeomVisibility
virtual bool metafileGeomVisibility(OdTrVisGeomType geomType)
OdGiConveyorGeometry
Definition: GiConveyorGeometry.h:270
OdTrVisMetafileConveyorPlayback::metafilePopTransform
virtual void metafilePopTransform()
OdTrVisMetafilePlayback::kClientStream
@ kClientStream
Definition: TrVisMetafilePlayback.h:76
OdTrVisMetafileConveyorPlayback::play
void play(const OdBaseMetafileContainer *pContainer, OdGiConveyorGeometry *pGeom, OdGiConveyorContext *pCtx, bool bCheckMarks=true)
OdTrVisMetafileConveyorPlayback
Definition: TrVisMetafilePlayback.h:140
OdGePoint3d
Definition: GePoint3d.h:55
OdTrVisMetafilePlayback::InprocRegisters::bSuppressGeom
bool bSuppressGeom
Definition: TrVisMetafilePlayback.h:89
OdInt32
int OdInt32
Definition: OdPlatformSettings.h:782
GiConveyorGeometry.h
TrVisDefs.h
OdTrVisMetafilePlayback::play
bool play(const OdBaseMetafileContainer *pContainer, bool bCheckMarks=true)
OdTrVisMetafileConveyorPlayback::metafilePointProc
virtual bool metafilePointProc(const OdGePoint3d *pVertex)
OdTrVisMetafilePlayback::setConfigFlags
void setConfigFlags(OdUInt32 configFlags)
Definition: TrVisMetafilePlayback.h:118
OdTrVisMetafilePlaybackCallback::metafileTriangleProc
virtual bool metafileTriangleProc(const OdGePoint3d *)
Definition: TrVisMetafilePlayback.h:58
OdTrVisMetafilePlayback::callback
OdTrVisMetafilePlaybackCallback * callback() const
Definition: TrVisMetafilePlayback.h:113
OdTrVisMetafilePlayback::annihilateSelectionMarkers
void annihilateSelectionMarkers(InprocRegisters &inprocCtx, OdInt32 first, OdInt32 count)
OdTrVisMetafileConveyorPlayback::m_pCtx
OdGiConveyorContext * m_pCtx
Definition: TrVisMetafilePlayback.h:144
TD_PackPush.h
OdTrVisMetafilePlaybackCallback::metafileGeomVisibility
virtual bool metafileGeomVisibility(OdTrVisGeomType)
Definition: TrVisMetafilePlayback.h:59
OdTrVisMetafilePlaybackCallback::metafileProcessUserEntry
virtual void metafileProcessUserEntry(OdUInt32, const OdUInt8 *)
Definition: TrVisMetafilePlayback.h:52
OdTrVisMetafilePlayback::InprocRegisters
Definition: TrVisMetafilePlayback.h:83
TrVisMetafileStream.h
OdTrVisMetafileConveyorPlayback::metafileProcessUserEntry
virtual void metafileProcessUserEntry(OdUInt32 dataLength, const OdUInt8 *pData)
OdTrVisMetafilePlaybackCallback::metafileTtfFontsCache
virtual const OdTrVisTtfFontsCacheClient * metafileTtfFontsCache()
Definition: TrVisMetafilePlayback.h:50
OdTrVisTtfFontsCacheClient
Definition: TrVisTtfFontsCacheClient.h:36
OdGiConveyorContext
Definition: GiConveyorGeometry.h:54
OdTrVisMetafilePlayback::m_pCallback
OdTrVisMetafilePlaybackCallback * m_pCallback
Definition: TrVisMetafilePlayback.h:80
OdTrVisMetafilePlayback::setCallback
void setCallback(OdTrVisMetafilePlaybackCallback *pCallback)
Definition: TrVisMetafilePlayback.h:109
OdTrVisMetafileConveyorPlayback::metafileTtfFontsCache
virtual const OdTrVisTtfFontsCacheClient * metafileTtfFontsCache()
OdTrVisMetafileConveyorPlayback::metafileSelectMarker
virtual bool metafileSelectMarker(OdTrVisGsMarker gsMarker, const OdBaseMetafileContainer *pContainer)
OdTrVisMetafileConveyorPlayback::m_pActualCallback
OdTrVisMetafilePlaybackCallback * m_pActualCallback
Definition: TrVisMetafilePlayback.h:146
OdTrVisMetafileConveyorPlayback::~OdTrVisMetafileConveyorPlayback
virtual ~OdTrVisMetafileConveyorPlayback()
Definition: TrVisMetafilePlayback.h:166
OdTrVisMetafilePlayback::m_configFlags
OdUInt32 m_configFlags
Definition: TrVisMetafilePlayback.h:98
OdTrVisMetafilePlaybackCallback::metafileLineProc
virtual bool metafileLineProc(const OdGePoint3d *)
Definition: TrVisMetafilePlayback.h:57
OdTrVisMetafilePlaybackCallback
Definition: TrVisMetafilePlayback.h:45
OdTrVisMetafilePlaybackCallback::metafileSelectMarker
virtual bool metafileSelectMarker(OdTrVisGsMarker, const OdBaseMetafileContainer *)
Definition: TrVisMetafilePlayback.h:54
OdTrVisMetafilePlayback::ConfFlags
ConfFlags
Definition: TrVisMetafilePlayback.h:73
OdTrVisGeomType
OdTrVisGeomType
Definition: TrVisMetafileStream.h:184
OdTrVisMetafileConveyorPlayback::OdTrVisMetafileConveyorPlayback
OdTrVisMetafileConveyorPlayback(OdTrVisMetafilePlaybackCallback *pCallback=NULL)
Definition: TrVisMetafilePlayback.h:160
OdTrVisMetafilePlayback::InprocRegisters::nMarks
OdUInt32 nMarks
Definition: TrVisMetafilePlayback.h:87
OdUInt64
Definition: Int64.h:137
OdTrVisMetafilePlayback
Definition: TrVisMetafilePlayback.h:70