CFx SDK Documentation  2023 SP0
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
false
Definition: DimVarDefs.h:165
#define NULL
Definition: GsProperties.h:177
unsigned int OdUInt32
int OdInt32
unsigned char OdUInt8
OdTrVisGeomType
virtual const OdTrVisTtfFontsCacheClient * metafileTtfFontsCache()
OdTrVisMetafilePlaybackCallback * m_pActualCallback
virtual bool metafileTriangleProc(const OdGePoint3d *pVertex)
void setCallback(OdTrVisMetafilePlaybackCallback *pCallback)
virtual bool metafileLineProc(const OdGePoint3d *pVertex)
OdTrVisMetafileConveyorPlayback(OdTrVisMetafilePlaybackCallback *pCallback=NULL)
virtual void metafilePlayMetafile(OdTrVisDisplayId metafileId)
OdTrVisMetafilePlaybackCallback * callback() const
virtual bool metafileSelectMarker(OdTrVisGsMarker gsMarker, const OdBaseMetafileContainer *pContainer)
virtual bool metafileGeomVisibility(OdTrVisGeomType geomType)
virtual void metafilePushTransform(const OdGeMatrix3d &mtx)
void play(const OdBaseMetafileContainer *pContainer, OdGiConveyorGeometry *pGeom, OdGiConveyorContext *pCtx, bool bCheckMarks=true)
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 bool metafileLineProc(const OdGePoint3d *)
virtual const OdTrVisTtfFontsCacheClient * metafileTtfFontsCache()
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)
bool play(const OdBaseMetafileContainer *pContainer, bool bCheckMarks=true)
OdTrVisMetafilePlaybackCallback * callback() const
void setConfigFlags(OdUInt32 configFlags)
void annihilateSelectionMarkers(InprocRegisters &inprocCtx, OdInt32 first, OdInt32 count)
OdTrVisMetafilePlaybackCallback * m_pCallback
OdTrVisMetafilePlayback(OdTrVisMetafilePlaybackCallback *pCallback=NULL, OdUInt32 configFlags=kIgnoreNonSelGeom)
GLsizei GLsizei * count
Definition: gles2_ext.h:276