Flow123d
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
flow123d
src
mesh
ngh
include
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
;
17
TPoint
center
;
18
TVector
normal_vector
;
19
bool
area_is_actual
;
20
bool
center_is_actual
;
21
22
std::vector<TVertex*>
verteces
;
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
*/
50
int
vertexes_count
() {
51
return
verteces
.size();
52
}
53
54
static
int
getNumInstances
() {
55
return
TPolygon::numberInstance
;
56
}
57
};
58
59
#endif
60
Generated on Thu May 29 2014 23:14:49 for Flow123d by
1.8.4