CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
TrVisMetafileBuilder.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// 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
34class OdTrVisMetafileWriter;
36class OdTrVisFont;
37class OdTrVisMetafilesPool;
38
40{
50 kVDDepth = 256
51};
52
54{
55protected:
58public:
61 const OdGeVector3d* = NULL, const OdGePoint2d* = NULL, const double* = NULL );
63
65 {
70 //
72 };
73
75 {
79 //
81 };
82
87 const double* arrayDepth;
88};
89
91{
92protected:
94public:
96 {
100 };
102 {
106 };
107
109
110 virtual void polypoint(OdUInt32 nPoints, const OdGePoint3d *pPoints) = 0;
111 virtual void polypoint(OdUInt32 nPoints, const OdGePoint3d *pPoints, const OdTrVisVertexData& data ) = 0;
112
113 virtual void polyline(OdUInt32 nPoints, const OdGePoint3d *pPoints, LinesPrimType type ) = 0;
114 virtual void polyline(OdUInt32 nPoints, const OdGePoint3d *pPoints, LinesPrimType type, const OdTrVisVertexData& data ) = 0;
115
116 virtual void triangle( OdUInt32 nPoints, const OdGePoint3d *pPoints, TrianglesPrimType type ) = 0;
117 virtual void triangle( OdUInt32 nPoints, const OdGePoint3d *pPoints, TrianglesPrimType type, const OdTrVisVertexData& data ) = 0;
118
119 virtual void polygon(OdUInt32 nPoints, const OdGePoint3d *pPoints) = 0;
120 virtual void polygon(OdUInt32 nPoints, const OdGePoint3d *pPoints, const OdTrVisVertexData& data) = 0;
121
122 virtual void arc(const OdGePoint3d &center, double radius, const OdGeVector3d &normal = OdGeVector3d::kZAxis, OdUInt32 nSegs = 16,
123 const OdGeVector3d &start = OdGeVector3d::kYAxis, double angleFrom = 0.0, double angleTo = Oda2PI) = 0;
124 virtual void circle( const OdGePoint3d &center, double radius, const OdGeVector3d &normal, OdUInt32 nSegs ) = 0;
125 virtual void curve2d( const OdGeCurve2d& curve ) = 0;
126 virtual void curve3d( const OdGeCurve3d& curve ) = 0;
127
128 virtual void setDeviation( double dev ) = 0;
129 virtual double deviation() const = 0;
130
131 //Indexed mode
132 virtual void beginIndexedMode(OdUInt32 nPoints, const OdGePoint3d* pPoints, const OdTrVisVertexData& data = OdTrVisVertexData() ) = 0;
133 virtual void endIndexedMode() = 0;
134
135 virtual void indexedPolypoint( OdUInt32 nPoints, const OdInt32* pIndeces ) = 0;
136 virtual void indexedPolypoint( OdUInt32 nPoints, const OdInt32* pIndeces, OdUInt8 nEnabledVertexData ) = 0;
137
138 virtual void indexedPolyline( OdUInt32 nPoints, const OdInt32* pIndeces, LinesPrimType type ) = 0;
139 virtual void indexedPolyline( OdUInt32 nPoints, const OdInt32* pIndeces, LinesPrimType type, OdUInt8 nEnabledVertexData ) = 0;
140
141 virtual void indexedTriangle( OdUInt32 nPoints, const OdInt32* pIndeces, TrianglesPrimType type ) = 0;
142 virtual void indexedTriangle( OdUInt32 nPoints, const OdInt32* pIndeces, TrianglesPrimType type, OdUInt8 nEnabledVertexData ) = 0;
143
144 virtual void indexedPolygon( OdUInt32 nPoints, const OdInt32* pIndeces ) = 0;
145 virtual void indexedPolygon( OdUInt32 nPoints, const OdInt32* pIndeces, OdUInt8 nEnabledVertexData ) = 0;
146
147 virtual void text( const OdGePoint3d& pt, const OdGeVector3d& direction, const OdGeVector3d& normal, const char* str, const OdTrVisFont* pFont ) = 0;
148};
149
151
153{
154 OdTrVisMetafilesPool *m_pMetafilesPool;
155 OdTrVisMetafileWriter *m_pWriter;
160
162 : m_pMetafilesPool(NULL)
163 , m_pWriter(NULL)
164 , m_pCamera(NULL)
168 { }
169 OdTrVisMetafileBuilderInit(OdTrVisMetafileWriter *pWriter, const OdTrVisCamera *pCamera, OdTrVisViewportId refVp,
170 OdTrVisOverlayId refOr = kTrVisMainOverlayId, OdTrVisMetafilesPool *pMfPool = NULL, bool b2dModel = false)
171 : m_pMetafilesPool(pMfPool)
172 , m_pWriter(pWriter)
173 , m_pCamera(pCamera)
174 , m_refVp(refVp)
175 , m_refOr(refOr)
176 , m_b2dModel(b2dModel)
177 { }
178
179 OdTrVisMetafileBuilderInit &setMetafilesPool(OdTrVisMetafilesPool *pMfPool) { m_pMetafilesPool = pMfPool; return *this; }
180 OdTrVisMetafilesPool *metafilesPool() const { return m_pMetafilesPool; }
181
182 OdTrVisMetafileBuilderInit &setMetafileWriter(OdTrVisMetafileWriter *pWriter) { m_pWriter = pWriter; return *this; }
183 OdTrVisMetafileWriter *metafileWriter() const { return m_pWriter; }
184
185 OdTrVisMetafileBuilderInit &setCamera(const OdTrVisCamera *pCamera) { m_pCamera = pCamera; return *this; }
186 const OdTrVisCamera *camera() const { return m_pCamera; }
187
189 { m_refVp = refVp; m_refOr = refOr; return *this; }
192
193 OdTrVisMetafileBuilderInit &set2dModel(bool b2dModel) { m_b2dModel = b2dModel; return *this; }
194 bool is2dModel() const { return m_b2dModel; }
195};
196
198{
199protected:
201public:
203
204 virtual void beginMetafileBuilding(const OdTrVisMetafileBuilderInit &mbInit) = 0;
205 virtual void endMetafileBuilding(OdTrVisMetafileDef &mfDef, bool bFin = false) = 0;
206
207 virtual OdTrVisMetafileWriter *underlyingMetafileWriter() const = 0;
208
209 virtual void rollback(bool bFin = true) = 0;
210
211 virtual void writeAttribute(OdTrVisAttribute attrName, bool bEnable = true) = 0;
212 virtual void writeShading( OdTrVisShading shadName, bool bEnable = true ) = 0;
213
214 // @@@TODO: reimplement this using TransformStack
215 virtual void pushTransform(const OdGeMatrix3d &tf) = 0;
216 virtual void popTransform() = 0;
217
218 virtual void addMetafile(OdTrVisMetafileId mfId) = 0;
219
220 virtual void setGeometryMarker(OdTrVisGeomType geomType) = 0;
221 virtual void setMaterial( OdTrVisMaterialId matId ) = 0;
222
226
227 virtual void setColor( const OdTrVisColorRGBA& ) = 0;
228 virtual void setLineweight( OdInt32 ) = 0;
229
230 // @@@TODO: eliminate this, but now ExClip uses it
231 virtual OdTrVisViewportId viewportId() const = 0;
232 virtual OdTrVisOverlayId overlayId() const = 0;
233
235};
236
238
239#include "TD_PackPop.h"
240
241#endif // ODTRVISMETAFILEBUILDER
false
Definition: DimVarDefs.h:165
unsigned int OdUInt32
int OdInt32
unsigned char OdUInt8
#define Oda2PI
Definition: OdaCommon.h:57
const OdTrVisId kTrVisMainOverlayId
Definition: TrVisDefs.h:140
const OdTrVisId kTrVisNullId
Definition: TrVisDefs.h:134
OdSmartPtr< OdTrVisGeometryDraw > OdTrVisGeometryDrawPtr
OdTrVisEnabledVertexData
@ kVDBumpNormalT
@ kVDNormal1
@ kVDNormal2
@ kVDColor
@ kVDDepth
@ kVDBumpMapTexCoord
@ kVDOpacityTexCoord
@ kVDDiffuseTexCoord
@ kVDBumpNormalB
OdSmartPtr< OdTrVisMetafileBuilder > OdTrVisMetafileBuilderPtr
OdTrVisShading
OdTrVisAttribute
OdTrVisGeomType
static GE_STATIC_EXPORT const OdGeVector3d kZAxis
Definition: GeVector3d.h:103
static GE_STATIC_EXPORT const OdGeVector3d kYAxis
Definition: GeVector3d.h:102
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 text(const OdGePoint3d &pt, const OdGeVector3d &direction, const OdGeVector3d &normal, const char *str, const OdTrVisFont *pFont)=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
static OdSmartPtr< OdTrVisMetafileBuilder > createObject()
virtual void writeAttribute(OdTrVisAttribute attrName, bool bEnable=true)=0
virtual void setLineweight(OdInt32)=0
virtual void endMetafileBuilding(OdTrVisMetafileDef &mfDef, bool bFin=false)=0
virtual OdTrVisMetafileWriter * underlyingMetafileWriter() const =0
virtual OdTrVisGeometryDraw * wcsGeometry()=0
virtual void popTransform()=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 * ecsGeometry()=0
virtual void beginMetafileBuilding(const OdTrVisMetafileBuilderInit &mbInit)=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
OdTrVisMetafileBuilderInit & set2dModel(bool b2dModel)
OdTrVisMetafileWriter * m_pWriter
const OdTrVisCamera * m_pCamera
OdTrVisMetafilesPool * metafilesPool() const
OdTrVisMetafileBuilderInit(OdTrVisMetafileWriter *pWriter, const OdTrVisCamera *pCamera, OdTrVisViewportId refVp, OdTrVisOverlayId refOr=kTrVisMainOverlayId, OdTrVisMetafilesPool *pMfPool=NULL, bool b2dModel=false)
OdTrVisOverlayId refOverlayId() const
OdTrVisViewportId refViewportId() const
OdTrVisMetafilesPool * m_pMetafilesPool
OdTrVisMetafileBuilderInit & setCamera(const OdTrVisCamera *pCamera)
const OdTrVisCamera * camera() const
OdTrVisMetafileWriter * metafileWriter() const
OdTrVisMetafileBuilderInit & setRefIds(OdTrVisViewportId refVp, OdTrVisOverlayId refOr=kTrVisMainOverlayId)
OdTrVisMetafileBuilderInit & setMetafilesPool(OdTrVisMetafilesPool *pMfPool)
OdTrVisMetafileBuilderInit & setMetafileWriter(OdTrVisMetafileWriter *pWriter)
const OdGeVector3d * arrayNormal[kNumNormalArrays]
const double * arrayDepth
OdTrVisVertexData(const OdTrVisColorRGBA *, OdTrVisColorRGBA::ColorRep=OdTrVisColorRGBA::kRGBA, const OdGeVector3d *=NULL, const OdGeVector3d *=NULL, const OdGePoint2d *=NULL, const double *=NULL)
const OdGePoint2d * arrayTexCoord[kNumTextureCoordArrays]
void clearTexCoordArrays()
void clearNormalArrays()
const OdTrVisColorRGBA * arrayColor
OdTrVisColorRGBA::ColorRep colorRep