Revision 236,
1.2 KB
checked in by mattausch, 19 years ago
(diff) |
erased compiler errors
|
Line | |
---|
1 | #ifndef _Polygon3_h__ |
---|
2 | #define _Polygon3_h__ |
---|
3 | |
---|
4 | |
---|
5 | //#include <iostream> |
---|
6 | //#include <math.h> |
---|
7 | //#include "common.h" |
---|
8 | #include "Containers.h" |
---|
9 | #include "Mesh.h" |
---|
10 | |
---|
11 | class Polygon3; |
---|
12 | class Plane3; |
---|
13 | class Face; |
---|
14 | |
---|
15 | |
---|
16 | /** Queue storing a soup of polygons used during BSP tree construction |
---|
17 | */ |
---|
18 | typedef queue<Polygon3 *> PolygonQueue; |
---|
19 | |
---|
20 | /** Class representing a general planar polygon in 3d. |
---|
21 | */ |
---|
22 | class Polygon3 |
---|
23 | { |
---|
24 | public: |
---|
25 | Polygon3(); |
---|
26 | Polygon3(const VertexContainer &vertices); |
---|
27 | |
---|
28 | /** Copies all the vertices of the face. |
---|
29 | */ |
---|
30 | Polygon3(Face *face, Mesh *parent); |
---|
31 | |
---|
32 | /** Returns supporting plane of this polygon. |
---|
33 | */ |
---|
34 | Plane3 GetSupportingPlane(); |
---|
35 | |
---|
36 | /** Splits polygon. |
---|
37 | @param partition the split plane |
---|
38 | @param front the front polygon |
---|
39 | @param back the back polygon |
---|
40 | @param splits number of splits |
---|
41 | */ |
---|
42 | void Split(Plane3 *partition, Polygon3 *front, Polygon3 *back, int &splits); |
---|
43 | |
---|
44 | enum {BACK_SIDE, FRONT_SIDE, SPLIT, COINCIDENT}; |
---|
45 | |
---|
46 | /** Side of the plane where the polygon is located. |
---|
47 | @returns one of BACK_SIDE, FRONT_SIDE, SPLIT, COINCIDENT |
---|
48 | */ |
---|
49 | int Side(Plane3 *plane); |
---|
50 | |
---|
51 | /** Deletes all polygons om the queue. |
---|
52 | */ |
---|
53 | static void DeletePolygons(PolygonQueue *polys); |
---|
54 | |
---|
55 | /// vertices are connected in counterclockwise order. |
---|
56 | VertexContainer mVertices; |
---|
57 | }; |
---|
58 | |
---|
59 | |
---|
60 | |
---|
61 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.