-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPolyhedron.h
74 lines (56 loc) · 1.77 KB
/
Polyhedron.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
//
// Created by rkindela on 19-07-18.
//
#ifndef PMTOOL_POLYHEDRON_H
#define PMTOOL_POLYHEDRON_H
# include "Polygon.h"
#include <vector>
#include "HalfEdge.h"
#include "BoundingSphere.h"
#include <map>
using namespace std;
class Polyhedron {
private:
vector<Face*> faces;
vector<Vertex*> vertexes;
vector<HalfEdge*> edges;
public:
Polyhedron();
vector<int>* getLink(int point);
void buildFromPoints(std::vector<int> pointcloud);
int addVertex(int pointIndex);
int addFace();
int addEdge(int idxVertex, int idxFace);
POINT* getPoint(int pos);
POINT* getPoint(int pos) const;
int volume(int faceIdx, int pointIdx);
Face* getFace(int pos);
Face* getFace(int pos) const;
Vertex* getVertex(int pos);
Vertex* getVertex(int pos) const;
HalfEdge* getEdge(int pos);
HalfEdge* getEdge(int pos) const;
int getPointCount() const;
int getFaceCount() const;
int getEdgeCount() const;
bool intersect(const Polyhedron& newPoly);
bool isRegular();
bool isSimple();
bool isConvex();
bool inside(int npoint);
bool contains(const Polyhedron& p) const;
int pointIntersections(int point);
BoundingSphereOctree* getBoundingSphere() const;
bool left(int npoint);
bool rigth(int npoint);
float area2();
std::vector<Polyhedron*> triangulate();
Polyhedron* getDualPolyhedron();
vector<Polyhedron*>* getConvexHull();
vector<Polyhedron*>* giftWrapping(std::vector<int> pointcloud);
vector<Polyhedron*>* grahamScan(std::vector<int> pointcloud);
friend std::ostream& operator<<(std::ostream& os, const Polyhedron* poly);
friend std::ostream& operator<<(std::ostream& os, const Polyhedron& poly);
bool isEqual(Polyhedron& polyB);
};
#endif //PMTOOL_POLYHEDRON_H