RobWorkProject  23.9.11-
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ProximityStrategy Class Referenceabstract

The ProximityStrategy interface is a clean interface for defining methods that are common for different proximity strategy classes. Specifically adding of geometric models and relating them to frames. More...

#include <ProximityStrategy.hpp>

Inherited by CollisionStrategy [virtual], CollisionToleranceStrategy [virtual], DistanceMultiStrategy [virtual], DistanceStrategy [virtual], and ContactStrategy.

Classes

class  Factory
 A factory for a ProximityStrategy. This factory also defines an ExtensionPoint. More...
 

Public Types

typedef rw::core::Ptr< ProximityStrategyPtr
 smart pointer type to this class
 

Public Member Functions

virtual ~ProximityStrategy ()
 Destructor.
 
virtual bool addModel (rw::core::Ptr< rw::models::Object > object)
 Adds a Proximity model of a frame to this strategy. More...
 
virtual bool addModel (const rw::core::Ptr< rw::kinematics::Frame > frame, const rw::geometry::Geometry &faces)
 Adds a Proximity model to a frame where the geometry is copied in the underlying proximity strategy. More...
 
virtual bool addModel (const rw::core::Ptr< rw::kinematics::Frame > frame, rw::core::Ptr< rw::geometry::Geometry > faces, bool forceCopy=false)
 Adds a Proximity model to a frame. More...
 
virtual bool hasModel (const rw::core::Ptr< rw::kinematics::Frame > frame)
 Tells whether the frame has a proximity model in the strategy. More...
 
virtual void clearFrame (const rw::core::Ptr< rw::kinematics::Frame > frame)
 Clear (remove all) model information for frame frame.
 
virtual void clearFrames ()
 Clear (remove all) model information for all frames.
 
ProximityModel::Ptr getModel (const rw::core::Ptr< rw::kinematics::Frame > frame)
 get the proximitymodel associated to frame. If no model has been associated to frame then NULL is returned. More...
 
virtual ProximityModel::Ptr createModel ()=0
 creates an empty ProximityModel
 
virtual void destroyModel (ProximityModel *model)=0
 deallocates the memory used for model More...
 
virtual bool addGeometry (ProximityModel *model, const rw::geometry::Geometry &geom)=0
 adds geometry to a specific proximity model. The proximity strategy copies all data of the geometry. More...
 
virtual bool addGeometry (ProximityModel *model, rw::core::Ptr< rw::geometry::Geometry > geom, bool forceCopy=false)=0
 adds geometry to a specific model. Depending on the option forceCopy the proximity strategy may choose to copy the geometry data or use it directly. More...
 
virtual bool removeGeometry (ProximityModel *model, const std::string &geomId)=0
 removes a geometry from a specific proximity model
 
virtual std::vector< std::string > getGeometryIDs (ProximityModel *model)=0
 the list of all geometry ids that are associated to the proximity model model is returned More...
 
virtual std::vector< rw::core::Ptr< rw::geometry::Geometry > > getGeometries (rw::proximity::ProximityModel *model)=0
 the list of all geometry that are associated to the proximity model model is returned More...
 
 DEPRECATED ("This function is deprecated due to a spelling mistake, use the correct " "spelling \"getGeometries\" instead") std
 
virtual void clear ()=0
 Clears any stored model information.
 
void useThreads (int threads)
 setNumber of threads the strategy may use More...
 

Protected Member Functions

 ProximityStrategy ()
 Creates object.
 

Protected Attributes

size_t _threads
 the number of threads the strategy may use
 

Detailed Description

The ProximityStrategy interface is a clean interface for defining methods that are common for different proximity strategy classes. Specifically adding of geometric models and relating them to frames.

Member Function Documentation

◆ addGeometry() [1/2]

virtual bool addGeometry ( ProximityModel model,
const rw::geometry::Geometry geom 
)
pure virtual

adds geometry to a specific proximity model. The proximity strategy copies all data of the geometry.

Parameters
model[in] the proximity model to add data to
geom[in] the geometry that is to be added

Implemented in ContactStrategy, ODEContactStrategy, BtContactStrategy, ContactStrategyGeometry< A, B >, ContactStrategyDMS< T >, BallBallStrategy, ProximityStrategyYaobi, ProximityStrategyPQP, ProximityStrategyFCL, ProximityStrategyBullet, and ProximityStrategyRW.

◆ addGeometry() [2/2]

virtual bool addGeometry ( ProximityModel model,
rw::core::Ptr< rw::geometry::Geometry geom,
bool  forceCopy = false 
)
pure virtual

adds geometry to a specific model. Depending on the option forceCopy the proximity strategy may choose to copy the geometry data or use it directly.

Parameters
model
geom
forceCopy
Returns

Implemented in ProximityStrategyRW, BtContactStrategy, ContactStrategy, ODEContactStrategy, ContactStrategyDMS< T >, BallBallStrategy, ProximityStrategyYaobi, ProximityStrategyPQP, ProximityStrategyFCL, and ProximityStrategyBullet.

◆ addModel() [1/3]

virtual bool addModel ( const rw::core::Ptr< rw::kinematics::Frame frame,
const rw::geometry::Geometry faces 
)
virtual

Adds a Proximity model to a frame where the geometry is copied in the underlying proximity strategy.

The Proximity model is constructed from the list of faces

Parameters
frame[in] the frame to which the Proximity model should associate
faces[in] list of faces from which to construct the Proximity model
Returns
true if a Proximity model was succesfully created and linked with the frame; false otherwise.

◆ addModel() [2/3]

virtual bool addModel ( const rw::core::Ptr< rw::kinematics::Frame frame,
rw::core::Ptr< rw::geometry::Geometry faces,
bool  forceCopy = false 
)
virtual

Adds a Proximity model to a frame.

The Proximity model is constructed from the list of faces

Parameters
frame[in] the frame to which the Proximity model should associate
faces[in] list of faces from which to construct the Proximity model
forceCopy[in] force the strategy to copy the geometry data, if false the strategy may choose to store the geometry reference or not.
Returns
true if a Proximity model was succesfully created and linked with the frame; false otherwise.

◆ addModel() [3/3]

virtual bool addModel ( rw::core::Ptr< rw::models::Object object)
virtual

Adds a Proximity model of a frame to this strategy.

The Proximity model is the one specified in the frames property

Parameters
object[in] the frame on which the Proximity model is to be created.
Returns
true if a Proximity model was succesfully created and linked with the frame; false otherwise.

◆ destroyModel()

virtual void destroyModel ( ProximityModel model)
pure virtual

◆ getGeometries()

virtual std::vector<rw::core::Ptr<rw::geometry::Geometry> > getGeometries ( rw::proximity::ProximityModel model)
pure virtual

the list of all geometry that are associated to the proximity model model is returned

Parameters
model[in] the model containing the geometries
Returns
all geometry associated to the proximity model

Implemented in BtContactStrategy, ContactStrategyDMS< T >, BallBallStrategy, ProximityStrategyYaobi, ProximityStrategyPQP, ProximityStrategyFCL, and ProximityStrategyRW.

◆ getGeometryIDs()

virtual std::vector<std::string> getGeometryIDs ( ProximityModel model)
pure virtual

the list of all geometry ids that are associated to the proximity model model is returned

Parameters
model[in] the model containing the geometries
Returns
all geometry ids associated to the proximity model

Implemented in ContactStrategy, ODEContactStrategy, BtContactStrategy, ContactStrategyGeometry< A, B >, ContactStrategyDMS< T >, BallBallStrategy, ProximityStrategyYaobi, ProximityStrategyPQP, ProximityStrategyFCL, ProximityStrategyBullet, and ProximityStrategyRW.

◆ getModel()

get the proximitymodel associated to frame. If no model has been associated to frame then NULL is returned.

Parameters
frame[in] frame for which an proximitymodel is associated

◆ hasModel()

virtual bool hasModel ( const rw::core::Ptr< rw::kinematics::Frame frame)
virtual

Tells whether the frame has a proximity model in the strategy.

To have a proximity model does not means that it is loaded. If a GeoID string from which a model can be loaded it returns true as well

Parameters
frame[in] the frame to check for1.0/
Returns
true if a model exists or can be created

◆ useThreads()

void useThreads ( int  threads)

setNumber of threads the strategy may use

Parameters
threads[in] number of threads. if Threads <= 0 then maximum threads available
Note
this does not enforce the use of threads in the algorithms but mearly allows for the use.

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