-
Notifications
You must be signed in to change notification settings - Fork 0
/
vertex.h
43 lines (30 loc) · 1.02 KB
/
vertex.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
#ifndef _VERTEX_H
#define _VERTEX_H
#include "vectors.h"
// ==========================================================
class Vertex {
public:
// ========================
// CONSTRUCTOR & DESTRUCTOR
Vertex(int i, const Vec3f &pos) : position(pos) {index = i;}
// =========
// ACCESSORS
int getIndex() const { return index; }
double x() const { return position.x(); }
double y() const { return position.y(); }
double z() const { return position.z(); }
const Vec3f& getPos() const { return position; }
private:
// ==============
// REPRESENTATION
Vec3f position;
// this is the index from the original .obj file.
// technically not part of the half-edge data structure
int index;
// NOTE: the vertices don't know anything about adjacency. In some
// versions of this data structure they have a pointer to one of
// their incoming edges. However, this data is complicated to
// maintain during mesh manipulation.
};
// ==========================================================
#endif