RobWorkProject
Classes | Public Types | Public Member Functions | Protected Member Functions | 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::common::Ptr< ProximityStrategyPtr
 smart pointer type to this class
 

Public Member Functions

virtual ~ProximityStrategy ()
 Destructor.
 
virtual bool addModel (rw::common::Ptr< rw::models::Object > object)
 Adds a Proximity model of a frame to this strategy. More...
 
virtual bool addModel (const 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::kinematics::Frame *frame, rw::common::Ptr< rw::geometry::Geometry > faces, bool forceCopy=false)
 Adds a Proximity model to a frame. More...
 
virtual bool hasModel (const rw::kinematics::Frame *frame)
 Tells whether the frame has a proximity model in the strategy. More...
 
virtual void clearFrame (const 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::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::common::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 void clear ()=0
 Clears any stored model information.
 

Protected Member Functions

 ProximityStrategy ()
 Creates object.
 

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, ProximityStrategyPQP, ProximityStrategyRW, ProximityStrategyFCL, ProximityStrategyBullet, ProximityStrategyYaobi, ODEContactStrategy, ContactStrategyPQP, BtContactStrategy, ContactStrategyGeometry< A, B >, and BallBallStrategy.

◆ addGeometry() [2/2]

virtual bool addGeometry ( ProximityModel model,
rw::common::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 ContactStrategy, ProximityStrategyPQP, ProximityStrategyRW, ProximityStrategyFCL, ProximityStrategyBullet, ProximityStrategyYaobi, ODEContactStrategy, ContactStrategyPQP, BtContactStrategy, and BallBallStrategy.

◆ addModel() [1/3]

virtual bool addModel ( rw::common::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
frame[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.

◆ addModel() [2/3]

virtual bool addModel ( const 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() [3/3]

virtual bool addModel ( const rw::kinematics::Frame frame,
rw::common::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.

◆ destroyModel()

virtual void destroyModel ( ProximityModel model)
pure virtual

◆ 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, ProximityStrategyPQP, ProximityStrategyRW, ProximityStrategyFCL, ContactStrategyGeometry< A, B >, ProximityStrategyBullet, ProximityStrategyYaobi, ODEContactStrategy, ContactStrategyPQP, BtContactStrategy, and BallBallStrategy.

◆ getModel()

ProximityModel::Ptr getModel ( const rw::kinematics::Frame frame)

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::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

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