Package org.robwork.sdurw_proximity
Class CollisionStrategyPtr
- java.lang.Object
-
- org.robwork.sdurw_proximity.CollisionStrategyPtr
-
public class CollisionStrategyPtr extends java.lang.Object
Ptr stores a pointer and optionally takes ownership of the value.
-
-
Constructor Summary
Constructors Constructor Description CollisionStrategyPtr()
Default constructor yielding a NULL-pointer.CollisionStrategyPtr(long cPtr, boolean cMemoryOwn)
CollisionStrategyPtr(CollisionStrategy ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CollisionStrategy
__ref__()
Dereferencing operator.boolean
addGeometry(ProximityModel model, Geometry geom)
adds geometry to a specific proximity model.boolean
addGeometry(ProximityModel model, GeometryPtr geom)
adds geometry to a specific model.boolean
addGeometry(ProximityModel model, GeometryPtr geom, boolean forceCopy)
adds geometry to a specific model.boolean
addModel(FramePtr frame, Geometry faces)
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
boolean
addModel(FramePtr frame, GeometryPtr faces)
Adds a Proximity model to a frame.
The Proximity model is constructed from the list of faces
boolean
addModel(FramePtr frame, GeometryPtr faces, boolean forceCopy)
Adds a Proximity model to a frame.
The Proximity model is constructed from the list of faces
boolean
addModel(ObjectPtr object)
Adds a Proximity model of a frame to this strategy.
The Proximity model is the one specified in the frames property
void
clear()
Clears any stored model informationvoid
clearFrame(FramePtr frame)
Clear (remove all) model information for frame frame.void
clearFrames()
Clear (remove all) model information for all frames.CollisionStrategyCPtr
cptr()
ProximityModelPtr
createModel()
creates an empty ProximityModelvoid
delete()
CollisionStrategy
deref()
The pointer stored in the object.void
destroyModel(ProximityModel model)
deallocates the memory used for modelboolean
equals(CollisionStrategy p)
void
getCollisionContacts(SWIGTYPE_p_std__vectorT_rw__proximity__CollisionStrategy__Contact_t contacts, ProximityStrategyData data)
this method interprets the collision query result and calculates a list of
contacts to represent the collision geometry between the colliding geometries.
Please note that for most collisions
a single point and normal is not sufficient to describe the complete collision area.
However, it is typically a reasonable approximation.static long
getCPtr(CollisionStrategyPtr obj)
CollisionStrategy
getDeref()
Member access operator.VectorGeometryPtr
getGeometries(ProximityModel model)
the list of all geometry that are associated to
the proximity model model is returnedvector_s
getGeometryIDs(ProximityModel model)
the list of all geometry ids that are associated to
the proximity model model is returnedProximityModelPtr
getModel(FramePtr frame)
get the proximitymodel associated to frame.boolean
hasModel(FramePtr frame)
Tells whether the frame has a proximity model in the strategy
To have a proximity model does not means that it is loaded.boolean
inCollision(FramePtr a, Transform3D wTa, FramePtr b, Transform3D wTb)
Checks to see if two given frames \mathcal{F}_a and
\mathcal{F}_b are in collisionboolean
inCollision(FramePtr a, Transform3D wTa, FramePtr b, Transform3D wTb, CollisionStrategy.QueryType type)
Checks to see if two given frames \mathcal{F}_a and
\mathcal{F}_b are in collisionboolean
inCollision(FramePtr a, Transform3D wTa, FramePtr b, Transform3D wTb, ProximityStrategyData data)
Checks to see if two given frames \mathcal{F}_a and
\mathcal{F}_b are in collisionboolean
inCollision(FramePtr a, Transform3D wTa, FramePtr b, Transform3D wTb, ProximityStrategyData data, CollisionStrategy.QueryType type)
Checks to see if two given frames \mathcal{F}_a and
\mathcal{F}_b are in collisionboolean
inCollision(ProximityModelPtr a, Transform3D wTa, ProximityModelPtr b, Transform3D wTb, ProximityStrategyData data)
Checks to see if two proximity models are in collisionboolean
isNull()
checks if the pointer is nullboolean
isShared()
check if this Ptr has shared ownership or none
ownershipCollisionStrategyPtr
make(CollisionToleranceStrategyPtr strategy, double tolerance)
A collision strategy constructed from a collision tolerance
strategy and a resolution.
The constructed collision strategy considers a pair of geometries to
be in collision if strategy claim they are in collision for a
tolerance of tolerance.CollisionStrategyPtr
make(CollisionToleranceStrategyPtr strategy, FrameMap frameToTolerance, double defaultTolerance)
A collision strategy constructed from a collision tolerance
strategy and a resolution.
The constructed collision strategy considers a pair of geometries to
be in collision if strategy claim they are in collision for a
tolerance of tolerance.boolean
removeGeometry(ProximityModel model, java.lang.String geomId)
removes a geometry from a specific proximity modelvoid
useThreads(int threads)
setNumber of threads the strategy may use
-
-
-
Constructor Detail
-
CollisionStrategyPtr
public CollisionStrategyPtr(long cPtr, boolean cMemoryOwn)
-
CollisionStrategyPtr
public CollisionStrategyPtr()
Default constructor yielding a NULL-pointer.
-
CollisionStrategyPtr
public CollisionStrategyPtr(CollisionStrategy ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(CollisionStrategyPtr obj)
-
delete
public void delete()
-
deref
public CollisionStrategy deref()
The pointer stored in the object.
-
__ref__
public CollisionStrategy __ref__()
Dereferencing operator.
-
getDeref
public CollisionStrategy getDeref()
Member access operator.
-
equals
public boolean equals(CollisionStrategy p)
-
isShared
public boolean isShared()
check if this Ptr has shared ownership or none
ownership- Returns:
- true if Ptr has shared ownership, false if it has no ownership.
-
isNull
public boolean isNull()
checks if the pointer is null- Returns:
- Returns true if the pointer is null
-
cptr
public CollisionStrategyCPtr cptr()
-
inCollision
public boolean inCollision(FramePtr a, Transform3D wTa, FramePtr b, Transform3D wTb, CollisionStrategy.QueryType type)
Checks to see if two given frames \mathcal{F}_a and
\mathcal{F}_b are in collision- Parameters:
a
- [in] \mathcal{F}_awTa
- [in] \robabx{w}{a}{\mathbf{T}}b
- [in] \mathcal{F}_bwTb
- [in] \robabx{w}{b}{\mathbf{T}}type
- [in] collision query type- Returns:
- true if \mathcal{F}_a and \mathcal{F}_b are
colliding, false otherwise.
-
inCollision
public boolean inCollision(FramePtr a, Transform3D wTa, FramePtr b, Transform3D wTb)
Checks to see if two given frames \mathcal{F}_a and
\mathcal{F}_b are in collision- Parameters:
a
- [in] \mathcal{F}_awTa
- [in] \robabx{w}{a}{\mathbf{T}}b
- [in] \mathcal{F}_bwTb
- [in] \robabx{w}{b}{\mathbf{T}}
- Returns:
- true if \mathcal{F}_a and \mathcal{F}_b are
colliding, false otherwise.
-
inCollision
public boolean inCollision(FramePtr a, Transform3D wTa, FramePtr b, Transform3D wTb, ProximityStrategyData data, CollisionStrategy.QueryType type)
Checks to see if two given frames \mathcal{F}_a and
\mathcal{F}_b are in collision- Parameters:
a
- [in] \mathcal{F}_awTa
- [in] \robabx{w}{a}{\mathbf{T}}b
- [in] \mathcal{F}_bwTb
- [in] \robabx{w}{b}{\mathbf{T}}data
- [in/out] caching and result containertype
- [in] collision query type- Returns:
- true if \mathcal{F}_a and \mathcal{F}_b are
colliding, false otherwise.
-
inCollision
public boolean inCollision(FramePtr a, Transform3D wTa, FramePtr b, Transform3D wTb, ProximityStrategyData data)
Checks to see if two given frames \mathcal{F}_a and
\mathcal{F}_b are in collision- Parameters:
a
- [in] \mathcal{F}_awTa
- [in] \robabx{w}{a}{\mathbf{T}}b
- [in] \mathcal{F}_bwTb
- [in] \robabx{w}{b}{\mathbf{T}}data
- [in/out] caching and result container
- Returns:
- true if \mathcal{F}_a and \mathcal{F}_b are
colliding, false otherwise.
-
inCollision
public boolean inCollision(ProximityModelPtr a, Transform3D wTa, ProximityModelPtr b, Transform3D wTb, ProximityStrategyData data)
Checks to see if two proximity models are in collision- Parameters:
a
- [in] model 1wTa
- [in] transform of model ab
- [in] model 2wTb
- [in] transform of model bdata
- [in/out] caching and result container- Returns:
- true if \mathcal{F}_a and \mathcal{F}_b are
colliding, false otherwise.
-
getCollisionContacts
public void getCollisionContacts(SWIGTYPE_p_std__vectorT_rw__proximity__CollisionStrategy__Contact_t contacts, ProximityStrategyData data)
this method interprets the collision query result and calculates a list of
contacts to represent the collision geometry between the colliding geometries.
Please note that for most collisions
a single point and normal is not sufficient to describe the complete collision area.
However, it is typically a reasonable approximation. The approximation can hence be
implementation specific.- Parameters:
contacts
- [out] list of contacts that can be calculated from datadata
- [in] the result from the collision query
-
make
public CollisionStrategyPtr make(CollisionToleranceStrategyPtr strategy, double tolerance)
A collision strategy constructed from a collision tolerance
strategy and a resolution.
The constructed collision strategy considers a pair of geometries to
be in collision if strategy claim they are in collision for a
tolerance of tolerance.
-
make
public CollisionStrategyPtr make(CollisionToleranceStrategyPtr strategy, FrameMap frameToTolerance, double defaultTolerance)
A collision strategy constructed from a collision tolerance
strategy and a resolution.
The constructed collision strategy considers a pair of geometries to
be in collision if strategy claim they are in collision for a
tolerance of tolerance.
-
addModel
public boolean addModel(ObjectPtr object)
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.
-
addModel
public boolean addModel(FramePtr frame, Geometry faces)
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 associatefaces
- [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
public boolean addModel(FramePtr frame, GeometryPtr faces, boolean forceCopy)
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 associatefaces
- [in] list of faces from which to construct the Proximity modelforceCopy
- [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
public boolean addModel(FramePtr frame, GeometryPtr faces)
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 associatefaces
- [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.
-
hasModel
public boolean hasModel(FramePtr frame)
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
-
clearFrame
public void clearFrame(FramePtr frame)
Clear (remove all) model information for frame frame.
-
clearFrames
public void clearFrames()
Clear (remove all) model information for all frames.
-
getModel
public ProximityModelPtr getModel(FramePtr 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
-
createModel
public ProximityModelPtr createModel()
creates an empty ProximityModel
-
destroyModel
public void destroyModel(ProximityModel model)
deallocates the memory used for model- Parameters:
model
-
-
addGeometry
public boolean addGeometry(ProximityModel model, Geometry geom)
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 togeom
- [in] the geometry that is to be added
-
addGeometry
public boolean addGeometry(ProximityModel model, GeometryPtr geom, boolean forceCopy)
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:
-
addGeometry
public boolean addGeometry(ProximityModel model, GeometryPtr geom)
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
-
- Returns:
-
removeGeometry
public boolean removeGeometry(ProximityModel model, java.lang.String geomId)
removes a geometry from a specific proximity model
-
getGeometryIDs
public vector_s getGeometryIDs(ProximityModel model)
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
-
getGeometries
public VectorGeometryPtr getGeometries(ProximityModel model)
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
-
clear
public void clear()
Clears any stored model information
-
useThreads
public 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.
-
-