CFx SDK Documentation  2022 SP0
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
unsigned int OdUInt32
int OdInt32
unsigned char OdUInt8
#define Oda2PI
Definition: OdaCommon.h:57
const OdTrVisId kTrVisMainOverlayId
Definition: TrVisDefs.h:122
OdSmartPtr< OdTrVisGeometryDraw > OdTrVisGeometryDrawPtr
OdTrVisEnabledVertexData
@ kVDTexCoord
@ kVDNormal1
@ kVDNormal2
@ kVDColor
OdSmartPtr< OdTrVisMetafileBuilder > OdTrVisMetafileBuilderPtr
OdTrVisShading
OdTrVisAttribute
OdTrVisGeomType
static GE_STATIC_EXPORT const OdGeVector3d kZAxis
Definition: GeVector3d.h:91
static GE_STATIC_EXPORT const OdGeVector3d kYAxis
Definition: GeVector3d.h:90
virtual void curve2d(const OdGeCurve2d &curve)=0
virtual void indexedPolyline(OdUInt32 nPoints, const OdInt32 *pIndeces, LinesPrimType type)=0
virtual void indexedTriangle(OdUInt32 nPoints, const OdInt32 *pIndeces, TrianglesPrimType type)=0
virtual void indexedPolyline(OdUInt32 nPoints, const OdInt32 *pIndeces, LinesPrimType type, OdUInt8 nEnabledVertexData)=0
virtual void indexedPolypoint(OdUInt32 nPoints, const OdInt32 *pIndeces)=0
virtual void indexedPolygon(OdUInt32 nPoints, const OdInt32 *pIndeces)=0
virtual void setDeviation(double dev)=0
virtual void polyline(OdUInt32 nPoints, const OdGePoint3d *pPoints, LinesPrimType type)=0
virtual void polypoint(OdUInt32 nPoints, const OdGePoint3d *pPoints, const OdTrVisVertexData &data)=0
virtual double deviation() const =0
virtual void indexedPolygon(OdUInt32 nPoints, const OdInt32 *pIndeces, OdUInt8 nEnabledVertexData)=0
virtual void circle(const OdGePoint3d &center, double radius, const OdGeVector3d &normal, OdUInt32 nSegs)=0
virtual void polygon(OdUInt32 nPoints, const OdGePoint3d *pPoints, const OdTrVisVertexData &data)=0
virtual void polypoint(OdUInt32 nPoints, const OdGePoint3d *pPoints)=0
virtual void endIndexedMode()=0
virtual void polyline(OdUInt32 nPoints, const OdGePoint3d *pPoints, LinesPrimType type, const OdTrVisVertexData &data)=0
virtual void indexedTriangle(OdUInt32 nPoints, const OdInt32 *pIndeces, TrianglesPrimType type, OdUInt8 nEnabledVertexData)=0
virtual void indexedPolypoint(OdUInt32 nPoints, const OdInt32 *pIndeces, OdUInt8 nEnabledVertexData)=0
virtual void triangle(OdUInt32 nPoints, const OdGePoint3d *pPoints, TrianglesPrimType type, const OdTrVisVertexData &data)=0
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
virtual void polygon(OdUInt32 nPoints, const OdGePoint3d *pPoints)=0
virtual void curve3d(const OdGeCurve3d &curve)=0
virtual void triangle(OdUInt32 nPoints, const OdGePoint3d *pPoints, TrianglesPrimType type)=0
virtual void beginIndexedMode(OdUInt32 nPoints, const OdGePoint3d *pPoints, const OdTrVisVertexData &data=OdTrVisVertexData())=0
virtual void addMetafile(OdTrVisMetafileId mfId)=0
virtual void pushTransform(const OdGeMatrix3d &tf)=0
virtual OdTrVisGeometryDraw * ecsGeometry()=0
static OdSmartPtr< OdTrVisMetafileBuilder > createObject()
virtual void beginMetafileBuilding(OdTrVisMetafileWriter *pWriter, OdTrVisCamera *pCamera, OdTrVisViewportId refVp, OdTrVisOverlayId refOr=kTrVisMainOverlayId, bool b2dModel=false)=0
virtual void writeAttribute(OdTrVisAttribute attrName, bool bEnable=true)=0
virtual void endMetafileBuilding(OdTrVisMetafileDef &mfDef, bool bFin=false)=0
virtual void popTransform()=0
virtual void beginMetafileBuilding(OdTrVisCamera *pCamera, OdTrVisViewportId refVp, OdTrVisOverlayId refOr=kTrVisMainOverlayId, bool b2dModel=false)=0
virtual void setMaterial(OdTrVisMaterialId matId)=0
virtual OdTrVisViewportId viewportId() const =0
virtual void rollback(bool bFin=true)=0
virtual void setColor(const OdTrVisColorRGBA &)=0
virtual void writeShading(OdTrVisShading shadName, bool bEnable=true)=0
virtual OdTrVisOverlayId overlayId() const =0
virtual OdTrVisGeometryDraw * scsGeometry()=0
virtual OdTrVisGeometryDraw * wcsGeometry()=0
virtual void setGeometryMarker(OdTrVisGeomType geomType)=0
GLint GLenum GLsizei GLsizei GLint GLsizei const void * data
Definition: gles2_ext.h:110
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
OdTrVisVertexData(OdTrVisColorRGBA *, OdTrVisColorRGBA::ColorRep, OdGeVector3d *, OdGeVector3d *, OdGePoint2d *)
OdTrVisColorRGBA * arrayColor
OdGeVector3d * arrayNormal1
OdGeVector3d * arrayNormal2
OdTrVisColorRGBA::ColorRep colorRep
OdGePoint2d * arrayTexCoord