GenGeo  1.1
MeshVolume Class Reference

#include <MeshVolume.h>

Inheritance diagram for MeshVolume:
Collaboration diagram for MeshVolume:

Public Member Functions

 MeshVolume ()
 MeshVolume (const TriPatchSet &)
virtual ~MeshVolume ()
virtual pair< Vector3, Vector3getBoundingBox ()
virtual Vector3 getAPoint (int) const
virtual const map< double,
const AGeometricObject * > 
getClosestObjects (const Vector3 &, int) const
virtual bool isIn (const Vector3 &) const
virtual bool isIn (const Sphere &)
virtual bool isFullyOutside (const Sphere &)
- Public Member Functions inherited from AVolume3D
virtual ~AVolume3D ()
- Public Member Functions inherited from AVolume
virtual ~AVolume ()
virtual int getNumberSubVolumes () const

Protected Member Functions

double m_random (double, double) const

Protected Attributes

TriPatchSet m_mesh
Vector3 m_MinPoint
Vector3 m_MaxPoint
Vector3 m_DistPoint

Detailed Description

A class for the generation of random particles inside a volume bounded by a triangle mesh. The correctness of the supplied mesh, i.e. that it actually defines a closed surface, is not checked in the class. Instead the caller is responsible to supply a correct mesh. No convexity or other topological requirements apply to the volume. Facet orientations is not relevant. Works also if the mesh encloses multiple volumes.

Constructor & Destructor Documentation

MeshVolume::MeshVolume ( )

Constructor

MeshVolume::MeshVolume ( const TriPatchSet tp)

Constructor

Parameters
tpthe triangle set

References TriPatchSet::getBoundingBox(), m_DistPoint, m_MaxPoint, m_mesh, and m_MinPoint.

Here is the call graph for this function:

virtual MeshVolume::~MeshVolume ( )
inlinevirtual

Member Function Documentation

Vector3 MeshVolume::getAPoint ( int  ) const
virtual

Get a point inside the volume. The argument is ignored.

Warning
if the mesh is incorrect the function might loop forever

Implements AVolume.

References isIn(), m_MaxPoint, m_MinPoint, m_random(), Vector3::x(), Vector3::y(), and Vector3::z().

Here is the call graph for this function:

pair< Vector3, Vector3 > MeshVolume::getBoundingBox ( )
virtual

get bounding box

Implements AVolume.

References TriPatchSet::getBoundingBox(), and m_mesh.

Here is the call graph for this function:

const map< double, const AGeometricObject * > MeshVolume::getClosestObjects ( const Vector3 P,
int  nmax 
) const
virtual

returns a map of the closest mesh facets and their distances to a given point

Parameters
Pthe point
nmaxthe maximum number of objects to be returned

Implements AVolume3D.

Reimplemented in MeshVolWithJointSet.

References m_mesh, TriPatchSet::triangles_begin(), and TriPatchSet::triangles_end().

Here is the call graph for this function:

bool MeshVolume::isFullyOutside ( const Sphere S)
virtual

Check if a sphere is fully outside the volume. Works by testing if center of the sphere is not inside and sphere doesn't intersect a mesh facet.

Parameters
Sthe sphere

Implements AVolume3D.

References Sphere::Center(), isIn(), m_mesh, Sphere::Radius(), TriPatchSet::triangles_begin(), and TriPatchSet::triangles_end().

Here is the call graph for this function:

bool MeshVolume::isIn ( const Vector3 P) const
virtual

Check if a point is inside the volume. Works by checking if a line between the point and a point outside crosses an odd number of mesh facets.

Parameters
Pthe point

Implements AVolume.

Reimplemented in MeshVolWithJointSet.

References m_DistPoint, m_mesh, TriPatchSet::triangles_begin(), and TriPatchSet::triangles_end().

Referenced by getAPoint(), isFullyOutside(), and isIn().

Here is the call graph for this function:

bool MeshVolume::isIn ( const Sphere S)
virtual

Check if a sphere is fully inside the volume. Works by testing if center of the sphere is inside and sphere doesn't intersect a mesh facet.

Parameters
Sthe sphere

Implements AVolume.

Reimplemented in MeshVolWithJointSet.

References Sphere::Center(), isIn(), m_mesh, Sphere::Radius(), TriPatchSet::triangles_begin(), and TriPatchSet::triangles_end().

Here is the call graph for this function:

double MeshVolume::m_random ( double  imin,
double  imax 
) const
protected

helper function, return random value between min & max

Referenced by getAPoint().

Member Data Documentation

Vector3 MeshVolume::m_MaxPoint
protected
Vector3 MeshVolume::m_MinPoint
protected

The documentation for this class was generated from the following files: