CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
FMMdlBody.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 __FMMDL_BODY_H__
25#define __FMMDL_BODY_H__
26
27#include "Modeler/FMMdlBase.h"
28#include "FMContour3D.h"
29#include "FMProfile3D.h"
30
31class OdGeCircArc3d;
32namespace GeMesh { class OdGeTrMesh; }
33
34namespace FacetModeler
35{
40 {
41 public:
46
55 Body(const Body& B);
56
66 Body& operator = (const Body& B);
67
74 bool operator == (const Body& aBody) const;
75
82 bool operator != (const Body& aBody) const;
83
87 void clear();
88
94 Body clone() const;
95
105 Body combine(Body& rAnother);
106
117 void decomposeIntoLumps(std::vector<Body>& aLumps);
118
124 void transform(const OdGeMatrix3d& mMatrix);
125
129 void negate();
130
135
140
147
148
153
160
172 bool checkInternalConsistence(OdString* pFirstErrorDetected = NULL) const;
173
179 bool hasCoincidentEdges() const;
180
187
193 bool isNull() const;
194
200 bool isClosed() const;
201
210 void splitFace(Face* pFace,
211 const OdGePlane& pPlane,
212 std::vector<Face*>* pNewOuter = NULL,
213 std::vector<Face*>* pNewInner = NULL);
214
216 // Tags and flags
218
224 void clearVertexTags(TagType clearValue = 0);
225
231 void clearSurfaceTags(TagType clearValue = 0);
232
238 void clearEdgeTags(TagType clearValue = 0);
239
245 void clearFaceTags(TagType clearValue = 0);
246
252 void clearFaceFlags(OdUInt32 clearValue = 0);
253
259 inline void clearBodyTags(TagType clearValue = 0) { setTag(clearValue); }
260
266 TagType tag() const;
267
273 void setTag(TagType iTag);
274
276 // Geometric properties
278
285
291 double volume() const;
292
294 // Intersections
296
304 void slice(const OdGePlane& rCutter,
305 Profile3D& rResult, bool bIncludeBoundary = true) const;
306
313 void slice(const OdGePlane& rCutter, Body& result, TagType tagSection = 0) const;
314
326 bool intersectLine(const OdGeLinearEnt3d& gLine,
327 std::vector< OdGePoint3d >& aPoints, bool bSortResults = false) const;
328
330 // Primitives
332
341 static Body box(const OdGePoint3d& ptOrigin,
342 const OdGeVector3d& vSizes);
343
353 static Body pyramid(const Profile2D& rBase,
354 const OdGePoint3d& ptApex,
355 const DeviationParams& deviation = FMGeGbl::gDefDev);
356
366 static Body extrusion(const Profile2D& rBase,
367 const OdGeVector3d& vDir,
368 const DeviationParams& deviation = FMGeGbl::gDefDev);
369
379 static Body extrusion(const Profile2D& rBase,
380 const Contour3D& rPath,
381 const DeviationParams& deviation = FMGeGbl::gDefDev);
382
393 static Body extrusion(const Profile2D& rBase,
394 const OdGePoint3dArray& rPath,
395 const OdGeVector3d& vNormal,
396 const DeviationParams& devDeviation = FMGeGbl::gDefDev);
397
412 static Body extrusion(const Profile2D& rBase,
413 const OdGeMatrix3d& mBasePlane,
414 const OdGeVector3d& vDir,
415 const DeviationParams& deviation = FMGeGbl::gDefDev);
416
426 static Body revolution(const Profile2D& rBase,
427 double dRadius, double dHeight,
428 const DeviationParams& deviation = FMGeGbl::gDefDev);
429
440 const Profile2D& base,
441 const OdGeCircArc3d& revAxisAndAngles,
442 const DeviationParams& deviation = FMGeGbl::gDefDev,
443 const OdGeMatrix2d* pBaseTransform = NULL);
444
462 const Profile2D& base,
463 const OdGeVector3d& revAxis,
464 const OdGePoint3d& axisPosition,
465 double startAng,
466 double endAng,
467 const DeviationParams& deviation = FMGeGbl::gDefDev);
468
479 static Body boolOper(BooleanOperation eOperation,
480 Body& rOperandA, Body& rOperandB, bool bOptimization = false);
481
505 const std::vector<OdGePoint3d>& aVertices,
506 const std::vector<OdInt32>& aFaceData,
507 const std::vector<OdUInt32>* aFaceFlags = NULL,
508 const std::vector<OdUInt32>* aEdgeFlags = NULL,
509 const std::vector<OdUInt32>* aVertexFlags = NULL,
510 const std::vector<OdUInt32>* pFaceColors = NULL,
511 const std::vector<OdUInt32>* pEdgeColors = NULL,
512 const std::vector<OdGePoint2d>* pMappingCoords = NULL
513 );
514
521
523 // Working with topological entities
525
531 void setColor(OdUInt32 iColor);
532
541 void addFace(Face* pFace);
542
551 void removeFace(Face* pFace);
552
561 void deleteFace(Face* pFace);
562
568 void addSurface(Surface* pSurface);
569
575 void addVertex(Vertex* pVertex);
576
584
591 Face* addFace(Surface* pSurface = NULL);
592
599
606
616
623
630
636 Face* faceList() const;
637
644
651
657 void setVertexList(Vertex* pList);
658
664 void setFaceList(Face* pList);
665
672
678
688
698
708
711
716
728 void simplify(double param);
729
730#if 0
731 public:
732 void testCheckUnusedSurfaceData();
733#endif
734
735 protected:
741 explicit Body(class BodyImpl* pImpl);
742
743 private:
744
745 BodyImpl* m_pImpl; // Implementation object pointer.
746
747 //DOM-IGNORE-BEGIN
748 friend class Vertex;
749 friend class Face;
750 friend class Surface;
751 friend class BodyImpl;
752 friend class BodyCustom;
753 friend class BodyInternalConsistencyRestorer;
754 //DOM-IGNORE-END
755 };
756
768 FMGEOMETRY_API void MarkShadedSurfaces(Body& aBody, double angleTol, bool bDetectSharpEdges = false);
769
776
783 void MergeShadedSurfaces(Body& aBody, const OdArray<std::set<Surface*> >& shadedMergeData);
784
786 const OdGeMatrix3d& mBasePlane,
787 const OdGeVector3d& vDir,
788 const DeviationParams& devDeviation = FMGeGbl::gDefDev );
789
791 const OdGeVector3d& revAxis,
792 const OdGePoint3d& axisPosition,
793 double startAng,
794 double endAng,
795 const DeviationParams& deviation = FMGeGbl::gDefDev );
796
797}
798
799#endif //__FMMDL_BODY_H__
#define FMGEOMETRY_API
#define FMGEOMETRY_API_STATIC
bool operator!=(T left, const OdGiVariant::EnumType right)
Definition: GiVariant.h:403
bool operator==(T left, const OdGiVariant::EnumType right)
Definition: GiVariant.h:397
unsigned int OdUInt32
static Body pyramid(const Profile2D &rBase, const OdGePoint3d &ptApex, const DeviationParams &deviation=FMGeGbl::gDefDev)
static Body extrusion(const Profile2D &rBase, const Contour3D &rPath, const DeviationParams &deviation=FMGeGbl::gDefDev)
void setVertexList(Vertex *pList)
void removeFace(Face *pFace)
void deleteUnusedSurfaces()
bool checkInternalConsistence(OdString *pFirstErrorDetected=NULL) const
void setSurfaceCount(OdUInt32 count)
bool mergeCoincidentVertices()
Surface * surfaceList() const
void setTag(TagType iTag)
OdUInt32 surfaceCount() const
static Body extrusion(const Profile2D &rBase, const OdGeVector3d &vDir, const DeviationParams &deviation=FMGeGbl::gDefDev)
static Body createFromMesh(const std::vector< OdGePoint3d > &aVertices, const std::vector< OdInt32 > &aFaceData, const std::vector< OdUInt32 > *aFaceFlags=NULL, const std::vector< OdUInt32 > *aEdgeFlags=NULL, const std::vector< OdUInt32 > *aVertexFlags=NULL, const std::vector< OdUInt32 > *pFaceColors=NULL, const std::vector< OdUInt32 > *pEdgeColors=NULL, const std::vector< OdGePoint2d > *pMappingCoords=NULL)
void setVertexCount(OdUInt32 count)
void addSurface(Surface *pSurface)
void slice(const OdGePlane &rCutter, Profile3D &rResult, bool bIncludeBoundary=true) const
void deleteUnusedVertices()
static Body box(const OdGePoint3d &ptOrigin, const OdGeVector3d &vSizes)
Body combine(Body &rAnother)
void clearFaceFlags(OdUInt32 clearValue=0)
double volume() const
static Body boolOper(BooleanOperation eOperation, Body &rOperandA, Body &rOperandB, bool bOptimization=false)
void regeneratePairEdges()
OdUInt32 faceCount() const
void splitFace(Face *pFace, const OdGePlane &pPlane, std::vector< Face * > *pNewOuter=NULL, std::vector< Face * > *pNewInner=NULL)
bool intersectLine(const OdGeLinearEnt3d &gLine, std::vector< OdGePoint3d > &aPoints, bool bSortResults=false) const
void transform(const OdGeMatrix3d &mMatrix)
static Body revolution(const Profile2D &rBase, double dRadius, double dHeight, const DeviationParams &deviation=FMGeGbl::gDefDev)
void clearBodyTags(TagType clearValue=0)
Definition: FMMdlBody.h:259
void slice(const OdGePlane &rCutter, Body &result, TagType tagSection=0) const
void setFaceList(Face *pList)
OdUInt32 cachedEdgesCount() const
Face * faceList() const
void addFace(Face *pFace)
static Body extrusion(const Profile2D &rBase, const OdGeMatrix3d &mBasePlane, const OdGeVector3d &vDir, const DeviationParams &deviation=FMGeGbl::gDefDev)
Vertex * vertexList() const
void clearEdgeTags(TagType clearValue=0)
Vertex * addVertex(const OdGePoint3d &pt)
bool hasCoincidentEdges() const
void setSurfaceList(Surface *pList)
void setColor(OdUInt32 iColor)
bool hasCoincidentVertices() const
OdUInt32 vertexCount() const
void mergeCoplanarEntities()
static Body revolution(const Profile2D &base, const OdGeVector3d &revAxis, const OdGePoint3d &axisPosition, double startAng, double endAng, const DeviationParams &deviation=FMGeGbl::gDefDev)
void setFaceCount(OdUInt32 count)
bool isClosed() const
void clearSurfaceTags(TagType clearValue=0)
bool containsNonManifoldEdges() const
void clearFaceTags(TagType clearValue=0)
void generateMesh(GeMesh::OdGeTrMesh &mesh) const
OdGeExtents3d interval() const
static Body extrusion(const Profile2D &rBase, const OdGePoint3dArray &rPath, const OdGeVector3d &vNormal, const DeviationParams &devDeviation=FMGeGbl::gDefDev)
Body(const Body &B)
OdUInt32 countEdges() const
static Body revolution(const Profile2D &base, const OdGeCircArc3d &revAxisAndAngles, const DeviationParams &deviation=FMGeGbl::gDefDev, const OdGeMatrix2d *pBaseTransform=NULL)
void simplify(double param)
void decomposeIntoLumps(std::vector< Body > &aLumps)
void addVertex(Vertex *pVertex)
void clearVertexTags(TagType clearValue=0)
TagType tag() const
void deleteFace(Face *pFace)
static FMGEOMETRY_API_STATIC const Body kEmpty
Definition: FMMdlBody.h:710
Body clone() const
Face * addFace(Surface *pSurface=NULL)
bool isNull() const
Body(class BodyImpl *pImpl)
GLsizei GLsizei * count
Definition: gles2_ext.h:276
FMGEOMETRY_API void MarkShadedSurfaces(Body &aBody, double angleTol, bool bDetectSharpEdges=false)
FMGEOMETRY_API Body extrusion(const Profile2D &rBase, const OdGeMatrix3d &mBasePlane, const OdGeVector3d &vDir, const DeviationParams &devDeviation=FMGeGbl::gDefDev)
void MergeShadedSurfaces(Body &aBody, const OdArray< std::set< Surface * > > &shadedMergeData)
FMGEOMETRY_API void ClearShadedSurfaces(Body &aBody)
ptrdiff_t TagType
Definition: FMMdlBase.h:46
FMGEOMETRY_API Body revolution(const Profile2D &base, const OdGeVector3d &revAxis, const OdGePoint3d &axisPosition, double startAng, double endAng, const DeviationParams &deviation=FMGeGbl::gDefDev)
static FMGEOMETRY_API_STATIC DeviationParams gDefDev
Definition: FMGeometry.h:161