opensurgsim
Public Member Functions | List of all members
SurgSim::Particles::PointGenerator Class Referenceabstract

PointGenerator is used to generate points inside or on the surface of a given shape. More...

#include <PointGenerator.h>

Inheritance diagram for SurgSim::Particles::PointGenerator:
SurgSim::Particles::DefaultPointGenerator SurgSim::Particles::RandomBoxPointGenerator SurgSim::Particles::RandomMeshPointGenerator SurgSim::Particles::RandomPointGenerator SurgSim::Particles::RandomSpherePointGenerator

Public Member Functions

 PointGenerator ()
 Constructor.
 
virtual ~PointGenerator ()
 Destructor.
 
virtual SurgSim::Math::Vector3d pointInShape (std::shared_ptr< SurgSim::Math::Shape > shape)=0
 Generates one point inside the given shape. More...
 
virtual SurgSim::Math::Vector3d pointOnShape (std::shared_ptr< SurgSim::Math::Shape > shape)=0
 Generates one point on the surface of the given shape. More...
 
void seed (unsigned int val)
 Set the seed to the given value. More...
 

Protected Attributes

std::mt19937 m_generator
 
std::uniform_real_distribution< double > m_openOneOneDistribution
 
std::uniform_real_distribution< double > m_closedOneOneDistribution
 
std::uniform_real_distribution< double > m_closedZeroOneDistribution
 
std::uniform_real_distribution< double > m_closedZeroOpenOneDistribution
 

Detailed Description

PointGenerator is used to generate points inside or on the surface of a given shape.

Derived classes need to implement pointInShape() and pointOnShape().

Member Function Documentation

§ pointInShape()

virtual SurgSim::Math::Vector3d SurgSim::Particles::PointGenerator::pointInShape ( std::shared_ptr< SurgSim::Math::Shape shape)
pure virtual

Generates one point inside the given shape.

Parameters
shapeThe shape inside which a point will be generated.
Returns
A point inside the shape, shape is assumed to be located at the origin.

Implemented in SurgSim::Particles::DefaultPointGenerator, SurgSim::Particles::RandomPointGenerator, SurgSim::Particles::RandomBoxPointGenerator, and SurgSim::Particles::RandomSpherePointGenerator.

§ pointOnShape()

virtual SurgSim::Math::Vector3d SurgSim::Particles::PointGenerator::pointOnShape ( std::shared_ptr< SurgSim::Math::Shape shape)
pure virtual

Generates one point on the surface of the given shape.

Parameters
shapeThe shape on which a point will be generated.
Returns
A point on the surface of the shape, shape is assumed to be located at the origin.

Implemented in SurgSim::Particles::DefaultPointGenerator, SurgSim::Particles::RandomPointGenerator, SurgSim::Particles::RandomBoxPointGenerator, and SurgSim::Particles::RandomSpherePointGenerator.

§ seed()

void SurgSim::Particles::PointGenerator::seed ( unsigned int  val)
inline

Set the seed to the given value.

Parameters
valthe new seed for the random number generator

Member Data Documentation

§ m_generator

std::mt19937 SurgSim::Particles::PointGenerator::m_generator
protected

Random number generator and some predefined distributions to be used by different shape point generators.


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