forked from icemiliang/lscm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHalfEdge.h
49 lines (40 loc) · 1.2 KB
/
HalfEdge.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
#ifndef _MESHLIB_HALFEDGE_H_
#define _MESHLIB_HALFEDGE_H_
#include <cassert>
#include <cmath>
#include <string>
#include "Trait.h"
#include "Edge.h"
namespace MeshLib {
class Vertex;
class Edge;
class Face;
class HalfEdge {
public:
HalfEdge() { m_edge = NULL; m_prev = NULL; m_next = NULL; m_face = NULL; m_trait = NULL; m_vertex = NULL; m_string = ""; };
~HalfEdge() {};
Edge *& edge() { return m_edge; };
Vertex *& vertex() { return m_vertex; };
Vertex *& target() { return m_vertex; };
Vertex *& source() { return m_prev->vertex(); };
HalfEdge *& he_prev() { return m_prev; };
HalfEdge *& he_next() { return m_next; };
HalfEdge *& he_sym() { return m_edge->other(this); };
Face *& face() { return m_face; };
std::string &string() { return m_string; };
Trait *&trait() { return m_trait; };
HalfEdge *ccw_rotate_about_target();
HalfEdge *clw_rotate_about_target();
HalfEdge *ccw_rotate_about_source();
HalfEdge *clw_rotate_about_source();
private:
Edge *m_edge;
Face *m_face;
Vertex *m_vertex; // target vertex
HalfEdge *m_prev;
HalfEdge *m_next;
Trait * m_trait;
std::string m_string;
};
}
#endif