Debian Codegraph @

src/MeshVolume2D.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 __MESH_VOLUME_2D_H
14 #define __MESH_VOLUME_2D_H
15
16 // --- Project includes ---
17 #include "AVolume2D.h"
18 #include "LineSet.h"
19 #include "util/vector3.h"
20
21 // --- STL includes ---
22
23 /*!
24 \class MeshVolume
25
26 A class for the generation of random particles inside a volume bounded by a triangle mesh.
27 The correctness of the supplied mesh, i.e. that it actually defines a closed surface,
28 is not checked in the class. Instead the caller is responsible to supply a correct mesh.
29 No convexity or other topological requirements apply to the volume.
30 Facet orientations is not relevant.
31 Works also if the mesh encloses multiple volumes.
32 */
33 class MeshVolume2D : public AVolume2D
34 {
35 protected:
36 LineSet m_mesh;
37 Vector3 m_MinPoint;
38 Vector3 m_MaxPoint;
39 Vector3 m_DistPoint;
40
41 double m_random(double,double)const;
42
43 public:
44 MeshVolume2D();
45 MeshVolume2D(const LineSet&);
46 virtual ~MeshVolume2D(){};
47
48 virtual pair<Vector3,Vector3> getBoundingBox();
49 virtual Vector3 getAPoint(int) const;
50 virtual const map<double,const AGeometricObject*> getClosestObjects(const Vector3&,int) const;
51 virtual const map<double,const Line2D*> getClosestPlanes(const Vector3&,int) const;
52 virtual Line2D getClosestPlane(const Vector3&);
53 virtual bool isIn(const Vector3&) const;
54 virtual bool isIn(const Sphere&);
55 virtual bool isFullyOutside(const Sphere&);
56 };
57
58 #endif // __MESH_VOLUME_2D_H