CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
GiMetafiler.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
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
31class OdGiDeviation;
32
33#include "TD_PackPush.h"
34
41{
42public:
43 //DOM-IGNORE-BEGIN
45
47 //DOM-IGNORE-END
48
52 class Record
53 {
54 protected:
55 //DOM-IGNORE-BEGIN
57 public:
59 //DOM-IGNORE-END
60
65 : m_pTail(0)
66 {}
67
71 virtual ~Record() {}
72
80 {
81 return m_pTail;
82 }
83
90 const Record* tail() const
91 {
92 return m_pTail;
93 }
94
100 void setTail(Record* pTail)
101 {
102 m_pTail = pTail;
103 }
104
108 inline void deleteList()
109 {
110 Record* pCurr = this;
111 while(pCurr)
112 {
113 Record* pTail = pCurr->m_pTail;
114 delete pCurr;
115 pCurr = pTail;
116 }
117 }
118
125 virtual void play(OdGiConveyorGeometry* pGeom, OdGiConveyorContext* pCtx) const = 0;
126
133 virtual OdUInt64 recordSize() const { return (OdUInt64)sizeof(*this); }
134 };
135
136private:
137 //DOM-IGNORE-BEGIN
138 Record* m_pHead;
139
140 void destroyRecords()
141 {
142 if(m_pHead)
143 {
144 m_pHead->deleteList();
145 m_pHead = NULL;
146 }
147 }
148 //DOM-IGNORE-END
149public:
150
155
160
164 void clear();
165
173
180 void play(OdGiConveyorOutput& output, OdGiConveyorContext* pCtx) const;
181
188 virtual OdUInt64 metafileSize() const;
189
195 void setRecords(Record* pRec)
196 {
197 ODA_ASSERT(m_pHead == 0);
198 m_pHead = pRec;
199 }
200
207 bool isEmpty() const { return m_pHead == 0; }
208
215 Record *firstRecord() const { return m_pHead; }
216
224};
225
231
238{
239public:
240 //DOM-IGNORE-BEGIN
242 //DOM-IGNORE-END
243
249 virtual void setMetafile(OdGiGeometryMetafile* pMetafile) = 0;
250
258
264 virtual void exchangeMetafile(OdGiGeometryMetafile* pMetafile) = 0;
265
271 virtual void setDeviation(const OdGeDoubleArray& deviations) = 0;
272
278 virtual void setDeviation(const OdGiDeviation* pDeviation) = 0;
279
285 virtual void setDrawContext(OdGiConveyorContext* pDrawCtx) = 0;
286
291 {
301 kDevice
302 };
303
309 virtual void setCoordinatesType(CoordType ct) = 0;
310
318 virtual CoordType coordinatesType() const = 0;
319
329 virtual bool saveTraits(const OdGiSubEntityTraitsData& entTraits, const OdGiSubEntityTraitsData *byBlockTraits = NULL) = 0;
330
339 virtual bool saveTraits(const OdGiSubEntityTraitsData *byBlockTraits) = 0;
340
347 virtual bool saveTraits() = 0;
348
354 virtual void flush(bool bForceTraits = true) = 0;
355
361 virtual void add(OdGiGeometryMetafile::Record* pRec) = 0;
362
367 {
369 kTextAsText = 1,
371 kNurbsAsNurbs = 2,
373 kPlineAsPline = 4,
375 kDisableImageConversion = 8
376 };
377
383 virtual void setOptions(OdUInt32 options) {}
384
391 virtual OdUInt32 options() const { return 0; }
392};
393
399
401{
402public:
404 const OdGePoint3d* pVertexList,
405 OdInt32 faceListSize,
406 const OdInt32* pFaceList,
407 const OdGiEdgeData* pEdgeData,
408 const OdGiFaceData* pFaceData,
409 const OdGiVertexData* pVertexData);
411
412 OdInt32 numVertices() const { return m_nbVertex; }
413 OdInt32 faceListSize() const { return m_faceListSize; }
414
415 const OdGePoint3d* vertices() const { return m_pVertexList; }
416 const OdInt32* faceList() const { return m_pFaceList; }
417
418 const OdGiEdgeData* edgeData() const { return m_pEdgeData; }
419 const OdGiFaceData* faceData() const { return m_pFaceData; }
420 const OdGiVertexData* vertexData() const { return m_pVertexData; }
421
422private:
423 OdInt32 m_nbVertex;
424 OdInt32 m_faceListSize;
425
426 OdGePoint3d* m_pVertexList;
427 OdInt32* m_pFaceList;
428
429 OdGiEdgeData* m_pEdgeData;
430 OdGiFaceData* m_pFaceData;
431 OdGiVertexData* m_pVertexData;
432
433 OdGiEdgeData m_edgeData;
434 OdGiFaceData m_faceData;
435 OdGiVertexData m_vertexData;
436};
437
438#include "TD_PackPop.h"
439
440#endif //#ifndef __OD_GI_METAFILER__
@ kUnknown
#define ODA_ASSERT(exp)
Definition: DebugStuff.h:57
#define ODGI_EXPORT
Definition: GiExport.h:35
OdSmartPtr< OdGiMetafiler > OdGiMetafilerPtr
Definition: GiMetafiler.h:398
OdSmartPtr< OdGiGeometryMetafile > OdGiGeometryMetafilePtr
Definition: GiMetafiler.h:230
unsigned int OdUInt32
int OdInt32
void setTail(Record *pTail)
Definition: GiMetafiler.h:100
const Record * tail() const
Definition: GiMetafiler.h:90
virtual OdUInt64 recordSize() const
Definition: GiMetafiler.h:133
virtual void play(OdGiConveyorGeometry *pGeom, OdGiConveyorContext *pCtx) const =0
ODRX_DECLARE_MEMBERS(OdGiGeometryMetafile)
Record * lastRecord() const
void play(OdGiConveyorOutput &output, OdGiConveyorContext *pCtx) const
void setRecords(Record *pRec)
Definition: GiMetafiler.h:195
void play(OdGiConveyorGeometry *pGeom, OdGiConveyorContext *pCtx) const
Record * firstRecord() const
Definition: GiMetafiler.h:215
bool isEmpty() const
Definition: GiMetafiler.h:207
virtual ~OdGiGeometryMetafile()
virtual OdUInt64 metafileSize() const
virtual OdGiGeometryMetafile * metafile()=0
virtual OdUInt32 options() const
Definition: GiMetafiler.h:391
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 setOptions(OdUInt32 options)
Definition: GiMetafiler.h:383
virtual void setMetafile(OdGiGeometryMetafile *pMetafile)=0
virtual void setDeviation(const OdGiDeviation *pDeviation)=0
const OdGiFaceData * faceData() const
Definition: GiMetafiler.h:419
const OdGePoint3d * vertices() const
Definition: GiMetafiler.h:415
const OdGiVertexData * vertexData() const
Definition: GiMetafiler.h:420
const OdInt32 * faceList() const
Definition: GiMetafiler.h:416
OdInt32 faceListSize() const
Definition: GiMetafiler.h:413
const OdGiEdgeData * edgeData() const
Definition: GiMetafiler.h:418
OdInt32 numVertices() const
Definition: GiMetafiler.h:412
OdGiShell(OdInt32 nbVertex, const OdGePoint3d *pVertexList, OdInt32 faceListSize, const OdInt32 *pFaceList, const OdGiEdgeData *pEdgeData, const OdGiFaceData *pFaceData, const OdGiVertexData *pVertexData)