summaryrefslogtreecommitdiff
path: root/inc/BRepMesh_Delaun.hxx
blob: 3c175e781f4769f0697028025f15b18d819a67de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _BRepMesh_Delaun_HeaderFile
#define _BRepMesh_Delaun_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif

#ifndef _Handle_BRepMesh_DataStructureOfDelaun_HeaderFile
#include <Handle_BRepMesh_DataStructureOfDelaun.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _BRepMesh_CircleTool_HeaderFile
#include <BRepMesh_CircleTool.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _BRepMesh_Triangle_HeaderFile
#include <BRepMesh_Triangle.hxx>
#endif
#ifndef _BRepMesh_MapOfInteger_HeaderFile
#include <BRepMesh_MapOfInteger.hxx>
#endif
#ifndef _BRepMesh_MapOfIntegerInteger_HeaderFile
#include <BRepMesh_MapOfIntegerInteger.hxx>
#endif
class BRepMesh_DataStructureOfDelaun;
class BRepMesh_Array1OfVertexOfDelaun;
class TColStd_Array1OfInteger;
class BRepMesh_Vertex;
class BRepMesh_Edge;
class BRepMesh_Triangle;
class Bnd_Box2d;
class TColStd_SequenceOfInteger;


//! Compute the  Delaunay's triangulation    with  the <br>
//!          algorithm of Watson. <br>
class BRepMesh_Delaun  {
public:

  void* operator new(size_t,void* anAddress) 
  {
    return anAddress;
  }
  void* operator new(size_t size) 
  {
    return Standard::Allocate(size); 
  }
  void  operator delete(void *anAddress) 
  {
    if (anAddress) Standard::Free((Standard_Address&)anAddress); 
  }

  //! Creates the  triangulation with an  empty Mesh <br>
//!          data structure. <br>
  Standard_EXPORT   BRepMesh_Delaun(BRepMesh_Array1OfVertexOfDelaun& Vertices,const Standard_Boolean ZPositive = Standard_True);
  //! Creates  the triangulation with   and existant <br>
//!          Mesh data structure. <br>
  Standard_EXPORT   BRepMesh_Delaun(const Handle(BRepMesh_DataStructureOfDelaun)& OldMesh,BRepMesh_Array1OfVertexOfDelaun& Vertices,const Standard_Boolean ZPositive = Standard_True);
  //! Creates  the triangulation with   and existant <br>
//!          Mesh data structure. <br>
  Standard_EXPORT   BRepMesh_Delaun(const Handle(BRepMesh_DataStructureOfDelaun)& OldMesh,TColStd_Array1OfInteger& VertexIndices,const Standard_Boolean ZPositive = Standard_True);
  //! Removes a vertex in the triangulation. <br>
  Standard_EXPORT     void RemoveVertex(const BRepMesh_Vertex& theVertex) ;
  //! Adds some vertices in the triangulation. <br>
  Standard_EXPORT     void AddVertices(BRepMesh_Array1OfVertexOfDelaun& Vertices) ;
  //! Modify mesh to use the edge. Return True if done. <br>
  Standard_EXPORT     Standard_Boolean UseEdge(const Standard_Integer theEdge) ;
  //! Gives the Mesh data structure. <br>
  Standard_EXPORT    const Handle_BRepMesh_DataStructureOfDelaun& Result() const;
  //! Gives the list of frontier edges <br>
  Standard_EXPORT    const BRepMesh_MapOfInteger& Frontier() ;
  //! Gives the list of internal edges <br>
  Standard_EXPORT    const BRepMesh_MapOfInteger& InternalEdges() ;
  //! Gives the list of free edges used only one time <br>
  Standard_EXPORT    const BRepMesh_MapOfInteger& FreeEdges() ;
  
       const BRepMesh_Vertex& GetVertex(const Standard_Integer vIndex) const;
  
       const BRepMesh_Edge& GetEdge(const Standard_Integer eIndex) const;
  
       const BRepMesh_Triangle& GetTriangle(const Standard_Integer tIndex) const;
  //! Initializes the triangulation with an Array of <br>
//!          Vertex. <br>
  Standard_EXPORT     void Init(BRepMesh_Array1OfVertexOfDelaun& Vertices) ;
  //! Computes the triangulation and add the vertices <br>
//!          edges and triangles to the Mesh data structure. <br>
  Standard_EXPORT     void Compute(TColStd_Array1OfInteger& VertexIndices) ;
  //! Build the super mesh . <br>
  Standard_EXPORT     void SuperMesh(const Bnd_Box2d& theBox) ;
  //! Test  if   triangle   of  index   <TrianIndex> <br>
//!          contains geometricaly <theVertex>. If <EdgeOn> <br>
//!          is != 0  then theVertex is  on Edge  of  index <br>
//!          <edgeOn>. <br>
  Standard_EXPORT     Standard_Boolean Contains(const Standard_Integer TrianIndex,const BRepMesh_Vertex& theVertex,Standard_Integer& edgeOn) const;





protected:





private:

  //! Adjust the mesh on the frontier. <br>
  Standard_EXPORT     void FrontierAdjust() ;
  //! Find left polygon of the edge and call MeshPolygon. <br>
  Standard_EXPORT     void MeshLeftPolygonOf(const Standard_Integer EdgeIndex,const Standard_Boolean EdgeSens) ;
  //! Mesh closed polygon. <br>
  Standard_EXPORT     void MeshPolygon(TColStd_SequenceOfInteger& Polygon) ;
  //! Creates the triangles beetween the node <br>
//!          <Vertex> and the polyline <freeEdges>. <br>
  Standard_EXPORT     void CreateTriangles(const Standard_Integer vertexIndex,BRepMesh_MapOfIntegerInteger& freeEdges) ;
  //! Deletes the triangle of index <TrianIndex> and <br>
//!          add the free edges to the map. <br>
//!          When an edge is suppressed more than one time <br>
//!          it is destroyed. <br>
  Standard_EXPORT     void DeleteTriangle(const Standard_Integer TrianIndex,BRepMesh_MapOfIntegerInteger& freeEdges) ;
  
  Standard_EXPORT     void Perform(Bnd_Box2d& theBndBox,TColStd_Array1OfInteger& theVertexIndices) ;
  //! Creates the triangles on new nodes <br>
  Standard_EXPORT     void CreateTrianglesOnNewVertices(TColStd_Array1OfInteger& theVertexIndices) ;


Handle_BRepMesh_DataStructureOfDelaun MeshData;
Standard_Boolean PositiveOrientation;
BRepMesh_CircleTool tCircles;
Standard_Integer supVert1;
Standard_Integer supVert2;
Standard_Integer supVert3;
BRepMesh_Triangle supTrian;
BRepMesh_MapOfInteger mapEdges;


};


#include <BRepMesh_Delaun.lxx>



// other Inline functions and methods (like "C++: function call" methods)


#endif