Debian Codegraph @

src/TriBox.h

raw
1 /////////////////////////////////////////////////////////////
2 // //
3 // Copyright (c) 2007-2017 by The University of Queensland //
4 // Centre for Geoscience Computing //
5 // http://earth.uq.edu.au/centre-geoscience-computing //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.apache.org/licenses/LICENSE-2.0 //
10 // //
11 /////////////////////////////////////////////////////////////
12
13 #ifndef __TRIBOX_H
14 #define __TRIBOX_H
15
16 // --- Project includes ---
17 #include "AVolume3D.h"
18 #include "geometry/Plane.h"
19
20 // --- STL includes ---
21 #include <vector>
22 #include <map>
23
24 using std::vector;
25 using std::map;
26
27
28 class TriBox : public AVolume3D
29 {
30 protected:
31 vector<Plane> m_planes;
32 Vector3 m_pmin;
33 Vector3 m_pmax;
34 bool m_inverted;
35
36 double m_random(double,double)const;
37
38 public:
39 TriBox();
40 TriBox(const Vector3&,const Vector3&,bool inverted=false);
41 virtual ~TriBox(){};
42
43 void addPlane(const Plane&);
44 virtual pair<Vector3,Vector3> getBoundingBox();
45 virtual Vector3 getAPoint(int)const;
46 virtual bool hasPlane() const{return (m_planes.size()>0);};
47 virtual Plane getClosestPlane(const Vector3&);
48 virtual const map<double,const AGeometricObject*> getClosestObjects(const Vector3&,int) const;
49 virtual bool isIn(const Vector3&) const;
50 virtual bool isIn(const Sphere&);
51 virtual bool isFullyOutside(const Sphere&);
52
53 friend ostream& operator<< (ostream&, const TriBox&);
54 };
55
56 #endif // __TRIBOX_H