CFx SDK Documentation  2023 SP0
GiMetafiler.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 
24 #ifndef __OD_GI_METAFILER__
25 #define __OD_GI_METAFILER__
26 
27 #include "Gi/GiConveyorNode.h"
28 #include "ChunkAllocator.h"
29 #include "Ge/GeDoubleArray.h"
30 
31 class OdGiDeviation;
32 
33 #include "TD_PackPush.h"
34 
40 {
41 public:
43 
45 
46  class Record
47  {
48  protected:
50  public:
52 
54  : m_pTail(0)
55  {}
56 
57  virtual ~Record() {}
58 
60  {
61  return m_pTail;
62  }
63 
64  const Record* tail() const
65  {
66  return m_pTail;
67  }
68 
69  void setTail(Record* pTail)
70  {
71  m_pTail = pTail;
72  }
73 
74  inline void deleteList()
75  {
76  Record* pCurr = this;
77  while(pCurr)
78  {
79  Record* pTail = pCurr->m_pTail;
80  delete pCurr;
81  pCurr = pTail;
82  }
83  }
84 
85  virtual void play(OdGiConveyorGeometry* pGeom, OdGiConveyorContext* pCtx) const = 0;
86 
87  virtual OdUInt64 recordSize() const { return (OdUInt64)sizeof(*this); }
88  };
89 
90 private:
91  Record* m_pHead;
92 
93  void destroyRecords()
94  {
95  if(m_pHead)
96  {
97  m_pHead->deleteList();
98  m_pHead = NULL;
99  }
100  }
101 
102 public:
103 
106 
107  void clear();
108  void play(OdGiConveyorGeometry* pGeom, OdGiConveyorContext* pCtx) const;
109  virtual OdUInt64 metafileSize() const;
110  void setRecords(Record* pRec)
111  {
112  ODA_ASSERT(m_pHead == 0);
113  m_pHead = pRec;
114  }
115  bool isEmpty() const { return m_pHead == 0; }
116  Record *firstRecord() const { return m_pHead; }
117  Record *lastRecord() const;
118 };
119 
124 
130 {
131 public:
133 
134  virtual void setMetafile(OdGiGeometryMetafile* pMetafile) = 0;
136 
137  virtual void exchangeMetafile(OdGiGeometryMetafile* pMetafile) = 0;
138 
141  virtual void setDeviation(const OdGeDoubleArray& deviations) = 0;
142 
145  virtual void setDeviation(const OdGiDeviation* pDeviation) = 0;
146 
149  virtual void setDrawContext(OdGiConveyorContext* pDrawCtx) = 0;
150 
152  {
153  kUnknown = 0,
157  kDevice
158  };
159 
162  virtual void setCoordinatesType(CoordType ct) = 0;
163 
166  virtual CoordType coordinatesType() const = 0;
167 
170  virtual bool saveTraits(const OdGiSubEntityTraitsData& entTraits, const OdGiSubEntityTraitsData *byBlockTraits = NULL) = 0;
173  virtual bool saveTraits(const OdGiSubEntityTraitsData *byBlockTraits) = 0;
176  virtual bool saveTraits() = 0;
177 
180  virtual void flush(bool bForceTraits = true) = 0;
181 
184  virtual void add(OdGiGeometryMetafile::Record* pRec) = 0;
185 };
186 
191 
192 #include "TD_PackPop.h"
193 
194 #endif //#ifndef __OD_GI_METAFILER__
#define ODA_ASSERT(exp)
Definition: DebugStuff.h:49
#define ODGI_EXPORT
Definition: GiExport.h:35
OdSmartPtr< OdGiMetafiler > OdGiMetafilerPtr
Definition: GiMetafiler.h:190
OdSmartPtr< OdGiGeometryMetafile > OdGiGeometryMetafilePtr
Definition: GiMetafiler.h:123
#define NULL
Definition: GsProperties.h:177
void setTail(Record *pTail)
Definition: GiMetafiler.h:69
const Record * tail() const
Definition: GiMetafiler.h:64
virtual OdUInt64 recordSize() const
Definition: GiMetafiler.h:87
virtual void play(OdGiConveyorGeometry *pGeom, OdGiConveyorContext *pCtx) const =0
ODRX_DECLARE_MEMBERS(OdGiGeometryMetafile)
Record * firstRecord() const
Definition: GiMetafiler.h:116
void setRecords(Record *pRec)
Definition: GiMetafiler.h:110
void play(OdGiConveyorGeometry *pGeom, OdGiConveyorContext *pCtx) const
bool isEmpty() const
Definition: GiMetafiler.h:115
Record * lastRecord() const
virtual ~OdGiGeometryMetafile()
virtual OdUInt64 metafileSize() const
virtual OdGiGeometryMetafile * metafile()=0
ODRX_DECLARE_MEMBERS(OdGiMetafiler)
virtual bool saveTraits()=0
virtual void add(OdGiGeometryMetafile::Record *pRec)=0
virtual void flush(bool bForceTraits=true)=0
virtual void setDrawContext(OdGiConveyorContext *pDrawCtx)=0
virtual void setCoordinatesType(CoordType ct)=0
virtual CoordType coordinatesType() const =0
virtual bool saveTraits(const OdGiSubEntityTraitsData &entTraits, const OdGiSubEntityTraitsData *byBlockTraits=NULL)=0
virtual bool saveTraits(const OdGiSubEntityTraitsData *byBlockTraits)=0
virtual void setDeviation(const OdGeDoubleArray &deviations)=0
virtual void exchangeMetafile(OdGiGeometryMetafile *pMetafile)=0
virtual void setMetafile(OdGiGeometryMetafile *pMetafile)=0
virtual void setDeviation(const OdGiDeviation *pDeviation)=0