Package org.robwork.sdurw_proximity
Class DistanceCalculatorPtr
- java.lang.Object
-
- org.robwork.sdurw_proximity.DistanceCalculatorPtr
-
public class DistanceCalculatorPtr extends java.lang.ObjectPtr stores a pointer and optionally takes ownership of the value.
-
-
Constructor Summary
Constructors Constructor Description DistanceCalculatorPtr()Default constructor yielding a NULL-pointer.DistanceCalculatorPtr(long cPtr, boolean cMemoryOwn)DistanceCalculatorPtr(DistanceCalculator 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 DistanceCalculator__ref__()Dereferencing operator.booleanaddDistanceModel(FramePtr frame, Geometry faces)Adds distance model to frame
The distance model is constructed based on the list of faces given.
voidclearCache()Clears the cache of the distance modelsDistanceCalculatorCPtrcptr()voiddelete()DistanceCalculatorderef()The pointer stored in the object.DistanceStrategy.DistanceStrategyResultdistance(State state)Calculates the distances between frames in the tree
DistanceStrategy.DistanceStrategyResultdistance(State state, FramePtr frame)Calculates the distance between frame and the rest of the tree
DistanceStrategy.DistanceStrategyResultdistance(State state, FramePtr frame, DistanceStrategyResultVector result)Calculates the distance between frame and the rest of the tree
DistanceStrategy.DistanceStrategyResultdistance(State state, DistanceStrategyResultVector result)Calculates the distances between frames in the tree
DistanceStrategy.DistanceStrategyResultdistanceOMP(State state)DistanceStrategy.DistanceStrategyResultdistanceOMP(State state, DistanceStrategyResultVector result)booleanequals(DistanceCalculator p)doublegetComputationTime()intgetCount()static longgetCPtr(DistanceCalculatorPtr obj)DistanceCalculatorgetDeref()Member access operator.booleanisNull()checks if the pointer is nullbooleanisShared()check if this Ptr has shared ownership or none
ownershipvoidresetComputationTimeAndCount()voidsetDistanceStrategy(DistanceStrategyPtr strategy)Set the primitive distance calculator to strategy.
strategy must be non-NULL.
Ownership of the strategy is not taken.
-
-
-
Constructor Detail
-
DistanceCalculatorPtr
public DistanceCalculatorPtr(long cPtr, boolean cMemoryOwn)
-
DistanceCalculatorPtr
public DistanceCalculatorPtr()
Default constructor yielding a NULL-pointer.
-
DistanceCalculatorPtr
public DistanceCalculatorPtr(DistanceCalculator ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(DistanceCalculatorPtr obj)
-
delete
public void delete()
-
deref
public DistanceCalculator deref()
The pointer stored in the object.
-
__ref__
public DistanceCalculator __ref__()
Dereferencing operator.
-
getDeref
public DistanceCalculator getDeref()
Member access operator.
-
equals
public boolean equals(DistanceCalculator 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 DistanceCalculatorCPtr cptr()
-
distance
public DistanceStrategy.DistanceStrategyResult distance(State state, DistanceStrategyResultVector result)
Calculates the distances between frames in the tree
- Parameters:
state- [in] The state for which to calculate distances.
result- [out] If non-NULL, the distance results are written
to result.
- Returns:
- the shortest distance between frame and frame tree
-
distance
public DistanceStrategy.DistanceStrategyResult distance(State state)
Calculates the distances between frames in the tree
- Parameters:
state- [in] The state for which to calculate distances.
- Returns:
- the shortest distance between frame and frame tree
-
distance
public DistanceStrategy.DistanceStrategyResult distance(State state, FramePtr frame, DistanceStrategyResultVector result)
Calculates the distance between frame and the rest of the tree
- Parameters:
state- [in] The state for which to calculate distances.
frame- [in] The frame for which distances are to be calculated
result- [out] If non-NULL, the distance results are written
to result.
- Returns:
- the shortest distance between frame and frame tree
-
distance
public DistanceStrategy.DistanceStrategyResult distance(State state, FramePtr frame)
Calculates the distance between frame and the rest of the tree
- Parameters:
state- [in] The state for which to calculate distances.
frame- [in] The frame for which distances are to be calculated
- Returns:
- the shortest distance between frame and frame tree
-
distanceOMP
public DistanceStrategy.DistanceStrategyResult distanceOMP(State state, DistanceStrategyResultVector result)
-
distanceOMP
public DistanceStrategy.DistanceStrategyResult distanceOMP(State state)
-
setDistanceStrategy
public void setDistanceStrategy(DistanceStrategyPtr strategy)
Set the primitive distance calculator to strategy.
strategy must be non-NULL.
Ownership of the strategy is not taken.
- Parameters:
strategy- [in] - the primitive distance calculator to use.
-
addDistanceModel
public boolean addDistanceModel(FramePtr frame, Geometry faces)
Adds distance model to frame
The distance model is constructed based on the list of faces given.
- Parameters:
frame- [in] frame to which the distance model should associatefaces- [in] list of faces from which to construct the model- Returns:
- true if a distance model was succesfully created and linked
with the frame; false otherwise.
-
clearCache
public void clearCache()
Clears the cache of the distance models
-
getComputationTime
public double getComputationTime()
-
getCount
public int getCount()
-
resetComputationTimeAndCount
public void resetComputationTimeAndCount()
-
-