CFx SDK Documentation  2020SP3
TrVisMetafileBuilder.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 device metafile builder
24 
25 #ifndef ODTRVISMETAFILEBUILDER
26 #define ODTRVISMETAFILEBUILDER
27 
28 #include "TD_PackPush.h"
29 #include "TrVisMetafileDef.h"
30 #include "TrVisCamera.h"
31 #include "Ge/GeCurve2d.h"
32 #include "Ge/GeCurve3d.h"
33 
34 class OdTrVisMetafileWriter;
36 
38 {
39  kVDNone = 0,
40  kVDColor = 1,
43  kVDTexCoord = 8
44 };
45 
47 {
51 
57 };
58 
60 {
61 protected:
63 public:
65  {
69  };
71  {
75  };
76 
77  virtual ~OdTrVisGeometryDraw() {};
78 
79  virtual void polypoint(OdUInt32 nPoints, const OdGePoint3d *pPoints) = 0;
80  virtual void polypoint(OdUInt32 nPoints, const OdGePoint3d *pPoints, const OdTrVisVertexData& data ) = 0;
81 
82  virtual void polyline(OdUInt32 nPoints, const OdGePoint3d *pPoints, LinesPrimType type ) = 0;
83  virtual void polyline(OdUInt32 nPoints, const OdGePoint3d *pPoints, LinesPrimType type, const OdTrVisVertexData& data ) = 0;
84 
85  virtual void triangle( OdUInt32 nPoints, const OdGePoint3d *pPoints, TrianglesPrimType type ) = 0;
86  virtual void triangle( OdUInt32 nPoints, const OdGePoint3d *pPoints, TrianglesPrimType type, const OdTrVisVertexData& data ) = 0;
87 
88  virtual void polygon(OdUInt32 nPoints, const OdGePoint3d *pPoints) = 0;
89  virtual void polygon(OdUInt32 nPoints, const OdGePoint3d *pPoints, const OdTrVisVertexData& data) = 0;
90 
91  virtual void arc(const OdGePoint3d &center, double radius, const OdGeVector3d &normal = OdGeVector3d::kZAxis, OdUInt32 nSegs = 16,
92  const OdGeVector3d &start = OdGeVector3d::kYAxis, double angleFrom = 0.0, double angleTo = Oda2PI) = 0;
93  virtual void circle( const OdGePoint3d &center, double radius, const OdGeVector3d &normal, OdUInt32 nSegs ) = 0;
94  virtual void curve2d( const OdGeCurve2d& curve ) = 0;
95  virtual void curve3d( const OdGeCurve3d& curve ) = 0;
96 
97  virtual void setDeviation( double dev ) = 0;
98  virtual double deviation() const = 0;
99 
100  //Indexed mode
101  virtual void beginIndexedMode(OdUInt32 nPoints, const OdGePoint3d* pPoints, const OdTrVisVertexData& data = OdTrVisVertexData() ) = 0;
102  virtual void endIndexedMode() = 0;
103 
104  virtual void indexedPolypoint( OdUInt32 nPoints, const OdInt32* pIndeces ) = 0;
105  virtual void indexedPolypoint( OdUInt32 nPoints, const OdInt32* pIndeces, OdUInt8 nEnabledVertexData ) = 0;
106 
107  virtual void indexedPolyline( OdUInt32 nPoints, const OdInt32* pIndeces, LinesPrimType type ) = 0;
108  virtual void indexedPolyline( OdUInt32 nPoints, const OdInt32* pIndeces, LinesPrimType type, OdUInt8 nEnabledVertexData ) = 0;
109 
110  virtual void indexedTriangle( OdUInt32 nPoints, const OdInt32* pIndeces, TrianglesPrimType type ) = 0;
111  virtual void indexedTriangle( OdUInt32 nPoints, const OdInt32* pIndeces, TrianglesPrimType type, OdUInt8 nEnabledVertexData ) = 0;
112 
113  virtual void indexedPolygon( OdUInt32 nPoints, const OdInt32* pIndeces ) = 0;
114  virtual void indexedPolygon( OdUInt32 nPoints, const OdInt32* pIndeces, OdUInt8 nEnabledVertexData ) = 0;
115 };
116 
118 
120 {
121 protected:
123 public:
125 
126  virtual void beginMetafileBuilding(OdTrVisCamera* pCamera, OdTrVisViewportId refVp, OdTrVisOverlayId refOr = kTrVisMainOverlayId, bool b2dModel = false) = 0;
127  virtual void beginMetafileBuilding(OdTrVisMetafileWriter* pWriter, OdTrVisCamera* pCamera, OdTrVisViewportId refVp, OdTrVisOverlayId refOr = kTrVisMainOverlayId, bool b2dModel = false) = 0;
128  virtual void endMetafileBuilding(OdTrVisMetafileDef &mfDef, bool bFin = false) = 0;
129 
130  virtual void rollback(bool bFin = true) = 0;
131 
132  virtual void writeAttribute(OdTrVisAttribute attrName, bool bEnable = true) = 0;
133  virtual void writeShading( OdTrVisShading shadName, bool bEnable = true ) = 0;
134 
135  // @@@TODO: reimplement this using TransformStack
136  virtual void pushTransform(const OdGeMatrix3d &tf) = 0;
137  virtual void popTransform() = 0;
138 
139  virtual void addMetafile(OdTrVisMetafileId mfId) = 0;
140 
141  virtual void setGeometryMarker(OdTrVisGeomType geomType) = 0;
142  virtual void setMaterial( OdTrVisMaterialId matId ) = 0;
143 
147 
148  virtual void setColor( const OdTrVisColorRGBA& ) = 0;
149 
150  // @@@TODO: eliminate this, but now ExClip uses it
151  virtual OdTrVisViewportId viewportId() const = 0;
152  virtual OdTrVisOverlayId overlayId() const = 0;
153 
155 };
156 
158 
159 #include "TD_PackPop.h"
160 
161 #endif // ODTRVISMETAFILEBUILDER
OdTrVisMetafileBuilderPtr
OdSmartPtr< OdTrVisMetafileBuilder > OdTrVisMetafileBuilderPtr
Definition: TrVisMetafileBuilder.h:157
OdTrVisGeometryDraw::kTriangleFan
@ kTriangleFan
Definition: TrVisMetafileBuilder.h:74
OdTrVisGeometryDraw::polypoint
virtual void polypoint(OdUInt32 nPoints, const OdGePoint3d *pPoints, const OdTrVisVertexData &data)=0
OdGeVector3d
Definition: GeVector3d.h:54
Oda2PI
#define Oda2PI
Definition: OdaCommon.h:57
OdTrVisGeometryDraw::polyline
virtual void polyline(OdUInt32 nPoints, const OdGePoint3d *pPoints, LinesPrimType type, const OdTrVisVertexData &data)=0
OdTrVisMetafileBuilder::pushTransform
virtual void pushTransform(const OdGeMatrix3d &tf)=0
OdUInt8
unsigned char OdUInt8
Definition: OdPlatformSettings.h:759
OdTrVisMetafileBuilder::setGeometryMarker
virtual void setGeometryMarker(OdTrVisGeomType geomType)=0
OdTrVisMetafileBuilder::addMetafile
virtual void addMetafile(OdTrVisMetafileId mfId)=0
OdTrVisMetafileBuilder::popTransform
virtual void popTransform()=0
OdTrVisMetafileContainer
Definition: TrVisMetafileDef.h:50
OdTrVisGeometryDraw::LinesPrimType
LinesPrimType
Definition: TrVisMetafileBuilder.h:65
OdTrVisGeometryDraw::polyline
virtual void polyline(OdUInt32 nPoints, const OdGePoint3d *pPoints, LinesPrimType type)=0
type
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
OdTrVisMetafileBuilder::createObject
static OdSmartPtr< OdTrVisMetafileBuilder > createObject()
GeCurve3d.h
OdRxObject
Definition: RxObject.h:564
OdTrVisVertexData::arrayNormal2
OdGeVector3d * arrayNormal2
Definition: TrVisMetafileBuilder.h:55
OdTrVisGeometryDraw::indexedPolyline
virtual void indexedPolyline(OdUInt32 nPoints, const OdInt32 *pIndeces, LinesPrimType type, OdUInt8 nEnabledVertexData)=0
OdGeCurve2d
Definition: GeCurve2d.h:53
OdTrVisColorRGBA::ColorRep
ColorRep
Definition: TrVisDefs.h:161
OdTrVisGeometryDraw::deviation
virtual double deviation() const =0
OdTrVisMetafileBuilder::OdTrVisMetafileBuilder
OdTrVisMetafileBuilder()
Definition: TrVisMetafileBuilder.h:122
OdTrVisGeometryDraw::indexedPolypoint
virtual void indexedPolypoint(OdUInt32 nPoints, const OdInt32 *pIndeces, OdUInt8 nEnabledVertexData)=0
OdTrVisGeometryDraw::curve2d
virtual void curve2d(const OdGeCurve2d &curve)=0
OdTrVisVertexData::arrayColor
OdTrVisColorRGBA * arrayColor
Definition: TrVisMetafileBuilder.h:52
OdTrVisVertexData::arrayNormal1
OdGeVector3d * arrayNormal1
Definition: TrVisMetafileBuilder.h:54
TrVisMetafileDef.h
TD_PackPop.h
OdTrVisGeometryDraw::beginIndexedMode
virtual void beginIndexedMode(OdUInt32 nPoints, const OdGePoint3d *pPoints, const OdTrVisVertexData &data=OdTrVisVertexData())=0
OdTrVisMetafileBuilder::ecsGeometry
virtual OdTrVisGeometryDraw * ecsGeometry()=0
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdGeMatrix3d
Definition: GeMatrix3d.h:73
data
GLint GLenum GLsizei GLsizei GLint GLsizei const void * data
Definition: gles2_ext.h:110
OdTrVisMetafileBuilder::setColor
virtual void setColor(const OdTrVisColorRGBA &)=0
TrVisCamera.h
OdTrVisGeometryDraw::polygon
virtual void polygon(OdUInt32 nPoints, const OdGePoint3d *pPoints, const OdTrVisVertexData &data)=0
OdTrVisGeometryDraw::indexedTriangle
virtual void indexedTriangle(OdUInt32 nPoints, const OdInt32 *pIndeces, TrianglesPrimType type, OdUInt8 nEnabledVertexData)=0
OdTrVisGeometryDraw::kLineLoop
@ kLineLoop
Definition: TrVisMetafileBuilder.h:67
OdTrVisGeometryDraw::indexedPolygon
virtual void indexedPolygon(OdUInt32 nPoints, const OdInt32 *pIndeces, OdUInt8 nEnabledVertexData)=0
OdTrVisGeometryDraw::setDeviation
virtual void setDeviation(double dev)=0
OdTrVisGeometryDraw::polygon
virtual void polygon(OdUInt32 nPoints, const OdGePoint3d *pPoints)=0
OdTrVisGeometryDraw::indexedPolygon
virtual void indexedPolygon(OdUInt32 nPoints, const OdInt32 *pIndeces)=0
OdTrVisMetafileBuilder
Definition: TrVisMetafileBuilder.h:120
OdTrVisMetafileBuilder::~OdTrVisMetafileBuilder
virtual ~OdTrVisMetafileBuilder()
Definition: TrVisMetafileBuilder.h:124
OdTrVisVertexData::OdTrVisVertexData
OdTrVisVertexData()
OdSmartPtr
Definition: SmartPtr.h:58
OdGeVector3d::kZAxis
static GE_STATIC_EXPORT const OdGeVector3d kZAxis
Definition: GeVector3d.h:91
OdGePoint3d
Definition: GePoint3d.h:55
OdTrVisMetafileBuilder::beginMetafileBuilding
virtual void beginMetafileBuilding(OdTrVisMetafileWriter *pWriter, OdTrVisCamera *pCamera, OdTrVisViewportId refVp, OdTrVisOverlayId refOr=kTrVisMainOverlayId, bool b2dModel=false)=0
kVDNormal2
@ kVDNormal2
Definition: TrVisMetafileBuilder.h:42
OdTrVisGeometryDraw::OdTrVisGeometryDraw
OdTrVisGeometryDraw()
Definition: TrVisMetafileBuilder.h:62
OdTrVisGeometryDraw::triangle
virtual void triangle(OdUInt32 nPoints, const OdGePoint3d *pPoints, TrianglesPrimType type)=0
OdInt32
int OdInt32
Definition: OdPlatformSettings.h:782
OdTrVisEnabledVertexData
OdTrVisEnabledVertexData
Definition: TrVisMetafileBuilder.h:38
OdTrVisMetafileBuilder::wcsGeometry
virtual OdTrVisGeometryDraw * wcsGeometry()=0
OdTrVisVertexData::~OdTrVisVertexData
~OdTrVisVertexData()
OdTrVisGeometryDraw::triangle
virtual void triangle(OdUInt32 nPoints, const OdGePoint3d *pPoints, TrianglesPrimType type, const OdTrVisVertexData &data)=0
OdTrVisMetafileBuilder::writeAttribute
virtual void writeAttribute(OdTrVisAttribute attrName, bool bEnable=true)=0
kVDColor
@ kVDColor
Definition: TrVisMetafileBuilder.h:40
OdTrVisMetafileDef
Definition: TrVisMetafileDef.h:151
OdTrVisGeometryDraw::indexedPolypoint
virtual void indexedPolypoint(OdUInt32 nPoints, const OdInt32 *pIndeces)=0
OdTrVisGeometryDraw::arc
virtual void arc(const OdGePoint3d &center, double radius, const OdGeVector3d &normal=OdGeVector3d::kZAxis, OdUInt32 nSegs=16, const OdGeVector3d &start=OdGeVector3d::kYAxis, double angleFrom=0.0, double angleTo=Oda2PI)=0
OdTrVisGeometryDraw::kLines
@ kLines
Definition: TrVisMetafileBuilder.h:66
OdTrVisGeometryDraw::circle
virtual void circle(const OdGePoint3d &center, double radius, const OdGeVector3d &normal, OdUInt32 nSegs)=0
OdTrVisCamera
Definition: TrVisCamera.h:37
kVDNone
@ kVDNone
Definition: TrVisMetafileBuilder.h:39
OdTrVisGeometryDraw::kTriangleStrip
@ kTriangleStrip
Definition: TrVisMetafileBuilder.h:73
OdTrVisMetafileBuilder::setMaterial
virtual void setMaterial(OdTrVisMaterialId matId)=0
OdTrVisMetafileBuilder::beginMetafileBuilding
virtual void beginMetafileBuilding(OdTrVisCamera *pCamera, OdTrVisViewportId refVp, OdTrVisOverlayId refOr=kTrVisMainOverlayId, bool b2dModel=false)=0
TD_PackPush.h
OdTrVisGeometryDraw::polypoint
virtual void polypoint(OdUInt32 nPoints, const OdGePoint3d *pPoints)=0
OdTrVisMetafileBuilder::writeShading
virtual void writeShading(OdTrVisShading shadName, bool bEnable=true)=0
OdTrVisVertexData
Definition: TrVisMetafileBuilder.h:47
OdTrVisGeometryDraw::TrianglesPrimType
TrianglesPrimType
Definition: TrVisMetafileBuilder.h:71
OdTrVisGeometryDrawPtr
OdSmartPtr< OdTrVisGeometryDraw > OdTrVisGeometryDrawPtr
Definition: TrVisMetafileBuilder.h:117
kVDNormal1
@ kVDNormal1
Definition: TrVisMetafileBuilder.h:41
OdTrVisMetafileBuilder::scsGeometry
virtual OdTrVisGeometryDraw * scsGeometry()=0
OdTrVisGeometryDraw::indexedPolyline
virtual void indexedPolyline(OdUInt32 nPoints, const OdInt32 *pIndeces, LinesPrimType type)=0
OdTrVisShading
OdTrVisShading
Definition: TrVisMetafileStream.h:122
OdGeCurve3d
Definition: GeCurve3d.h:56
OdTrVisVertexData::arrayTexCoord
OdGePoint2d * arrayTexCoord
Definition: TrVisMetafileBuilder.h:56
OdTrVisGeometryDraw::endIndexedMode
virtual void endIndexedMode()=0
GeCurve2d.h
OdGeVector3d::kYAxis
static GE_STATIC_EXPORT const OdGeVector3d kYAxis
Definition: GeVector3d.h:90
OdTrVisMetafileBuilder::overlayId
virtual OdTrVisOverlayId overlayId() const =0
OdTrVisMetafileBuilder::rollback
virtual void rollback(bool bFin=true)=0
kVDTexCoord
@ kVDTexCoord
Definition: TrVisMetafileBuilder.h:43
kTrVisMainOverlayId
const OdTrVisId kTrVisMainOverlayId
Definition: TrVisDefs.h:122
OdTrVisGeometryDraw::indexedTriangle
virtual void indexedTriangle(OdUInt32 nPoints, const OdInt32 *pIndeces, TrianglesPrimType type)=0
OdTrVisGeometryDraw::kLineStrip
@ kLineStrip
Definition: TrVisMetafileBuilder.h:68
OdTrVisMetafileBuilder::viewportId
virtual OdTrVisViewportId viewportId() const =0
OdTrVisGeometryDraw::~OdTrVisGeometryDraw
virtual ~OdTrVisGeometryDraw()
Definition: TrVisMetafileBuilder.h:77
OdTrVisVertexData::colorRep
OdTrVisColorRGBA::ColorRep colorRep
Definition: TrVisMetafileBuilder.h:53
OdTrVisGeometryDraw
Definition: TrVisMetafileBuilder.h:60
OdTrVisAttribute
OdTrVisAttribute
Definition: TrVisMetafileStream.h:111
OdTrVisGeometryDraw::kTriangles
@ kTriangles
Definition: TrVisMetafileBuilder.h:72
OdTrVisGeometryDraw::curve3d
virtual void curve3d(const OdGeCurve3d &curve)=0
OdTrVisMetafileBuilder::endMetafileBuilding
virtual void endMetafileBuilding(OdTrVisMetafileDef &mfDef, bool bFin=false)=0
OdTrVisVertexData::OdTrVisVertexData
OdTrVisVertexData(OdTrVisColorRGBA *, OdTrVisColorRGBA::ColorRep, OdGeVector3d *, OdGeVector3d *, OdGePoint2d *)
OdTrVisGeomType
OdTrVisGeomType
Definition: TrVisMetafileStream.h:184
OdTrVisColorRGBA
Definition: TrVisDefs.h:141
OdUInt64
Definition: Int64.h:137
OdGePoint2d
Definition: GePoint2d.h:60