[3232] | 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 |
|
---|
[3280] | 9 | #include "../include/typedefs.h"
|
---|
| 10 | #include "../include/macros.h"
|
---|
[3232] | 11 | #include "Direction.h"
|
---|
| 12 | #include "Metric.h"
|
---|
| 13 |
|
---|
| 14 | namespace bamg {
|
---|
| 15 |
|
---|
| 16 | //classes
|
---|
| 17 | class Triangle;
|
---|
| 18 | class Triangles;
|
---|
| 19 | class VertexOnGeom;
|
---|
| 20 | class VertexOnEdge;
|
---|
| 21 |
|
---|
| 22 | class Vertex {
|
---|
| 23 |
|
---|
| 24 | public:
|
---|
| 25 | I2 i; // integer coordinates
|
---|
| 26 | R2 r; // real coordinates
|
---|
| 27 | Metric m;
|
---|
[3243] | 28 | long ReferenceNumber;
|
---|
[3232] | 29 | Direction DirOfSearch;
|
---|
[3242] | 30 | short vint; // the vertex number in triangle; varies between 0 and 2 in t
|
---|
[3232] | 31 | union {
|
---|
[3299] | 32 | Triangle* t; // one triangle which is containing the vertex
|
---|
[3272] | 33 | long color;
|
---|
[3299] | 34 | Vertex* to; // used in geometry Vertex to know the Mesh Vertex associated
|
---|
[3272] | 35 | VertexOnGeom* onGeometry; // if vint == 8; // set with Triangles::SetVertexFieldOn()
|
---|
| 36 | Vertex* onBackgroundVertex;// if vint == 16 on Background vertex Triangles::SetVertexFieldOnBTh()
|
---|
| 37 | VertexOnEdge* onBackgroundEdge; // if vint == 32 on Background edge
|
---|
[3232] | 38 | };
|
---|
| 39 |
|
---|
| 40 | //Operators
|
---|
[3272] | 41 | operator I2() const {return i;} // Cast operator
|
---|
| 42 | operator const R2 & () const {return r;} // Cast operator
|
---|
| 43 | operator Metric () const {return m;} // Cast operator
|
---|
[3243] | 44 | double operator()(R2 x) const { return m(x);} // Get x in the metric m
|
---|
[3232] | 45 |
|
---|
| 46 | //methods (No constructor and no destructors...)
|
---|
[3243] | 47 | double Smoothing(Triangles & ,const Triangles & ,Triangle * & ,double =1);
|
---|
[3272] | 48 | 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);
|
---|
| 49 | void Echo();
|
---|
| 50 | int ref() const { return ReferenceNumber;}
|
---|
| 51 | long Optim(int =1,int =0);
|
---|
[3232] | 52 |
|
---|
| 53 | //inline functions
|
---|
[3263] | 54 | inline void Set(const Vertex &rec,const Triangles & ,Triangles & ){*this=rec;}
|
---|
[3232] | 55 | };
|
---|
| 56 |
|
---|
[3272] | 57 | //Intermediary
|
---|
[3232] | 58 | double QuadQuality(const Vertex &,const Vertex &,const Vertex &,const Vertex &);
|
---|
| 59 | }
|
---|
| 60 | #endif
|
---|