gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
BDS.h
Go to the documentation of this file.
1 // Gmsh - Copyright (C) 1997-2022 C. Geuzaine, J.-F. Remacle
2 //
3 // See the LICENSE.txt file in the Gmsh root directory for license information.
4 // Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
5 
6 #ifndef BDS_H
7 #define BDS_H
8 
9 // This is a 2D version of the Bidirectional Data Structure (BDS)
10 // of shephard and beall
11 // points may know the normals to the surface they are classified on
12 // default values are 0,0,1
13 
14 #include <set>
15 #include <vector>
16 #include <algorithm>
17 #include <functional>
18 #include <cmath>
19 
20 #include "GmshMessage.h"
21 
22 class BDS_Edge;
23 class BDS_Face;
24 class BDS_Mesh;
25 class BDS_Point;
26 class BDS_Vector;
27 class GFace;
28 class GEdge;
29 class GVertex;
30 
32 public:
35 
36  BDS_GeomEntity(int a, int b) : classif_tag(a), classif_degree(b) {}
37 
39 
40  bool operator<(const BDS_GeomEntity &other) const
41  {
42  if(classif_degree < other.classif_degree) return true;
43  if(classif_degree > other.classif_degree) return false;
44  if(classif_tag < other.classif_tag) return true;
45  return false;
46  }
47 };
48 
49 class BDS_Point {
50  // the first size is the one dictated by the Background Mesh the
51  // second one is dictated by characteristic lengths at points and is
52  // propagated
53  double _lcBGM, _lcPTS;
54 
55 public:
56  double X, Y, Z;
57  double u, v;
59  short degenerated;
61  int iD;
63  std::vector<BDS_Edge *> edges;
64 
65  double &lcBGM() { return _lcBGM; }
66  double &lc() { return _lcPTS; }
67  double const &lc() const { return _lcPTS; }
68 
69  bool operator<(const BDS_Point &other) const { return iD < other.iD; }
70 
71  void del(BDS_Edge *e)
72  {
73  if(edges.empty()) return;
74  edges.erase(std::remove(edges.begin(), edges.end(), e), edges.end());
75  }
76  std::vector<BDS_Face *> getTriangles() const;
77  BDS_Point(int id, double x = 0, double y = 0, double z = 0)
78  : _lcBGM(1.e22), _lcPTS(1.e22), X(x), Y(y), Z(z), u(0), v(0),
80  iD(id), g(nullptr)
81  {
82  }
83 };
84 
85 class BDS_Edge {
86  std::vector<BDS_Face *> _faces;
87 
88 public:
89  BDS_Edge(BDS_Point *A, BDS_Point *B) : deleted(false), g(nullptr)
90  {
91  if(*A < *B) {
92  p1 = A;
93  p2 = B;
94  }
95  else {
96  p1 = B;
97  p2 = A;
98  }
99  p1->edges.push_back(this);
100  p2->edges.push_back(this);
101  }
102 
103  BDS_Face *faces(std::size_t const i) const { return _faces[i]; }
104  double length() const
105  {
106  return std::sqrt((p1->X - p2->X) * (p1->X - p2->X) +
107  (p1->Y - p2->Y) * (p1->Y - p2->Y) +
108  (p1->Z - p2->Z) * (p1->Z - p2->Z));
109  }
110  int numfaces() const { return static_cast<int>(_faces.size()); }
111  int numTriangles() const;
112  inline BDS_Point *commonvertex(const BDS_Edge *other) const
113  {
114  if(p1 == other->p1 || p1 == other->p2) return p1;
115  if(p2 == other->p1 || p2 == other->p2) return p2;
116  Msg::Error("Edge %d %d has no common node with edge %d %d", p1->iD, p2->iD,
117  other->p1->iD, other->p2->iD);
118  return nullptr;
119  }
120  BDS_Point *othervertex(const BDS_Point *p) const
121  {
122  if(p1 == p) return p2;
123  if(p2 == p) return p1;
124  Msg::Error("Edge %d %d does not contain node %d", p1->iD, p2->iD, p->iD);
125  return nullptr;
126  }
127  void addface(BDS_Face *f) { _faces.push_back(f); }
128  bool operator<(const BDS_Edge &other) const
129  {
130  if(*other.p1 < *p1) return true;
131  if(*p1 < *other.p1) return false;
132  if(*other.p2 < *p2) return true;
133  return false;
134  }
135  BDS_Face *otherFace(const BDS_Face *f) const
136  {
137  if(numfaces() != 2) {
138  Msg::Error("%d face(s) attached to edge %d %d", numfaces(), p1->iD,
139  p2->iD);
140  return nullptr;
141  }
142  if(f == _faces[0]) return _faces[1];
143  if(f == _faces[1]) return _faces[0];
144  Msg::Error("Edge %d %d does not belong to the face", p1->iD, p2->iD);
145  return nullptr;
146  }
147  void del(BDS_Face *t)
148  {
149  if(_faces.empty()) return;
150  _faces.erase(std::remove_if(_faces.begin(), _faces.end(),
151  std::bind2nd(std::equal_to<BDS_Face *>(), t)),
152  _faces.end());
153  }
154  void oppositeof(BDS_Point *oface[2]) const;
155  void computeNeighborhood(BDS_Point *oface[2], BDS_Point *t1[4],
156  BDS_Point *t2[4]) const;
157 
158 public:
159  bool deleted;
162 };
163 
164 class BDS_Face {
165 public:
166  BDS_Face(BDS_Edge *A, BDS_Edge *B, BDS_Edge *C, BDS_Edge *D = nullptr)
167  : deleted(false), e1(A), e2(B), e3(C), e4(D), g(nullptr)
168  {
169  e1->addface(this);
170  e2->addface(this);
171  e3->addface(this);
172  if(e4) e4->addface(this);
173  }
174  int numEdges() const { return e4 ? 4 : 3; }
176  {
177  if(e4) {
178  Msg::Error("Opposite edge to point %d cannot be found for quad", p->iD);
179  return nullptr;
180  }
181  if(e1->p1 != p && e1->p2 != p) return e1;
182  if(e2->p1 != p && e2->p2 != p) return e2;
183  if(e3->p1 != p && e3->p2 != p) return e3;
184  Msg::Error("Point %d does not belong to this triangle", p->iD);
185  return nullptr;
186  }
188  {
189  if(e4) {
190  Msg::Error("Opposite point to edge %d %d cannot be found for quad",
191  e->p1->iD, e->p2->iD);
192  return nullptr;
193  }
194  if(e == e1) return e2->commonvertex(e3);
195  if(e == e2) return e1->commonvertex(e3);
196  if(e == e3) return e1->commonvertex(e2);
197  Msg::Error("Edge %d %d does not belong to this triangle", e->p1->iD,
198  e->p2->iD);
199  return nullptr;
200  }
201  inline bool getNodes(BDS_Point *_n[4]) const
202  {
203  if(!e4) {
204  _n[0] = e1->commonvertex(e3);
205  _n[1] = e1->commonvertex(e2);
206  _n[2] = e2->commonvertex(e3);
207  _n[3] = nullptr;
208  if(_n[0] && _n[1] && _n[2]) return true;
209  }
210  else {
211  _n[0] = e1->commonvertex(e4);
212  _n[1] = e1->commonvertex(e2);
213  _n[2] = e2->commonvertex(e3);
214  _n[3] = e3->commonvertex(e4);
215  if(_n[0] && _n[1] && _n[2] && _n[3]) return true;
216  }
217  Msg::Error("Invalid points in face");
218  return false;
219  }
220 
221 public:
222  bool deleted;
223  BDS_Edge *e1, *e2, *e3, *e4;
225 };
226 
227 struct GeomLessThan {
228  bool operator()(const BDS_GeomEntity *ent1, const BDS_GeomEntity *ent2) const
229  {
230  return *ent1 < *ent2;
231  }
232 };
233 
235  bool operator()(const BDS_Point *ent1, const BDS_Point *ent2) const
236  {
237  return *ent1 < *ent2;
238  }
239 };
240 
242  static double t;
243  bool operator()(const BDS_Point *ent1, const BDS_Point *ent2) const
244  {
245  if(ent1->X - ent2->X > t) return true;
246  if(ent1->X - ent2->X < -t) return false;
247  if(ent1->Y - ent2->Y > t) return true;
248  if(ent1->Y - ent2->Y < -t) return false;
249  if(ent1->Z - ent2->Z > t) return true;
250  return false;
251  }
252 };
253 
254 struct EdgeLessThan {
255  bool operator()(const BDS_Edge *ent1, const BDS_Edge *ent2) const
256  {
257  return *ent1 < *ent2;
258  }
259 };
260 
262 public:
263  virtual bool operator()(BDS_Point *p1, BDS_Point *p2, BDS_Point *q1,
264  BDS_Point *q2) const = 0;
265  virtual bool operator()(BDS_Point *p1, BDS_Point *p2, BDS_Point *p3,
266  BDS_Point *q1, BDS_Point *q2, BDS_Point *q3,
267  BDS_Point *op1, BDS_Point *op2, BDS_Point *op3,
268  BDS_Point *oq1, BDS_Point *oq2,
269  BDS_Point *oq3) const = 0;
270  virtual ~BDS_SwapEdgeTest() {}
271 };
272 
274 public:
276  virtual bool operator()(BDS_Point *p1, BDS_Point *p2, BDS_Point *q1,
277  BDS_Point *q2) const;
278  virtual bool operator()(BDS_Point *p1, BDS_Point *p2, BDS_Point *p3,
279  BDS_Point *q1, BDS_Point *q2, BDS_Point *q3,
280  BDS_Point *op1, BDS_Point *op2, BDS_Point *op3,
281  BDS_Point *oq1, BDS_Point *oq2, BDS_Point *oq3) const;
283 };
284 
287 
288 public:
289  BDS_SwapEdgeTestQuality(bool a, bool b = true)
291  {
292  }
293  virtual bool operator()(BDS_Point *p1, BDS_Point *p2, BDS_Point *q1,
294  BDS_Point *q2) const;
295  virtual bool operator()(BDS_Point *p1, BDS_Point *p2, BDS_Point *p3,
296  BDS_Point *q1, BDS_Point *q2, BDS_Point *q3,
297  BDS_Point *op1, BDS_Point *op2, BDS_Point *op3,
298  BDS_Point *oq1, BDS_Point *oq2, BDS_Point *oq3) const;
300 };
301 
304  double _ori;
305 
306 public:
307  BDS_SwapEdgeTestNormals(GFace *_gf, double ori) : gf(_gf), _ori(ori) {}
308  virtual bool operator()(BDS_Point *p1, BDS_Point *p2, BDS_Point *q1,
309  BDS_Point *q2) const;
310  virtual bool operator()(BDS_Point *p1, BDS_Point *p2, BDS_Point *p3,
311  BDS_Point *q1, BDS_Point *q2, BDS_Point *q3,
312  BDS_Point *op1, BDS_Point *op2, BDS_Point *op3,
313  BDS_Point *oq1, BDS_Point *oq2, BDS_Point *oq3) const;
314 };
315 
317  int p1, p2;
319  EdgeToRecover(int _p1, int _p2, GEdge *_ge) : ge(_ge)
320  {
321  if(_p1 < _p2) {
322  p1 = _p1;
323  p2 = _p2;
324  }
325  else {
326  p2 = _p1;
327  p1 = _p2;
328  }
329  }
330  bool operator<(const EdgeToRecover &other) const
331  {
332  if(p1 < other.p1) return true;
333  if(p1 > other.p1) return false;
334  if(p2 < other.p2) return true;
335  return false;
336  }
337 };
338 
339 class BDS_Mesh {
340 public:
342  double Min[3], Max[3], LC;
343  BDS_Mesh(int MAXX = 0) : MAXPOINTNUMBER(MAXX) {}
344  virtual ~BDS_Mesh();
345  BDS_Mesh(const BDS_Mesh &other);
346  std::set<BDS_GeomEntity *, GeomLessThan> geom;
347  std::set<BDS_Point *, PointLessThan> points;
348  std::vector<BDS_Edge *> edges;
349  std::vector<BDS_Face *> triangles;
350  // Points
351  BDS_Point *add_point(int num, double x, double y, double z);
352  BDS_Point *add_point(int num, double u, double v, GFace *gf);
353  void del_point(BDS_Point *p);
354  BDS_Point *find_point(int num);
355  // Edges
356  BDS_Edge *add_edge(int p1, int p2);
357  void del_edge(BDS_Edge *e);
358  BDS_Edge *find_edge(int p1, int p2);
360  BDS_Edge *find_edge(BDS_Point *p1, int p2);
361  BDS_Edge *find_edge(BDS_Point *p1, BDS_Point *p2, BDS_Face *t) const;
362  // Triangles
363  BDS_Face *add_triangle(int p1, int p2, int p3);
365  void del_face(BDS_Face *t);
367  // Geom entities
368  void add_geom(int degree, int tag);
369  BDS_GeomEntity *get_geom(int p1, int p2);
370  // 2D operators
371  BDS_Edge *recover_edge(int p1, int p2, bool &_fatal,
372  std::set<EdgeToRecover> *e2r = nullptr,
373  std::set<EdgeToRecover> *not_recovered = nullptr);
375 
377  bool swap_edge(BDS_Edge *, const BDS_SwapEdgeTest &theTest,
378  bool force = false);
379  bool collapse_edge_parametric(BDS_Edge *, BDS_Point *, bool = false);
380  bool smooth_point_centroid(BDS_Point *p, GFace *gf, double thresh);
381  bool split_edge(BDS_Edge *, BDS_Point *, bool check_area_param = false);
383  // Global operators
384  void cleanup();
385 };
386 
387 void normal_triangle(BDS_Point *p1, BDS_Point *p2, BDS_Point *p3, double c[3]);
388 void outputScalarField(std::vector<BDS_Face *> &t, const char *fn, int param,
389  GFace *gf = nullptr);
390 void recur_tag(BDS_Face *t, BDS_GeomEntity *g);
391 int Intersect_Edges_2d(double x1, double y1, double x2, double y2, double x3,
392  double y3, double x4, double y4, double x[2]);
393 double BDS_Face_Validity(GFace *gf, BDS_Face *f);
394 
395 #endif
BDS_Face::deleted
bool deleted
Definition: BDS.h:222
D
#define D
Definition: DefaultOptions.h:24
BDS_Mesh::smooth_point_centroid
bool smooth_point_centroid(BDS_Point *p, GFace *gf, double thresh)
Definition: BDS.cpp:1613
BDS_Mesh::find_triangle
BDS_Face * find_triangle(BDS_Edge *e1, BDS_Edge *e2, BDS_Edge *e3)
Definition: BDS.cpp:462
BDS_Edge::p1
BDS_Point * p1
Definition: BDS.h:160
BDS_GeomEntity::operator<
bool operator<(const BDS_GeomEntity &other) const
Definition: BDS.h:40
BDS_Point::operator<
bool operator<(const BDS_Point &other) const
Definition: BDS.h:69
BDS_SwapEdgeTestRecover::~BDS_SwapEdgeTestRecover
virtual ~BDS_SwapEdgeTestRecover()
Definition: BDS.h:282
BDS_Edge::deleted
bool deleted
Definition: BDS.h:159
BDS_Mesh
Definition: BDS.h:339
BDS_SwapEdgeTestNormals
Definition: BDS.h:302
BDS_SwapEdgeTestNormals::gf
GFace * gf
Definition: BDS.h:303
BDS_Edge::operator<
bool operator<(const BDS_Edge &other) const
Definition: BDS.h:128
GeomLessThan
Definition: BDS.h:227
GFace
Definition: GFace.h:33
BDS_SwapEdgeTestQuality::BDS_SwapEdgeTestQuality
BDS_SwapEdgeTestQuality(bool a, bool b=true)
Definition: BDS.h:289
PointLessThanLexicographic::operator()
bool operator()(const BDS_Point *ent1, const BDS_Point *ent2) const
Definition: BDS.h:243
BDS_SwapEdgeTest::operator()
virtual bool operator()(BDS_Point *p1, BDS_Point *p2, BDS_Point *p3, BDS_Point *q1, BDS_Point *q2, BDS_Point *q3, BDS_Point *op1, BDS_Point *op2, BDS_Point *op3, BDS_Point *oq1, BDS_Point *oq2, BDS_Point *oq3) const =0
BDS_Edge::computeNeighborhood
void computeNeighborhood(BDS_Point *oface[2], BDS_Point *t1[4], BDS_Point *t2[4]) const
Definition: BDS.cpp:546
BDS_Face::e4
BDS_Edge * e4
Definition: BDS.h:223
BDS_Mesh::find_point
BDS_Point * find_point(int num)
Definition: BDS.cpp:277
c
static double c(int i, int j, fullMatrix< double > &CA, const std::vector< SPoint3 > &P, const std::vector< SPoint3 > &Q)
Definition: discreteFrechetDistance.cpp:15
BDS_Edge::numTriangles
int numTriangles() const
Definition: BDS.cpp:1051
BDS_SwapEdgeTestQuality::testSmallTriangles
bool testSmallTriangles
Definition: BDS.h:286
BDS_Mesh::split_edge
bool split_edge(BDS_Edge *, BDS_Point *, bool check_area_param=false)
Definition: BDS.cpp:674
Msg::Error
static void Error(const char *fmt,...)
Definition: GmshMessage.cpp:482
BDS_Edge::g
BDS_GeomEntity * g
Definition: BDS.h:161
BDS_Mesh::get_geom
BDS_GeomEntity * get_geom(int p1, int p2)
Definition: BDS.cpp:597
BDS_SwapEdgeTestRecover::BDS_SwapEdgeTestRecover
BDS_SwapEdgeTestRecover()
Definition: BDS.h:275
LegendrePolynomials::f
void f(int n, double u, double *val)
Definition: orthogonalBasis.cpp:77
BDS_Point::_lcPTS
double _lcPTS
Definition: BDS.h:53
BDS_SwapEdgeTestNormals::BDS_SwapEdgeTestNormals
BDS_SwapEdgeTestNormals(GFace *_gf, double ori)
Definition: BDS.h:307
BDS_Face::e3
BDS_Edge * e3
Definition: BDS.h:223
PointLessThanLexicographic
Definition: BDS.h:241
EdgeToRecover::EdgeToRecover
EdgeToRecover(int _p1, int _p2, GEdge *_ge)
Definition: BDS.h:319
BDS_Point::g
BDS_GeomEntity * g
Definition: BDS.h:62
GeomLessThan::operator()
bool operator()(const BDS_GeomEntity *ent1, const BDS_GeomEntity *ent2) const
Definition: BDS.h:228
BDS_Face::numEdges
int numEdges() const
Definition: BDS.h:174
BDS_Mesh::del_face
void del_face(BDS_Face *t)
Definition: BDS.cpp:515
BDS_SwapEdgeTest
Definition: BDS.h:261
BDS_Point::config_modified
bool config_modified
Definition: BDS.h:58
BDS_Mesh::triangles
std::vector< BDS_Face * > triangles
Definition: BDS.h:349
GmshMessage.h
BDS_Point::edges
std::vector< BDS_Edge * > edges
Definition: BDS.h:63
BDS_Face::e2
BDS_Edge * e2
Definition: BDS.h:223
BDS_GeomEntity::classif_degree
int classif_degree
Definition: BDS.h:34
BDS_SwapEdgeTestQuality
Definition: BDS.h:285
BDS_Edge::_faces
std::vector< BDS_Face * > _faces
Definition: BDS.h:86
BDS_Point::lcBGM
double & lcBGM()
Definition: BDS.h:65
BDS_Mesh::collapse_edge_parametric
bool collapse_edge_parametric(BDS_Edge *, BDS_Point *, bool=false)
Definition: BDS.cpp:1074
BDS_Edge::oppositeof
void oppositeof(BDS_Point *oface[2]) const
Definition: BDS.cpp:572
BDS_Edge::p2
BDS_Point * p2
Definition: BDS.h:160
BDS_Edge::otherFace
BDS_Face * otherFace(const BDS_Face *f) const
Definition: BDS.h:135
BDS_GeomEntity::~BDS_GeomEntity
~BDS_GeomEntity()
Definition: BDS.h:38
BDS_GeomEntity::classif_tag
int classif_tag
Definition: BDS.h:33
BDS_Mesh::Max
double Max[3]
Definition: BDS.h:342
BDS_Mesh::BDS_Mesh
BDS_Mesh(const BDS_Mesh &other)
BDS_Mesh::geom
std::set< BDS_GeomEntity *, GeomLessThan > geom
Definition: BDS.h:346
BDS_SwapEdgeTestQuality::~BDS_SwapEdgeTestQuality
virtual ~BDS_SwapEdgeTestQuality()
Definition: BDS.h:299
BDS_SwapEdgeTestRecover::operator()
virtual bool operator()(BDS_Point *p1, BDS_Point *p2, BDS_Point *q1, BDS_Point *q2) const
Definition: BDS.cpp:795
BDS_SwapEdgeTestRecover
Definition: BDS.h:273
BDS_Point::X
double X
Definition: BDS.h:56
BDS_Point::_lcBGM
double _lcBGM
Definition: BDS.h:53
EdgeToRecover
Definition: BDS.h:316
BDS_Mesh::Min
double Min[3]
Definition: BDS.h:342
GVertex
Definition: GVertex.h:23
BDS_Mesh::points
std::set< BDS_Point *, PointLessThan > points
Definition: BDS.h:347
BDS_Mesh::LC
double LC
Definition: BDS.h:342
BDS_GeomEntity
Definition: BDS.h:31
BDS_Point::v
double v
Definition: BDS.h:57
BDS_Point::degenerated
short degenerated
Definition: BDS.h:59
EdgeToRecover::ge
GEdge * ge
Definition: BDS.h:318
BDS_Mesh::recover_edge_fast
BDS_Edge * recover_edge_fast(BDS_Point *p1, BDS_Point *p2)
Definition: BDS.cpp:323
BDS_Mesh::cleanup
void cleanup()
Definition: BDS.cpp:642
BDS_Face::e1
BDS_Edge * e1
Definition: BDS.h:223
BDS_SwapEdgeTestQuality::operator()
virtual bool operator()(BDS_Point *p1, BDS_Point *p2, BDS_Point *q1, BDS_Point *q2) const
Definition: BDS.cpp:823
normal_triangle
void normal_triangle(BDS_Point *p1, BDS_Point *p2, BDS_Point *p3, double c[3])
Definition: BDS.cpp:185
EdgeToRecover::p1
int p1
Definition: BDS.h:317
BDS_Point::iD
int iD
Definition: BDS.h:61
BDS_Edge::addface
void addface(BDS_Face *f)
Definition: BDS.h:127
BDS_Edge::BDS_Edge
BDS_Edge(BDS_Point *A, BDS_Point *B)
Definition: BDS.h:89
BDS_Edge::faces
BDS_Face * faces(std::size_t const i) const
Definition: BDS.h:103
BDS_Face::oppositeVertex
BDS_Point * oppositeVertex(BDS_Edge *e)
Definition: BDS.h:187
EdgeLessThan
Definition: BDS.h:254
outputScalarField
void outputScalarField(std::vector< BDS_Face * > &t, const char *fn, int param, GFace *gf=nullptr)
Definition: BDS.cpp:46
BDS_Edge::numfaces
int numfaces() const
Definition: BDS.h:110
BDS_Face
Definition: BDS.h:164
BDS_Mesh::add_geom
void add_geom(int degree, int tag)
Definition: BDS.cpp:539
BDS_Edge::del
void del(BDS_Face *t)
Definition: BDS.h:147
BDS_GeomEntity::BDS_GeomEntity
BDS_GeomEntity(int a, int b)
Definition: BDS.h:36
EdgeToRecover::p2
int p2
Definition: BDS.h:317
BDS_Face::getNodes
bool getNodes(BDS_Point *_n[4]) const
Definition: BDS.h:201
BDS_Edge::othervertex
BDS_Point * othervertex(const BDS_Point *p) const
Definition: BDS.h:120
BDS_SwapEdgeTestNormals::operator()
virtual bool operator()(BDS_Point *p1, BDS_Point *p2, BDS_Point *q1, BDS_Point *q2) const
Definition: BDS.cpp:893
BDS_Point::del
void del(BDS_Edge *e)
Definition: BDS.h:71
BDS_Edge::commonvertex
BDS_Point * commonvertex(const BDS_Edge *other) const
Definition: BDS.h:112
PointLessThan::operator()
bool operator()(const BDS_Point *ent1, const BDS_Point *ent2) const
Definition: BDS.h:235
PointLessThan
Definition: BDS.h:234
z
const double z
Definition: GaussQuadratureQuad.cpp:56
BDS_Mesh::recover_edge
BDS_Edge * recover_edge(int p1, int p2, bool &_fatal, std::set< EdgeToRecover > *e2r=nullptr, std::set< EdgeToRecover > *not_recovered=nullptr)
Definition: BDS.cpp:347
BDS_Mesh::add_point
BDS_Point * add_point(int num, double x, double y, double z)
Definition: BDS.cpp:257
EdgeLessThan::operator()
bool operator()(const BDS_Edge *ent1, const BDS_Edge *ent2) const
Definition: BDS.h:255
BDS_Point::Y
double Y
Definition: BDS.h:56
BDS_Mesh::del_edge
void del_edge(BDS_Edge *e)
Definition: BDS.cpp:525
BDS_Point::getTriangles
std::vector< BDS_Face * > getTriangles() const
Definition: BDS.cpp:237
BDS_SwapEdgeTest::~BDS_SwapEdgeTest
virtual ~BDS_SwapEdgeTest()
Definition: BDS.h:270
BDS_Mesh::edge_constraint
bool edge_constraint(BDS_Point *p1, BDS_Point *p2)
BDS_Mesh::del_point
void del_point(BDS_Point *p)
Definition: BDS.cpp:533
GEdge
Definition: GEdge.h:26
recur_tag
void recur_tag(BDS_Face *t, BDS_GeomEntity *g)
Definition: BDS.cpp:605
BDS_Mesh::BDS_Mesh
BDS_Mesh(int MAXX=0)
Definition: BDS.h:343
BDS_SwapEdgeTestQuality::testQuality
bool testQuality
Definition: BDS.h:286
BDS_Mesh::~BDS_Mesh
virtual ~BDS_Mesh()
Definition: BDS.cpp:665
Intersect_Edges_2d
int Intersect_Edges_2d(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4, double x[2])
Definition: BDS.cpp:307
BDS_SwapEdgeTestNormals::_ori
double _ori
Definition: BDS.h:304
BDS_Edge
Definition: BDS.h:85
BDS_Point::u
double u
Definition: BDS.h:57
BDS_Edge::length
double length() const
Definition: BDS.h:104
BDS_Point
Definition: BDS.h:49
BDS_SwapEdgeTest::operator()
virtual bool operator()(BDS_Point *p1, BDS_Point *p2, BDS_Point *q1, BDS_Point *q2) const =0
BDS_Mesh::edges
std::vector< BDS_Edge * > edges
Definition: BDS.h:348
BDS_Point::lc
double & lc()
Definition: BDS.h:66
BDS_Point::BDS_Point
BDS_Point(int id, double x=0, double y=0, double z=0)
Definition: BDS.h:77
BDS_Mesh::add_edge
BDS_Edge * add_edge(int p1, int p2)
Definition: BDS.cpp:479
BDS_Face_Validity
double BDS_Face_Validity(GFace *gf, BDS_Face *f)
Definition: BDS.cpp:33
PointLessThanLexicographic::t
static double t
Definition: BDS.h:242
BDS_Face::BDS_Face
BDS_Face(BDS_Edge *A, BDS_Edge *B, BDS_Edge *C, BDS_Edge *D=nullptr)
Definition: BDS.h:166
EdgeToRecover::operator<
bool operator<(const EdgeToRecover &other) const
Definition: BDS.h:330
BDS_Face::g
BDS_GeomEntity * g
Definition: BDS.h:224
BDS_Face::oppositeEdge
BDS_Edge * oppositeEdge(BDS_Point *p)
Definition: BDS.h:175
BDS_Mesh::swap_edge
bool swap_edge(BDS_Edge *, const BDS_SwapEdgeTest &theTest, bool force=false)
Can invalidate the iterators for edge.
Definition: BDS.cpp:926
BDS_Point::_periodicCounterpart
BDS_Point * _periodicCounterpart
Definition: BDS.h:60
BDS_Mesh::MAXPOINTNUMBER
int MAXPOINTNUMBER
Definition: BDS.h:341
BDS_Mesh::find_edge
BDS_Edge * find_edge(int p1, int p2)
Definition: BDS.cpp:301
BDS_Mesh::add_triangle
BDS_Face * add_triangle(int p1, int p2, int p3)
Definition: BDS.cpp:496
BDS_Point::Z
double Z
Definition: BDS.h:56
BDS_Point::lc
double const & lc() const
Definition: BDS.h:67