CFx SDK Documentation  2022 SP0
DbSubDMesh.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 
25 
26 
27 #ifndef _OD_DB_SUBDMESH
28 #define _OD_DB_SUBDMESH
29 
30 #include "TD_PackPush.h"
31 
32 #include "DbEntity.h"
33 #include "DoubleArray.h"
34 #include "DbSurface.h"
35 #include "Db3dSolid.h"
36 #include "CmEntityColorArray.h"
37 
38 #include "Int32Array.h"
39 #include "Gi/GiGeometry.h"
40 
41 class OdDbSurface;
42 class OdDb3dSolid;
43 
53 {
54 public:
56 
58 
59  virtual bool subWorldDraw(
60  OdGiWorldDraw* pWd) const;
61 
62  virtual OdUInt32 subSetAttributes(OdGiDrawableTraits* pTraits) const;
63 
65  OdDbObjectId& replaceId,
66  bool& exchangeXData);
67 
69  OdDbDwgFiler* pFiler);
70 
71  virtual void dwgOutFields(
72  OdDbDwgFiler* pFiler) const;
73 
75  OdDbDxfFiler* pFiler);
76 
77  virtual void dxfOutFields(
78  OdDbDxfFiler* pFiler) const;
79 
81  const OdGeMatrix3d& xfm);
82 
84  OdGeExtents3d& extents) const;
85 
87  OdRxObjectPtrArray& entitySet) const;
88 
89  OdResult setSubDMesh (const OdGePoint3dArray& vertexArray,
90  const OdInt32Array& faceArray,
91  OdInt32 subDLevel);
92 
93  OdResult setSphere (double radius,
94  OdInt32 divAxis,
95  OdInt32 divHeight,
96  OdInt32 subDLevel);
97 
98  OdResult setCylinder (double majorRadius,
99  double minorRadius,
100  double height,
101  OdInt32 divAxis,
102  OdInt32 divHeight,
103  OdInt32 divCap,
104  OdInt32 subDLevel);
105 
106  OdResult setCone (double majorRadius,
107  double minorRadius,
108  double height,
109  OdInt32 divAxis,
110  OdInt32 divHeight,
111  OdInt32 divCap,
112  double radiusRatio,
113  OdInt32 subDLevel);
114 
115  OdResult setTorus (double majorRadius,
116  OdInt32 divSection,
117  OdInt32 divSweepPath,
118  double sectionRadiusRatio,
119  double sectionRotate,
120  OdInt32 subDLevel);
121 
122  OdResult setBox (double xLen,
123  double yLen,
124  double zLen,
125  OdInt32 divX,
126  OdInt32 divY,
127  OdInt32 divZ,
128  OdInt32 subDLevel);
129 
130  OdResult setWedge (double xLen,
131  double yLen,
132  double zLen,
133  OdInt32 divLength,
134  OdInt32 divWidth,
135  OdInt32 divHeight,
136  OdInt32 divSlope,
137  OdInt32 divCap,
138  OdInt32 subDLevel);
139 
140  OdResult setPyramid (double radius,
141  double height,
142  OdInt32 divLength,
143  OdInt32 divHeight,
144  OdInt32 divCap,
145  OdInt32 nSides,
146  double radiusRatio,
147  OdInt32 subDLevel);
148 
153  OdResult subdLevel (OdInt32& result) const;
154 
155  OdResult splitFace (const OdDbSubentId& subentFaceId,
156  const OdDbSubentId& subent0,
157  const OdGePoint3d& point0,
158  const OdDbSubentId& subent1,
159  const OdGePoint3d& point1);
160 
162  double length,
163  const OdGeVector3d& dir,
164  double taper);
165 
167  const OdGePoint3dArray& alongPath,
168  double taper);
169 
170  OdResult isWatertight (bool& result) const;
171 
172  OdResult numOfFaces (OdInt32& result) const;
174  OdResult numOfSubDividedFacesAt (const OdDbFullSubentPathArray& subentPaths, OdInt32& result) const;
175  OdResult numOfVertices (OdInt32& result) const;
177  OdResult numOfEdges (OdInt32& result) const;
178 
179  OdResult getVertices (OdGePoint3dArray& vertexArray) const;
180  OdResult getEdgeArray (OdInt32Array& edgeArray) const;
181  OdResult getFaceArray (OdInt32Array& faceArray) const;
183 
185  //FELIX_CHANGE_BEGIN
187  //FELIX_CHANGE_END
190  //FELIX_CHANGE_BEGIN
192  OdInt32Array& edgeArray,
193  OdInt32Array& faceArray ) const;
195  OdInt32Array& edgeArray,
196  OdInt32Array& faceArray,
197  OdGeDoubleArray& newCreases,
198  OdUInt32Array& edgeData ) const;
199  //FELIX_CHANGE_END
200 
201  OdResult getVertexAt (OdInt32 nIndex, OdGePoint3d& vertex) const;
202  OdResult setVertexAt (OdInt32 nIndex, const OdGePoint3d& vertex);
203  OdResult getVertexAt (const OdDbSubentId& id, OdGePoint3d& vertex) const;
204  OdResult setVertexAt (const OdDbSubentId& id, const OdGePoint3d& vertex);
205 
208 
209  OdResult setCrease (double creaseVal);
210  OdResult setCrease (const OdDbFullSubentPathArray& subentPaths, double creaseVal);
211  OdResult getCrease (const OdDbFullSubentPathArray& subentPaths, OdDoubleArray& result) const;
212  OdResult getCrease (const OdDbSubentId& id, double& result) const;
213 
216  OdDbFullSubentPathArray& subentPaths) const;
217 
220  OdDbFullSubentPathArray& subentPaths) const;
221 
222  OdResult convertToSurface (bool bConvertAsSmooth, const OdDbSubentId& id, OdDbSurfacePtr& pSurface) const;
223  OdResult convertToSurface (bool bConvertAsSmooth, bool optimize, OdDbSurfacePtr& pSurface) const;
224  OdResult convertToSolid (bool bConvertAsSmooth, bool optimize, OdDb3dSolidPtr& pSolid) const;
225 
226  OdResult getSubentColor (const OdDbSubentId& id, OdCmColor& color) const;
227  OdResult setSubentColor (const OdDbSubentId& id, const OdCmColor& color);
228  OdResult getSubentMaterial (const OdDbSubentId& id, OdDbObjectId& material) const;
229  OdResult setSubentMaterial (const OdDbSubentId& id, const OdDbObjectId& material);
232 
233  OdResult getFacePlane (const OdDbSubentId& id, OdGePlane& facePlane) const;
234 
235  OdResult computeVolume (double &retVolume) const;
236  OdResult computeSurfaceArea (double &retSurfArea) const;
237 
238 
239 
246 
248  OdGsMarker gsMark,
249  const OdGePoint3d& ,
250  const OdGeMatrix3d& ,
251  OdDbFullSubentPathArray& subentPaths,
252  const OdDbObjectIdArray* pEntAndInsertStack ) const;
254  OdGsMarkerArray& gsMarkers) const;
255 };
256 
261 
267 {
276 
278  : faceterDevSurface(0.)
279  , faceterDevNormal(0.)
280  , faceterGridRatio(0.)
282  , faceterMaxGrid(0)
283  , faceterMinUGrid(0)
284  , faceterMinVGrid(0)
285  , faceterMeshType(0) {}
286 };
287 
289 
291  const OdDbFaceterSettings *faceter,
292  OdGePoint3dArray& vertexArray,
293  OdInt32Array& faceArray,
294  OdGiFaceData*& faceData);
295 
296 
297 #include "TD_PackPop.h"
298 
299 #endif
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
TOOLKIT_EXPORT OdResult oddbGetObjectMesh(OdDbObject *pObj, const OdDbFaceterSettings *faceter, OdGePoint3dArray &vertexArray, OdInt32Array &faceArray, OdGiFaceData *&faceData)
OdSmartPtr< OdDbSubDMesh > OdDbSubDMeshPtr
Definition: DbSubDMesh.h:260
ptrdiff_t OdGsMarker
unsigned int OdUInt32
short OdInt16
unsigned short OdUInt16
int OdInt32
OdResult
Definition: OdResult.h:29
OdResult getSubentPath(OdInt32 nIndex, OdDb::SubentType type, OdDbFullSubentPathArray &subentPaths) const
OdResult setSphere(double radius, OdInt32 divAxis, OdInt32 divHeight, OdInt32 subDLevel)
OdResult getSubDividedVertices(OdGePoint3dArray &vertexArray) const
OdResult getCrease(const OdDbSubentId &id, double &result) const
OdResult setVertexAt(const OdDbSubentId &id, const OdGePoint3d &vertex)
OdResult subGetGeomExtents(OdGeExtents3d &extents) const
OdResult getSubDividedNormalArray(OdGeVector3dArray &normalArray) const
OdResult getVertices(OdGePoint3dArray &vertexArray) const
OdResult numOfEdges(OdInt32 &result) const
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
virtual OdResult subTransformBy(const OdGeMatrix3d &xfm)
virtual bool subWorldDraw(OdGiWorldDraw *pWd) const
OdResult getSubDividedEdgeArray(OdInt32Array &edgeArray) const
OdResult numOfFaces(OdInt32 &result) const
OdResult subdRefine()
OdResult setSubDMesh(const OdGePoint3dArray &vertexArray, const OdInt32Array &faceArray, OdInt32 subDLevel)
OdResult getSubentMaterial(const OdDbSubentId &id, OdDbObjectId &material) const
OdResult getSubDividedVertexAt(OdInt32 nIndex, OdGePoint3d &vertex) const
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
OdResult getVertexColorArray(OdCmEntityColorArray &arrColor)
virtual OdResult subExplode(OdRxObjectPtrArray &entitySet) const
OdResult setCrease(double creaseVal)
OdResult extrudeFaces(const OdDbFullSubentPathArray &subentPaths, double length, const OdGeVector3d &dir, double taper)
OdResult setCrease(const OdDbFullSubentPathArray &subentPaths, double creaseVal)
OdResult getVertexAt(OdInt32 nIndex, OdGePoint3d &vertex) const
OdResult splitFace(const OdDbSubentId &subentFaceId, const OdDbSubentId &subent0, const OdGePoint3d &point0, const OdDbSubentId &subent1, const OdGePoint3d &point1)
OdResult subdDivideDown()
OdResult getSubentColor(const OdDbSubentId &id, OdCmColor &color) const
OdResult numOfVertices(OdInt32 &result) const
OdResult getVertexNormalArray(OdGeVector3dArray &arrNorm)
OdResult setVertexTextureArray(OdGePoint3dArray &arrPts)
OdResult getEdgeArray(OdInt32Array &edgeArray) const
OdResult getAdjacentSubentPath(const OdDbFullSubentPath &path, OdDb::SubentType type, OdDbFullSubentPathArray &subentPaths) const
OdResult setPyramid(double radius, double height, OdInt32 divLength, OdInt32 divHeight, OdInt32 divCap, OdInt32 nSides, double radiusRatio, OdInt32 subDLevel)
OdResult extrudeFaces(const OdDbFullSubentPathArray &subentPaths, const OdGePoint3dArray &alongPath, double taper)
OdResult setSubentMaterial(const OdDbSubentId &id, const OdDbObjectId &material)
OdResult getNormalArray(OdGeVector3dArray &normalArray) const
OdResult setVertexAt(OdInt32 nIndex, const OdGePoint3d &vertex)
OdResult getVertexAt(const OdDbSubentId &id, OdGePoint3d &vertex) const
OdResult getFaceArray(OdInt32Array &faceArray) const
OdResult setVertexNormalArray(OdGeVector3dArray &arrNorm)
OdResult subGetSubentPathsAtGsMarker(OdDb::SubentType type, OdGsMarker gsMark, const OdGePoint3d &, const OdGeMatrix3d &, OdDbFullSubentPathArray &subentPaths, const OdDbObjectIdArray *pEntAndInsertStack) const
OdResult setCone(double majorRadius, double minorRadius, double height, OdInt32 divAxis, OdInt32 divHeight, OdInt32 divCap, double radiusRatio, OdInt32 subDLevel)
OdResult convertToSurface(bool bConvertAsSmooth, bool optimize, OdDbSurfacePtr &pSurface) const
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
OdResult getSubentMaterialMapper(const OdDbSubentId &id, OdGiMapper &mapper) const
OdResult convertToSurface(bool bConvertAsSmooth, const OdDbSubentId &id, OdDbSurfacePtr &pSurface) const
OdResult setBox(double xLen, double yLen, double zLen, OdInt32 divX, OdInt32 divY, OdInt32 divZ, OdInt32 subDLevel)
OdResult setSubentColor(const OdDbSubentId &id, const OdCmColor &color)
OdResult setVertexColorArray(OdCmEntityColorArray &arrColor)
OdResult numOfSubDividedFacesAt(const OdDbFullSubentPathArray &subentPaths, OdInt32 &result) const
OdResult numOfSubDividedVertices(OdInt32 &result) const
OdResult setTorus(double majorRadius, OdInt32 divSection, OdInt32 divSweepPath, double sectionRadiusRatio, double sectionRotate, OdInt32 subDLevel)
OdResult subGetGsMarkersAtSubentPath(const OdDbFullSubentPath &subPath, OdGsMarkerArray &gsMarkers) const
OdResult getCrease(const OdDbFullSubentPathArray &subentPaths, OdDoubleArray &result) const
OdResult setCylinder(double majorRadius, double minorRadius, double height, OdInt32 divAxis, OdInt32 divHeight, OdInt32 divCap, OdInt32 subDLevel)
OdResult setSubentMaterialMapper(const OdDbSubentId &id, const OdGiMapper &mapper)
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
OdResult subdDivideUp()
OdResult computeSurfaceArea(double &retSurfArea) const
OdResult getSubDividedFaceArray(OdInt32Array &faceArray) const
virtual OdDbObjectPtr decomposeForSave(OdDb::DwgVersion ver, OdDbObjectId &replaceId, bool &exchangeXData)
OdResult getSubDividedVertexAt(const OdDbSubentId &id, OdGePoint3d &vertex) const
OdResult setWedge(double xLen, double yLen, double zLen, OdInt32 divLength, OdInt32 divWidth, OdInt32 divHeight, OdInt32 divSlope, OdInt32 divCap, OdInt32 subDLevel)
ODDB_DECLARE_MEMBERS(OdDbSubDMesh)
OdResult getVertexTextureArray(OdGePoint3dArray &arrPts)
OdResult getFacePlane(const OdDbSubentId &id, OdGePlane &facePlane) const
OdResult computeVolume(double &retVolume) const
OdResult isWatertight(bool &result) const
OdResult convertToSolid(bool bConvertAsSmooth, bool optimize, OdDb3dSolidPtr &pSolid) const
OdResult getSubDividedData(OdGePoint3dArray &vertexArray, OdInt32Array &edgeArray, OdInt32Array &faceArray) const
OdResult subdRefine(const OdDbFullSubentPathArray &subentPaths)
OdResult numOfSubDividedFaces(OdInt32 &result) const
virtual OdUInt32 subSetAttributes(OdGiDrawableTraits *pTraits) const
OdResult getSubDividedData(OdGePoint3dArray &vertexArray, OdInt32Array &edgeArray, OdInt32Array &faceArray, OdGeDoubleArray &newCreases, OdUInt32Array &edgeData) const
OdResult subdLevel(OdInt32 &result) const
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
GLuint GLsizei GLsizei * length
Definition: gles2_ext.h:274
GLint GLenum GLsizei GLsizei height
Definition: gles2_ext.h:110
DwgVersion
Definition: OdaDefs.h:46
OdUInt16 faceterMinVGrid
Definition: DbSubDMesh.h:274
OdUInt16 faceterMaxGrid
Definition: DbSubDMesh.h:272
OdInt16 faceterMeshType
Definition: DbSubDMesh.h:275
OdUInt16 faceterMinUGrid
Definition: DbSubDMesh.h:273
double faceterMaxEdgeLength
Definition: DbSubDMesh.h:271
double faceterDevSurface
Definition: DbSubDMesh.h:268