-
Notifications
You must be signed in to change notification settings - Fork 5
/
face.h
85 lines (61 loc) · 1.59 KB
/
face.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*!
* @file face.h
* @brief Contains face class
*/
#ifndef __FACE_H__
#define __FACE_H__
#include <boost/logic/tribool.hpp>
#include "vertex.h"
#include "directed_edge.h"
namespace psalm
{
/*!
* @class face
* @brief Data for a face of the mesh
*/
class face
{
public:
face();
void add_edge(const directed_edge& edge);
void add_vertex(vertex* v);
void add_face_vertex(vertex* v);
size_t num_edges() const;
size_t num_vertices() const;
vertex* get_vertex(size_t i);
const vertex* get_vertex(size_t i) const;
vertex* get_face_vertex(size_t i);
directed_edge& get_edge(size_t i);
const directed_edge& get_edge(size_t i) const;
/*!
* @brief Pointer to face point.
*
* Pointer to face point that corresponds to the current
* face. This pointer is only set and read during
* subdivision algorithms and must \e not be relied on
* within other functions.
*/
vertex* face_point;
bool is_on_boundary() const;
void set_on_boundary(bool boundary = true);
bool is_obtuse();
void reconstruct_from_edges();
double calc_area() const;
private:
std::vector<directed_edge> E;
std::vector<vertex*> V;
std::vector<vertex*> V_F;
size_t id;
bool boundary; ///< Flag signalling that the face is a
///< boundary face.
/*!
* Flag signalling that the face is an obtuse triangle.
* This makes only sense for triangles, of course. By
* using the tribool, the function `is_obtuse()` may
* decide whether it is required to _calculate_ the value
* of the flag or can simply return it.
*/
boost::logic::tribool obtuse;
};
} // end of namespace "psalm"
#endif