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 <SurgSim/Particles/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. More...
 
virtual ~PointGenerator ()
 Destructor. More...
 
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...
 

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().

Constructor & Destructor Documentation

◆ PointGenerator()

SurgSim::Particles::PointGenerator::PointGenerator ( )

Constructor.

◆ ~PointGenerator()

SurgSim::Particles::PointGenerator::~PointGenerator ( )
virtual

Destructor.

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::RandomSpherePointGenerator, SurgSim::Particles::RandomPointGenerator, SurgSim::Particles::RandomBoxPointGenerator, SurgSim::Particles::DefaultPointGenerator, and SurgSim::Particles::RandomMeshPointGenerator.

◆ 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::RandomSpherePointGenerator, SurgSim::Particles::RandomPointGenerator, SurgSim::Particles::RandomBoxPointGenerator, SurgSim::Particles::DefaultPointGenerator, and SurgSim::Particles::RandomMeshPointGenerator.

Member Data Documentation

◆ m_closedOneOneDistribution

std::uniform_real_distribution<double> SurgSim::Particles::PointGenerator::m_closedOneOneDistribution
protected

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

◆ m_closedZeroOneDistribution

std::uniform_real_distribution<double> SurgSim::Particles::PointGenerator::m_closedZeroOneDistribution
protected

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

◆ m_closedZeroOpenOneDistribution

std::uniform_real_distribution<double> SurgSim::Particles::PointGenerator::m_closedZeroOpenOneDistribution
protected

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

◆ 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.

◆ m_openOneOneDistribution

std::uniform_real_distribution<double> SurgSim::Particles::PointGenerator::m_openOneOneDistribution
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: