Flow123d  jenkins-Flow123d-linux-release-multijob-282
polygon.h
Go to the documentation of this file.
1 #ifndef polygonH
2 #define polygonH
3 
4 #include "vertex.h"
5 #include "triangle.h"
6 #include <vector>
7 
8 #define FOR_POL_VERTECES(i,j) \
9  for((j)=(i)->verteces.begin();(j)!=(i)->verteces.end();(j)++)
10 
11 class TPolygon {
12 private:
13  static int numberInstance;
14  int id;
15 
16  double area;
21 
23 
24  int generateId();
25 
26  void ComputeCenter();
27  void ComputeArea();
28 
29  /**
30  * Find position of new vertex
31  *
32  * @param Vx New vertex
33  * @return position of new vertex
34  */
35  int InsertPosition(const TVertex& Vx);
36 
37 public:
38  TPolygon();
39  ~TPolygon();
40 
41  friend std::ostream & operator <<(std::ostream&, const TPolygon&);
42 
43  void Add(const TPoint&);
44  double GetArea();
45  TPoint GetCenter();
46 
47  /**
48  * Get count of vertexes
49  */
51  return verteces.size();
52  }
53 
54  static int getNumInstances() {
56  }
57 };
58 
59 #endif
60 
TVector normal_vector
Definition: polygon.h:18
std::vector< TVertex * > verteces
Definition: polygon.h:22
void ComputeCenter()
Definition: polygon.cpp:74
double area
Definition: polygon.h:16
TPoint center
Definition: polygon.h:17
bool area_is_actual
Definition: polygon.h:19
int vertexes_count()
Definition: polygon.h:50
TPoint GetCenter()
Definition: polygon.cpp:94
void ComputeArea()
Definition: polygon.cpp:140
Definition: point.h:10
static int numberInstance
Definition: polygon.h:13
~TPolygon()
Definition: polygon.cpp:25
int generateId()
Definition: polygon.cpp:12
int id
Definition: polygon.h:14
bool center_is_actual
Definition: polygon.h:20
int InsertPosition(const TVertex &Vx)
Definition: polygon.cpp:101
double GetArea()
Definition: polygon.cpp:65
void Add(const TPoint &)
Definition: polygon.cpp:50
TPolygon()
Definition: polygon.cpp:16
Definition: vertex.h:6
static int getNumInstances()
Definition: polygon.h:54
friend std::ostream & operator<<(std::ostream &, const TPolygon &)
Definition: polygon.cpp:35