1 | #ifndef _VERTEX_H_
|
---|
2 | #define _VERTEX_H_
|
---|
3 |
|
---|
4 | #include "../../objects/objects.h"
|
---|
5 | #include "../../shared/shared.h"
|
---|
6 | #include "../../include/macros.h"
|
---|
7 | #include "../../toolkits/toolkits.h"
|
---|
8 |
|
---|
9 | #include "../meshtype.h"
|
---|
10 | #include "Direction.h"
|
---|
11 | #include "Metric.h"
|
---|
12 |
|
---|
13 | namespace bamg {
|
---|
14 |
|
---|
15 | //classes
|
---|
16 | class Triangle;
|
---|
17 | class Triangles;
|
---|
18 | class VertexOnGeom;
|
---|
19 | class VertexOnEdge;
|
---|
20 |
|
---|
21 | class Vertex {
|
---|
22 |
|
---|
23 | public:
|
---|
24 | I2 i; // integer coordinates
|
---|
25 | R2 r; // real coordinates
|
---|
26 | Metric m;
|
---|
27 | long ReferenceNumber;
|
---|
28 | Direction DirOfSearch;
|
---|
29 | short vint; // the vertex number in triangle; varies between 0 and 2 in t
|
---|
30 | union {
|
---|
31 | Triangle* t; // one triangle which is containing the vertex
|
---|
32 | long color;
|
---|
33 | Vertex* to; // use in geometry Vertex to now the Mesh Vertex associed
|
---|
34 | VertexOnGeom* onGeometry; // if vint == 8; // set with Triangles::SetVertexFieldOn()
|
---|
35 | Vertex* onBackgroundVertex; // if vint == 16 on Background vertex Triangles::SetVertexFieldOnBTh()
|
---|
36 | VertexOnEdge* onBackgroundEdge; // if vint == 32 on Background edge
|
---|
37 | };
|
---|
38 |
|
---|
39 | //Operators
|
---|
40 | operator I2() const {return i;} // Cast operator
|
---|
41 | operator const R2 & () const {return r;} // Cast operator
|
---|
42 | operator Metric () const {return m;} // Cast operator
|
---|
43 | double operator()(R2 x) const { return m(x);} // Get x in the metric m
|
---|
44 |
|
---|
45 | //methods (No constructor and no destructors...)
|
---|
46 | double Smoothing(Triangles & ,const Triangles & ,Triangle * & ,double =1);
|
---|
47 | void MetricFromHessian(const double Hxx,const double Hyx, const double Hyy, const double smin,const double smax,const double s,const double err,BamgOpts* bamgopts);
|
---|
48 | void Echo();
|
---|
49 | int ref() const { return ReferenceNumber;}
|
---|
50 | long Optim(int =1,int =0);
|
---|
51 |
|
---|
52 | //inline functions
|
---|
53 | inline void Set(const Vertex &rec,const Triangles & ,Triangles & ){*this=rec;}
|
---|
54 | };
|
---|
55 |
|
---|
56 | //FOR NOW (WARNING)
|
---|
57 | double QuadQuality(const Vertex &,const Vertex &,const Vertex &,const Vertex &);
|
---|
58 | }
|
---|
59 | #endif
|
---|