-
Notifications
You must be signed in to change notification settings - Fork 9
/
face.h
46 lines (42 loc) · 1.23 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
#ifndef FACE_H
#define FACE_H
#include <QVector3D>
#include <QDebug>
#include "halfedge.h"
#include "vertex.h"
//forward declaration
class HalfEdge;
class Vertex;
//class for faces
class Face{
public:
explicit Face();
explicit Face(HalfEdge *e1, HalfEdge *e2, HalfEdge *e3);
//changes winding of face so normal vector is calculated
void flip();
inline QVector3D* getNormal(){return normal;}
//change to list or vector... some day some time
inline HalfEdge* getEdge1(){return edge1;}
inline HalfEdge* getEdge2(){return edge2;}
inline HalfEdge* getEdge3(){return edge3;}
QList< HalfEdge* > getEdgesCrossingPlane(double z, HalfEdge* remove=NULL );
inline Vertex* getMaxZ() {return maxZ;}
inline Vertex* getMinZ() {return minZ;}
inline bool isNormalGood() {return goodNormal;}
void addNeighbor(Face* );
QList<Face*> getNeighbors();
QVector3D getCenter();
QVector3D* computeNormal(QVector3D* p1, QVector3D* p2, QVector3D* p3);
void setNormalIsGood(bool value);
QString getHash();
private:
HalfEdge* edge1;
HalfEdge* edge2;
HalfEdge* edge3;
Vertex* maxZ;
Vertex* minZ;
QVector3D* normal;
QList<Face*> neighbors;
bool goodNormal;
};
#endif // FACE_H