Package org.robwork.sdurw_proximity
Class DistanceMultiStrategyPtr
- java.lang.Object
-
- org.robwork.sdurw_proximity.DistanceMultiStrategyPtr
-
public class DistanceMultiStrategyPtr extends java.lang.ObjectPtr stores a pointer and optionally takes ownership of the value.
-
-
Constructor Summary
Constructors Constructor Description DistanceMultiStrategyPtr()Default constructor yielding a NULL-pointer.DistanceMultiStrategyPtr(long cPtr, boolean cMemoryOwn)DistanceMultiStrategyPtr(DistanceMultiStrategy 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 DistanceMultiStrategy__ref__()Dereferencing operator.booleanaddGeometry(ProximityModel model, Geometry geom)adds geometry to a specific proximity model.booleanaddGeometry(ProximityModel model, GeometryPtr geom)adds geometry to a specific model.booleanaddGeometry(ProximityModel model, GeometryPtr geom, boolean forceCopy)adds geometry to a specific model.booleanaddModel(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
booleanaddModel(FramePtr frame, GeometryPtr faces)Adds a Proximity model to a frame.
The Proximity model is constructed from the list of faces
booleanaddModel(FramePtr frame, GeometryPtr faces, boolean forceCopy)Adds a Proximity model to a frame.
The Proximity model is constructed from the list of faces
booleanaddModel(ObjectPtr object)Adds a Proximity model of a frame to this strategy.
The Proximity model is the one specified in the frames property
voidclear()Clears any stored model informationvoidclearFrame(FramePtr frame)Clear (remove all) model information for frame frame.voidclearFrames()Clear (remove all) model information for all frames.DistanceMultiStrategyCPtrcptr()ProximityModelPtrcreateModel()creates an empty ProximityModelvoiddelete()DistanceMultiStrategyderef()The pointer stored in the object.voiddestroyModel(ProximityModel model)deallocates the memory used for modelDistanceMultiStrategy.DistanceMultiStrategyResultdistances(FramePtr a, Transform3D wTa, FramePtr b, Transform3D wTb, double tolerance)Calculates all distances between geometry of two given frames \mathcal{F}_a and
\mathcal{F}_bDistanceMultiStrategy.DistanceMultiStrategyResultdistances(FramePtr a, Transform3D wTa, FramePtr b, Transform3D wTb, double tolerance, ProximityStrategyData data)Calculates all distances between geometry of two given frames \mathcal{F}_a and
\mathcal{F}_bDistanceMultiStrategy.DistanceMultiStrategyResultdistances(ProximityModelPtr a, Transform3D wTa, ProximityModelPtr b, Transform3D wTb, double tolerance, ProximityStrategyData data)booleanequals(DistanceMultiStrategy p)static longgetCPtr(DistanceMultiStrategyPtr obj)DistanceMultiStrategygetDeref()Member access operator.VectorGeometryPtrgetGeometries(ProximityModel model)the list of all geometry that are associated to
the proximity model model is returnedvector_sgetGeometryIDs(ProximityModel model)the list of all geometry ids that are associated to
the proximity model model is returnedProximityModelPtrgetModel(FramePtr frame)get the proximitymodel associated to frame.SWIGTYPE_p_std__pairT_rw__math__Vector3DT_double_t_rw__math__Vector3DT_double_t_tgetSurfaceNormals(DistanceMultiStrategy.DistanceMultiStrategyResult res, int idx)Get the Surface Normals
booleanhasModel(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.booleanisNull()checks if the pointer is nullbooleanisShared()check if this Ptr has shared ownership or none
ownershipbooleanremoveGeometry(ProximityModel model, java.lang.String geomId)removes a geometry from a specific proximity modelvoiduseThreads(int threads)setNumber of threads the strategy may use
-
-
-
Constructor Detail
-
DistanceMultiStrategyPtr
public DistanceMultiStrategyPtr(long cPtr, boolean cMemoryOwn)
-
DistanceMultiStrategyPtr
public DistanceMultiStrategyPtr()
Default constructor yielding a NULL-pointer.
-
DistanceMultiStrategyPtr
public DistanceMultiStrategyPtr(DistanceMultiStrategy ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(DistanceMultiStrategyPtr obj)
-
delete
public void delete()
-
deref
public DistanceMultiStrategy deref()
The pointer stored in the object.
-
__ref__
public DistanceMultiStrategy __ref__()
Dereferencing operator.
-
getDeref
public DistanceMultiStrategy getDeref()
Member access operator.
-
equals
public boolean equals(DistanceMultiStrategy 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 DistanceMultiStrategyCPtr cptr()
-
distances
public DistanceMultiStrategy.DistanceMultiStrategyResult distances(FramePtr a, Transform3D wTa, FramePtr b, Transform3D wTb, double tolerance)
Calculates all distances between geometry of two given frames \mathcal{F}_a and
\mathcal{F}_b- Parameters:
a- [in] \mathcal{F}_awTa- [in] \robabx{w}{a}{\mathbf{T}}b- [in] \mathcal{F}_bwTb- [in] \robabx{w}{b}{\mathbf{T}}tolerance- [in] point pairs that are closer than tolerance will
be included in the result.
- Returns:
- shortest distance if \mathcal{F}_a and \mathcal{F}_b are
separated and not in collision.
-
distances
public DistanceMultiStrategy.DistanceMultiStrategyResult distances(FramePtr a, Transform3D wTa, FramePtr b, Transform3D wTb, double tolerance, ProximityStrategyData data)
Calculates all distances between geometry of two given frames \mathcal{F}_a and
\mathcal{F}_b- Parameters:
a- [in] \mathcal{F}_awTa- [in] \robabx{w}{a}{\mathbf{T}}b- [in] \mathcal{F}_bwTb- [in] \robabx{w}{b}{\mathbf{T}}tolerance- [in] point pairs that are closer than tolerance will be included in the
result.data-
- Returns:
- shortest distance if \mathcal{F}_a and \mathcal{F}_b are
separated and not in collision.
-
distances
public DistanceMultiStrategy.DistanceMultiStrategyResult distances(ProximityModelPtr a, Transform3D wTa, ProximityModelPtr b, Transform3D wTb, double tolerance, ProximityStrategyData data)
-
getSurfaceNormals
public SWIGTYPE_p_std__pairT_rw__math__Vector3DT_double_t_rw__math__Vector3DT_double_t_t getSurfaceNormals(DistanceMultiStrategy.DistanceMultiStrategyResult res, int idx)
Get the Surface Normals
- Parameters:
res- the result to get the normals fromidx-- Returns:
- std::pair<rw::math::Vector3D<>, rw::math::Vector3D<>>
-
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.
-
-