CFx SDK Documentation  2023 SP0
AECMesh.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 #ifndef __AECMESH_H__
25 #define __AECMESH_H__
26 
27 #include "FMGeometry.h"
28 #include "AECMeshFace.h"
29 #include <Ge/GePoint3d.h>
30 #include <Ge/GeExtents3d.h>
31 
35 namespace AECGe
36 {
37 
39 // Obsolete class. Since Teighaź Architecture 2.4.0 Body is used instead.
40 class AECGEOMETRY_API Mesh
41 {
42  // Low level construction and data access.
43  public:
47  Mesh();
48 
53 
57  const OdGePoint3d& GetVertex( OdUInt32 iIndex ) const;
58 
69  void SetVertex( OdUInt32 iIndex, const OdGePoint3d& ptVertex );
70 
79 
84 
88  const MeshFace& GetFace( OdUInt32 iIndex ) const;
90 
107  OdUInt32 AddVertex( const OdGePoint3d& ptVertex, bool bUnique = false );
108 
118  OdUInt32 AddFace( const MeshFace& face,
119  bool bCheckPlane = true,
120  bool* bSuccess = 0 );
121 
128  void AddFace( const IndexList& face,
129  bool* bSuccess = 0 );
130 
138  void SwapFace( OdUInt32 iIndex, MeshFace& face );
139 
144  void AddTriangles( const IndexList& triangles );
145 
149  bool IsEmpty() const;
150 
154  void Clear();
155 
159  void ClearFaces();
160 
161  // Operations.
162  public:
166  void GetExtents( OdGeExtents3d& extents ) const;
167 
171  double GetVolume() const;
172 
181  void Transform( const OdGeMatrix3d& mMatrix );
182 
190  void Append( const Mesh& mMesh );
191 
195  void Invert();
196 
200  void Triangulate();
201 
205  bool IsClosed() const;
206 
215  void Decompose( std::vector<Mesh>& aResult ) const;
216 
230  const Mesh& mOp1, const Mesh& mOp2, Mesh& mResult, bool bCheckExtents = false );
231 
232  // Mesh quality.
233  public:
240  void Normalize();
241 
249 
254 
259 
264 
268  void SetEdgeVisibilities( OdGiVisibility eVisibility );
269 
270  // Raw accessors.
271  // Used for performance optimization.
272  public:
276  const std::vector<OdGePoint3d>& Vertices() const;
277 
278  public:
279  // Simplification of the mesh by grouping of the nearly complanar faces
280  // into new faces.
281  void Simplify();
282 
283  private:
284  // Array of mesh vertices.
285  std::vector<OdGePoint3d> m_aVertices;
286 
287  // Array of faces.
288  std::vector<MeshFace> m_aFaces;
289 
290  public:
296 };
297 
298 }
299 
300 #endif //__AECMESH_H__
OdGiVisibility
Definition: Gi.h:46
unsigned int OdUInt32
DOM.
Definition: AECMesh.h:41
void RemoveEdgeVisibilities()
void Simplify()
static void PerformOperation(FacetModeler::BooleanOperation eOperation, const Mesh &mOp1, const Mesh &mOp2, Mesh &mResult, bool bCheckExtents=false)
void Clear()
void RemoveTJunctions()
void SwapFace(OdUInt32 iIndex, MeshFace &face)
void Decompose(std::vector< Mesh > &aResult) const
void GetExtents(OdGeExtents3d &extents) const
OdUInt32 GetEdgeCount() const
const OdGePoint3d & GetVertex(OdUInt32 iIndex) const
bool IsEmpty() const
void SetEdgeVisibilities(OdGiVisibility eVisibility)
void Append(const Mesh &mMesh)
void AddTriangles(const IndexList &triangles)
void Triangulate()
const MeshFace & GetFace(OdUInt32 iIndex) const
void ClearFaces()
OdUInt32 Tag
Definition: AECMesh.h:295
void SetVertex(OdUInt32 iIndex, const OdGePoint3d &ptVertex)
OdUInt32 GetFaceCount() const
void Normalize()
void Invert()
OdUInt32 AddFace(const MeshFace &face, bool bCheckPlane=true, bool *bSuccess=0)
void RegenEdgeVisibilities()
bool IsClosed() const
void AddFace(const IndexList &face, bool *bSuccess=0)
double GetVolume() const
OdUInt32 GetVertexCount() const
void RemoveSameVertices()
MeshFace & GetFace(OdUInt32 iIndex)
void Transform(const OdGeMatrix3d &mMatrix)
OdUInt32 AddVertex(const OdGePoint3d &ptVertex, bool bUnique=false)
const std::vector< OdGePoint3d > & Vertices() const