Package org.robwork.sdurw
Class DistanceCalculatorPtr
- java.lang.Object
-
- org.robwork.sdurw.DistanceCalculatorPtr
-
public class DistanceCalculatorPtr extends java.lang.Object
Ptr 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.boolean
addDistanceModel(Frame frame, Geometry faces)
Adds distance model to frame
The distance model is constructed based on the list of faces given.
void
clearCache()
Clears the cache of the distance modelsvoid
delete()
DistanceCalculator
deref()
The pointer stored in the object.DistanceStrategyResult
distance(State state)
Calculates the distances between frames in the tree
DistanceStrategyResult
distance(State state, Frame frame)
Calculates the distance between frame and the rest of the tree
DistanceStrategyResult
distance(State state, Frame frame, DistanceStrategyResultVector result)
Calculates the distance between frame and the rest of the tree
DistanceStrategyResult
distance(State state, DistanceStrategyResultVector result)
Calculates the distances between frames in the tree
DistanceStrategyResult
distanceOMP(State state)
DistanceStrategyResult
distanceOMP(State state, DistanceStrategyResultVector result)
boolean
equals(DistanceCalculator p)
double
getComputationTime()
int
getCount()
static long
getCPtr(DistanceCalculatorPtr obj)
DistanceCalculator
getDeref()
Member access operator.boolean
isNull()
checks if the pointer is nullboolean
isShared()
check if this Ptr has shared ownership or none
ownershipvoid
resetComputationTimeAndCount()
void
setDistanceStrategy(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
-
distance
public 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 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 DistanceStrategyResult distance(State state, Frame 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 DistanceStrategyResult distance(State state, Frame 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 DistanceStrategyResult distanceOMP(State state, DistanceStrategyResultVector result)
-
distanceOMP
public 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(Frame 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()
-
-