source: GTP/trunk/Lib/Vis/Preprocessing/src/Polytope.h @ 860

Revision 860, 1.0 KB checked in by mattausch, 18 years ago (diff)
Line 
1#ifndef _Polytope_h__
2#define _Polytope_h__
3
4#include "Containers.h"
5
6namespace GtpVisibilityPreprocessor {
7
8class Hyperplane;
9
10/** Contains a list of hyperplanes
11*/
12typedef vector<Hyperplane *> HyperplaneContainer;
13
14/** Class representing a polyhedron in 5d projected space.
15*/
16class Polyhedron
17{
18public:
19        Polyhedron() {}
20
21        /** Adds plane to polyhedron equations
22        */
23        void AddPlane(Hyperplane *plane) {mHyperPlanes.push_back(plane);}
24        /** Returns true if polyhedron is bounded.
25        */
26        virtual bool IsBounded();
27
28protected:
29
30        /// the hyperplanes define the polyhedron
31        HyperplaneContainer mHyperPlanes;
32};
33
34/** Class representing a polytope (i.e., a bounded polyhedron) in 5d projected space.
35*/
36class Polytope: public Polyhedron
37{
38public:
39        Polytope(const Polyhedron &boundedPoly);
40
41    /** Split polytope into 2 polytopes front and back.
42                @param plane the split plane
43        */
44        void Split(Hyperplane *plane, Polytope *front, Polytope *back);
45
46        virtual bool IsBounded() {return true;}
47};
48
49}
50
51#endif // Polytope
Note: See TracBrowser for help on using the repository browser.