Debian Codegraph @

src/BoxWithPlanes3D.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 __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
27 /*!
28 \class BoxWithPlanes3D
29
30 A class for the generation of random particles inside a 3D box. An arbitrary number
31 of planes can be added to which the particles are fitted.
32 */
33 class BoxWithPlanes3D : public AVolume3D
34 {
35 protected:
36 Vector3 m_pmin;
37 Vector3 m_pmax;
38 vector<Plane> m_planes;
39 double m_random(double,double)const;
40
41 public:
42 BoxWithPlanes3D();
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