CFx SDK Documentation  2020SP3
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__
OdGiMetafiler::kWorld
@ kWorld
Definition: GiMetafiler.h:155
OdGiDeviation
Definition: GiDeviation.h:44
OdGiMetafiler::setCoordinatesType
virtual void setCoordinatesType(CoordType ct)=0
NULL
#define NULL
Definition: GsProperties.h:177
OdGiMetafiler::setDeviation
virtual void setDeviation(const OdGeDoubleArray &deviations)=0
OdGiGeometryMetafile::Record::ODRX_HEAP_OPERATORS
ODRX_HEAP_OPERATORS()
OdGiGeometryMetafile::Record::recordSize
virtual OdUInt64 recordSize() const
Definition: GiMetafiler.h:87
OdGiMetafilerPtr
OdSmartPtr< OdGiMetafiler > OdGiMetafilerPtr
Definition: GiMetafiler.h:190
OdGiMetafiler::kModel
@ kModel
Definition: GiMetafiler.h:154
OdGiMetafiler::setMetafile
virtual void setMetafile(OdGiGeometryMetafile *pMetafile)=0
OdGiMetafiler::setDeviation
virtual void setDeviation(const OdGiDeviation *pDeviation)=0
OdGiMetafiler::flush
virtual void flush(bool bForceTraits=true)=0
OdRxObject
Definition: RxObject.h:564
OdGiGeometryMetafile
Definition: GiMetafiler.h:40
OdGiGeometryMetafile::Record
Definition: GiMetafiler.h:47
OdArray< double, OdMemoryAllocator< double > >
OdGiGeometryMetafilePtr
OdSmartPtr< OdGiGeometryMetafile > OdGiGeometryMetafilePtr
Definition: GiMetafiler.h:123
TD_PackPop.h
OdGiGeometryMetafile::Record::deleteList
void deleteList()
Definition: GiMetafiler.h:74
OdGiGeometryMetafile::play
void play(OdGiConveyorGeometry *pGeom, OdGiConveyorContext *pCtx) const
kUnknown
@ kUnknown
Definition: DbManagerSubentData.h:39
OdGiMetafiler::exchangeMetafile
virtual void exchangeMetafile(OdGiGeometryMetafile *pMetafile)=0
ODGI_EXPORT
#define ODGI_EXPORT
Definition: GiExport.h:35
OdGiGeometryMetafile::ODCA_HEAP_OPERATORS
ODCA_HEAP_OPERATORS()
OdGiGeometryMetafile::metafileSize
virtual OdUInt64 metafileSize() const
OdGiConveyorGeometry
Definition: GiConveyorGeometry.h:270
OdGiMetafiler::setDrawContext
virtual void setDrawContext(OdGiConveyorContext *pDrawCtx)=0
OdGiGeometryMetafile::setRecords
void setRecords(Record *pRec)
Definition: GiMetafiler.h:110
OdGiMetafiler::metafile
virtual OdGiGeometryMetafile * metafile()=0
OdSmartPtr
Definition: SmartPtr.h:58
OdGiMetafiler::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdGiMetafiler)
OdGiMetafiler::CoordType
CoordType
Definition: GiMetafiler.h:152
OdGiSubEntityTraitsData
Definition: GiSubEntityTraitsData.h:73
OdGiMetafiler::add
virtual void add(OdGiGeometryMetafile::Record *pRec)=0
OdGiGeometryMetafile::Record::Record
Record()
Definition: GiMetafiler.h:53
ChunkAllocator.h
OdGiGeometryMetafile::Record::play
virtual void play(OdGiConveyorGeometry *pGeom, OdGiConveyorContext *pCtx) const =0
OdGiGeometryMetafile::lastRecord
Record * lastRecord() const
OdGiMetafiler::saveTraits
virtual bool saveTraits(const OdGiSubEntityTraitsData &entTraits, const OdGiSubEntityTraitsData *byBlockTraits=NULL)=0
TD_PackPush.h
OdGiMetafiler
Definition: GiMetafiler.h:130
OdGiMetafiler::coordinatesType
virtual CoordType coordinatesType() const =0
OdGiGeometryMetafile::Record::~Record
virtual ~Record()
Definition: GiMetafiler.h:57
OdGiConveyorContext
Definition: GiConveyorGeometry.h:54
OdGiGeometryMetafile::firstRecord
Record * firstRecord() const
Definition: GiMetafiler.h:116
OdGiGeometryMetafile::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdGiGeometryMetafile)
ODA_ASSERT
#define ODA_ASSERT(exp)
Definition: DebugStuff.h:49
OdGiConveyorNode
Definition: GiConveyorNode.h:84
OdGiMetafiler::kEye
@ kEye
Definition: GiMetafiler.h:156
OdGiGeometryMetafile::isEmpty
bool isEmpty() const
Definition: GiMetafiler.h:115
GiConveyorNode.h
OdGiGeometryMetafile::~OdGiGeometryMetafile
virtual ~OdGiGeometryMetafile()
OdGiGeometryMetafile::Record::setTail
void setTail(Record *pTail)
Definition: GiMetafiler.h:69
OdGiGeometryMetafile::OdGiGeometryMetafile
OdGiGeometryMetafile()
OdGiGeometryMetafile::Record::tail
Record * tail()
Definition: GiMetafiler.h:59
OdGiGeometryMetafile::Record::tail
const Record * tail() const
Definition: GiMetafiler.h:64
OdGiMetafiler::saveTraits
virtual bool saveTraits(const OdGiSubEntityTraitsData *byBlockTraits)=0
OdGiGeometryMetafile::clear
void clear()
OdGiMetafiler::saveTraits
virtual bool saveTraits()=0
OdUInt64
Definition: Int64.h:137
GeDoubleArray.h
OdGiGeometryMetafile::Record::m_pTail
Record * m_pTail
Definition: GiMetafiler.h:49