source: issm/trunk/src/c/Bamgx/objects/Vertex.h@ 3299

Last change on this file since 3299 was 3299, checked in by Mathieu Morlighem, 15 years ago

Bug fix from Bamg

File size: 1.9 KB
Line 
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 "../include/typedefs.h"
10#include "../include/macros.h"
11#include "Direction.h"
12#include "Metric.h"
13
14namespace 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;
28 long ReferenceNumber;
29 Direction DirOfSearch;
30 short vint; // the vertex number in triangle; varies between 0 and 2 in t
31 union {
32 Triangle* t; // one triangle which is containing the vertex
33 long color;
34 Vertex* to; // used in geometry Vertex to know the Mesh Vertex associated
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
38 };
39
40 //Operators
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
44 double operator()(R2 x) const { return m(x);} // Get x in the metric m
45
46 //methods (No constructor and no destructors...)
47 double Smoothing(Triangles & ,const Triangles & ,Triangle * & ,double =1);
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);
52
53 //inline functions
54 inline void Set(const Vertex &rec,const Triangles & ,Triangles & ){*this=rec;}
55 };
56
57 //Intermediary
58 double QuadQuality(const Vertex &,const Vertex &,const Vertex &,const Vertex &);
59}
60#endif
Note: See TracBrowser for help on using the repository browser.