RobWorkProject  21.8.23-
Classes | Public Types | Public Member Functions | List of all members
ProximityStrategyRW Class Reference

This is a strategy wrapper for the distance library PQP (Proximity Query Package). More...

#include <ProximityStrategyRW.hpp>

Inherits CollisionStrategy.

Classes

struct  Model
 
struct  PCache
 cache for any of the queries possible on this strategy More...
 
struct  RWProximityModel
 

Public Types

typedef rw::core::Ptr< ProximityStrategyRWPtr
 
typedef std::pair< std::string, double > CacheKey
 cache key
 
- Public Types inherited from CollisionStrategy
enum  QueryType { FirstContact, AllContacts }
 the type of query that is to be performed
 
typedef rw::core::Ptr< CollisionStrategyPtr
 smart pointer type to this class
 
- Public Types inherited from ProximityStrategy
typedef rw::core::Ptr< ProximityStrategyPtr
 smart pointer type to this class
 

Public Member Functions

 ProximityStrategyRW ()
 Constructor.
 
virtual rw::proximity::ProximityModel::Ptr createModel ()
 creates an empty ProximityModel More...
 
void destroyModel (rw::proximity::ProximityModel *model)
 deallocates the memory used for model More...
 
bool addGeometry (rw::proximity::ProximityModel *model, const rw::geometry::Geometry &geom)
 adds geometry to a specific proximity model. The proximity strategy copies all data of the geometry. More...
 
bool addGeometry (rw::proximity::ProximityModel *model, rw::core::Ptr< rw::geometry::Geometry > geom, bool)
 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...
 
bool removeGeometry (rw::proximity::ProximityModel *model, const std::string &geomId)
 removes a geometry from a specific proximity model More...
 
std::vector< std::string > getGeometryIDs (rw::proximity::ProximityModel *model)
 the list of all geometry ids that are associated to the proximity model model is returned More...
 
std::vector< rw::core::Ptr< rw::geometry::Geometry > > getGeometrys (rw::proximity::ProximityModel *model)
 the list of all geometry that are associated to the proximity model model is returned More...
 
bool doInCollision (rw::proximity::ProximityModel::Ptr a, const rw::math::Transform3D<> &wTa, rw::proximity::ProximityModel::Ptr b, const rw::math::Transform3D<> &wTb, rw::proximity::ProximityStrategyData &data)
 Checks to see if two proximity models are in collision. More...
 
void clear ()
 Clears any stored model information. More...
 
int getNrOfBVTests ()
 returns the number of bounding volume tests performed since the last call to clearStats
 
int getNrOfTriTests ()
 returns the number of ptriangle tests performed since the last call to clearStats
 
void clearStats ()
 clears the bounding volume and triangle test counters.
 
void getCollisionContacts (std::vector< rw::proximity::CollisionStrategy::Contact > &contacts, ProximityStrategyData &data)
 
- Public Member Functions inherited from CollisionStrategy
virtual ~CollisionStrategy ()
 Destroys object.
 
bool inCollision (const kinematics::Frame *a, const math::Transform3D< double > &wTa, const kinematics::Frame *b, const math::Transform3D< double > &wTb, QueryType type=FirstContact)
 Checks to see if two given frames \( \mathcal{F}_a \) and \( \mathcal{F}_b \) are in collision. More...
 
bool inCollision (const kinematics::Frame *a, const math::Transform3D< double > &wTa, const kinematics::Frame *b, const math::Transform3D< double > &wTb, class ProximityStrategyData &data, QueryType type=FirstContact)
 Checks to see if two given frames \( \mathcal{F}_a \) and \( \mathcal{F}_b \) are in collision. More...
 
bool inCollision (ProximityModel::Ptr a, const math::Transform3D< double > &wTa, ProximityModel::Ptr b, const math::Transform3D< double > &wTb, ProximityStrategyData &data)
 Checks to see if two proximity models are in collision. More...
 
virtual void getCollisionContacts (std::vector< CollisionStrategy::Contact > &contacts, ProximityStrategyData &data)=0
 this method interprets the collision query result and calculates a list of contacts to represent the collision geometry between the colliding geometries. More...
 
- Public Member Functions inherited from ProximityStrategy
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::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::core::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...
 

Additional Inherited Members

- Static Public Member Functions inherited from CollisionStrategy
static CollisionStrategy::Ptr make (rw::core::Ptr< CollisionToleranceStrategy > strategy, double tolerance)
 A collision strategy constructed from a collision tolerance strategy and a resolution. More...
 
static CollisionStrategy::Ptr make (rw::core::Ptr< CollisionToleranceStrategy > strategy, const rw::kinematics::FrameMap< double > &frameToTolerance, double defaultTolerance)
 A collision strategy constructed from a collision tolerance strategy and a resolution. More...
 
- Protected Member Functions inherited from CollisionStrategy
virtual bool doInCollision (ProximityModel::Ptr a, const math::Transform3D< double > &wTa, ProximityModel::Ptr b, const math::Transform3D< double > &wTb, ProximityStrategyData &data)=0
 Checks to see if two proximity models are in collision. More...
 
 CollisionStrategy ()
 Creates object.
 
- Protected Member Functions inherited from ProximityStrategy
 ProximityStrategy ()
 Creates object.
 

Detailed Description

This is a strategy wrapper for the distance library PQP (Proximity Query Package).

PQP use Oriented Bounding Boxes (OBB) and hierarchical bounding trees for fast distance calculation.

For further information check out http://www.cs.unc.edu/~geom/SSV/

Member Function Documentation

◆ addGeometry() [1/2]

bool addGeometry ( rw::proximity::ProximityModel model,
const rw::geometry::Geometry geom 
)
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

Implements ProximityStrategy.

◆ addGeometry() [2/2]

bool addGeometry ( rw::proximity::ProximityModel model,
rw::core::Ptr< rw::geometry::Geometry geom,
bool  forceCopy 
)
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

Implements ProximityStrategy.

◆ clear()

void clear ( )
virtual

Clears any stored model information.

Implements ProximityStrategy.

◆ createModel()

virtual rw::proximity::ProximityModel::Ptr createModel ( )
virtual

creates an empty ProximityModel

Implements ProximityStrategy.

◆ destroyModel()

void destroyModel ( rw::proximity::ProximityModel model)
virtual

deallocates the memory used for model

Parameters
model

Implements ProximityStrategy.

◆ doInCollision()

Checks to see if two proximity models are in collision.

Parameters
a[in] model 1
wTa[in] transform of model a
b[in] model 2
wTb[in] transform of model b
data[in/out] caching and result container
Returns
true if \( \mathcal{F}_a \) and \( \mathcal{F}_b \) are colliding, false otherwise.

◆ getGeometryIDs()

std::vector< std::string > getGeometryIDs ( rw::proximity::ProximityModel model)
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

Implements ProximityStrategy.

◆ getGeometrys()

std::vector< rw::core::Ptr< rw::geometry::Geometry > > getGeometrys ( rw::proximity::ProximityModel model)
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

Reimplemented from ProximityStrategy.

◆ removeGeometry()

bool removeGeometry ( rw::proximity::ProximityModel model,
const std::string &  geomId 
)
virtual

removes a geometry from a specific proximity model

Implements ProximityStrategy.


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