GenGeo  1.1
BoxWithPlanes3D.h
Go to the documentation of this file.
1 
2 // //
3 // Copyright (c) 2007-2014 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.opensource.org/licenses/osl-3.0.php //
10 // //
12 
13 #ifndef __BOXWITHPLANES3D_H
14 #define __BOXWITHPLANES3D_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 
33 class BoxWithPlanes3D : public AVolume3D
34 {
35  protected:
38  vector<Plane> m_planes;
39  double m_random(double,double)const;
40 
41  public:
43  BoxWithPlanes3D(const Vector3&,const Vector3&);
44  virtual ~BoxWithPlanes3D(){};
45 
46  void addPlane(const Plane&);
47  virtual pair<Vector3,Vector3> getBoundingBox();
48  virtual Vector3 getAPoint(int)const;
49  virtual bool hasPlane() const{return (m_planes.size()>0);};
50  virtual Plane getClosestPlane(const Vector3&);
51  virtual const map<double,const AGeometricObject*> getClosestObjects(const Vector3&,int) const;
52  virtual bool isIn(const Vector3&) const;
53  virtual bool isIn(const Sphere&);
54  virtual bool isFullyOutside(const Sphere&);
55 
56  friend ostream& operator<< (ostream&, const BoxWithPlanes3D&);
57 };
58 #endif // __BOXWITHPLANES3D_H