Package org.robwork.sdurw_geometry
Class CurvePtr
- java.lang.Object
-
- org.robwork.sdurw_geometry.CurvePtr
-
public class CurvePtr extends java.lang.Object
Ptr stores a pointer and optionally takes ownership of the value.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Curve
__ref__()
Dereferencing operator.CurvePtr
clone()
Make a copy of the curve.SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_double_t_t
closestPoints(Vector3D p)
Get the closest points on the curve to a point p.
Notice that the limits are taken into account.
CurveCPtr
cptr()
boolean
CurveEqual(CurveCPtr curve, double eps)
Check if this curve is equal to another curve.void
delete()
Curve
deref()
The pointer stored in the object.SWIGTYPE_p_std__listT_rw__math__Vector3DT_double_t_t
discretizeAdaptive(double stepsPerRevolution)
Make a discretization of the curve.
The curve must be limited.boolean
equals(Curve p)
pair_d_d
extremums(Vector3D dir)
Get extremums of curve in given direction.
Notice that the limits are taken into account.
static long
getCPtr(CurvePtr obj)
Curve
getDeref()
Member access operator.boolean
isNull()
checks if the pointer is nullboolean
isShared()
check if this Ptr has shared ownership or none
ownershipOBB
obr()
Bounding rectangle of curve.
The curve must be limited.
CurvePtr
reverse()
Make a curve where time variable runs in opposite direction.CurvePtr
scale(double factor)
Get a scaled version of the curve.CurvePtr
transform(Transform3D T)
Transform curve.CurvePtr
transform(Vector3D P)
Transform curve.
-
-
-
Constructor Detail
-
CurvePtr
public CurvePtr(long cPtr, boolean cMemoryOwn)
-
CurvePtr
public CurvePtr()
Default constructor yielding a NULL-pointer.
-
CurvePtr
public CurvePtr(Curve ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(CurvePtr obj)
-
delete
public void delete()
-
deref
public Curve deref()
The pointer stored in the object.
-
__ref__
public Curve __ref__()
Dereferencing operator.
-
getDeref
public Curve getDeref()
Member access operator.
-
equals
public boolean equals(Curve 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 CurveCPtr cptr()
-
transform
public CurvePtr transform(Transform3D T)
Transform curve.- Parameters:
T
- [in] transformation of curve.- Returns:
- a new transformed curve.
-
transform
public CurvePtr transform(Vector3D P)
Transform curve.- Parameters:
P
- [in] positional offset.- Returns:
- a new transformed curve.
-
scale
public CurvePtr scale(double factor)
Get a scaled version of the curve.- Parameters:
factor
- [in] the factor to scale with.- Returns:
- a new scaled curve.
-
reverse
public CurvePtr reverse()
Make a curve where time variable runs in opposite direction.- Returns:
- reversed curve.
-
clone
public CurvePtr clone()
Make a copy of the curve.- Returns:
- a new copy of the curve.
-
extremums
public pair_d_d extremums(Vector3D dir)
Get extremums of curve in given direction.
Notice that the limits are taken into account.
- Parameters:
dir
- [in] direction to get extremums for.- Returns:
- the minimum and maximum value of the curve in the given direction.
-
discretizeAdaptive
public SWIGTYPE_p_std__listT_rw__math__Vector3DT_double_t_t discretizeAdaptive(double stepsPerRevolution)
Make a discretization of the curve.
The curve must be limited. The discretization is based on the curvature, such
that the sampling starts at maximum curvature points (or in limits). The step
size to the next point is based on the curvature in the current point.
A line will always give to points, regardless of the chosen number of steps per
revolution.
- Parameters:
stepsPerRevolution
- [in] the number of points to sample if the curve is a perfect
circle.- Returns:
- a list of points on the curve.
-
obr
public OBB obr()
Bounding rectangle of curve.
The curve must be limited.
- Returns:
- the bounding rectangle.
-
closestPoints
public SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_double_t_t closestPoints(Vector3D p)
Get the closest points on the curve to a point p.
Notice that the limits are taken into account.
- Parameters:
p
- [in] the point to find closest values for.- Returns:
- a vector of closest points to p.
-
CurveEqual
public boolean CurveEqual(CurveCPtr curve, double eps)
Check if this curve is equal to another curve.- Parameters:
curve
- [in] other curve.eps
- [in] distance threshold.- Returns:
- true if curves are identical, false otherwise.
-
-