Package org.robwork.sdurw_geometry
Class SurfacePtr
- java.lang.Object
-
- org.robwork.sdurw_geometry.SurfacePtr
-
public class SurfacePtr extends java.lang.ObjectPtr stores a pointer and optionally takes ownership of the value.
-
-
Constructor Summary
Constructors Constructor Description SurfacePtr()Default constructor yielding a NULL-pointer.SurfacePtr(long cPtr, boolean cMemoryOwn)SurfacePtr(Surface 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 Surface__ref__()Dereferencing operator.SurfacePtrclone()Clone the surface.SurfaceCPtrcptr()voiddelete()Surfacederef()The pointer stored in the object.booleanequals(Surface p)pair_d_dextremums(Vector3D direction)Find the extent of the surface along a specific direction.
If the surface has no lower bound, the value -%std::numeric_limits<double>::%max() can
be returned to indicate that the surface has unbounded minimum value in the given
direction.
If the surface has no upper bound, the value %std::numeric_limits<double>::%max() can
be returned to indicate that the surface has unbounded maximum value in the given
direction.
static longgetCPtr(SurfacePtr obj)SurfacegetDeref()Member access operator.TriMeshPtrgetTriMesh()Discretize the surface into a triangle mesh representation.
If the border of a trimmed surface must fit with other surface triangulations,
a discretized border must be given to this triangulation function.
If the same border points are used for different surfaces for their common edges, the
triangulations will fit together.
TriMeshPtrgetTriMesh(SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_double_t_t border)Discretize the surface into a triangle mesh representation.
If the border of a trimmed surface must fit with other surface triangulations,
a discretized border must be given to this triangulation function.
If the same border points are used for different surfaces for their common edges, the
triangulations will fit together.
booleanisNull()checks if the pointer is nullbooleanisShared()check if this Ptr has shared ownership or none
ownershipSurfacePtrscale(double factor)Get a scaled version of the surface.voidsetDiscretizationResolution(double resolution)Set the resolution used for discretization in the getTriMesh function.
The meaning of this parameter depends on the type of surface.
booleanSurfaceEqual(Surface surface, double threshold)Check if this surface is identical to other surface .SurfacePtrtransform(Transform3D T)SurfacePtrtransform(Vector3D P)Move the surface without rotation.
If there is no rotation, this function is better to use than #transform(const
rw::math::Transform3D<>&) const for some surfaces.
-
-
-
Constructor Detail
-
SurfacePtr
public SurfacePtr(long cPtr, boolean cMemoryOwn)
-
SurfacePtr
public SurfacePtr()
Default constructor yielding a NULL-pointer.
-
SurfacePtr
public SurfacePtr(Surface ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(SurfacePtr obj)
-
delete
public void delete()
-
deref
public Surface deref()
The pointer stored in the object.
-
__ref__
public Surface __ref__()
Dereferencing operator.
-
getDeref
public Surface getDeref()
Member access operator.
-
equals
public boolean equals(Surface 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 SurfaceCPtr cptr()
-
transform
public SurfacePtr transform(Transform3D T)
-
transform
public SurfacePtr transform(Vector3D P)
Move the surface without rotation.
If there is no rotation, this function is better to use than #transform(const
rw::math::Transform3D<>&) const for some surfaces. This is because certain properties can
be preserved.
- Parameters:
P- [in] the translation vector to the new surface.- Returns:
- pointer to a new surface.
-
scale
public SurfacePtr scale(double factor)
Get a scaled version of the surface.- Parameters:
factor- [in] the factor to scale with.- Returns:
- a new scaled surface.
-
clone
public SurfacePtr clone()
Clone the surface.- Returns:
- pointer to copy of surface.
-
extremums
public pair_d_d extremums(Vector3D direction)
Find the extent of the surface along a specific direction.
If the surface has no lower bound, the value -%std::numeric_limits<double>::%max() can
be returned to indicate that the surface has unbounded minimum value in the given
direction.
If the surface has no upper bound, the value %std::numeric_limits<double>::%max() can
be returned to indicate that the surface has unbounded maximum value in the given
direction.
- Parameters:
direction- [in] a normalized direction vector.- Returns:
- the minimum and maximum values along the given direction.
Note: This function does not take trimming conditions into account.
For trimmed surfaces, create a Face with the boundary curves and use Face::extremums.
-
getTriMesh
public TriMeshPtr getTriMesh(SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_double_t_t border)
Discretize the surface into a triangle mesh representation.
If the border of a trimmed surface must fit with other surface triangulations,
a discretized border must be given to this triangulation function.
If the same border points are used for different surfaces for their common edges, the
triangulations will fit together.
- Parameters:
border- [in] (optional) an ordered list of points on the surface, that forms the
border of the patch to triangulate.- Returns:
- a new TriMesh.
-
getTriMesh
public TriMeshPtr getTriMesh()
Discretize the surface into a triangle mesh representation.
If the border of a trimmed surface must fit with other surface triangulations,
a discretized border must be given to this triangulation function.
If the same border points are used for different surfaces for their common edges, the
triangulations will fit together.
- Returns:
- a new TriMesh.
-
setDiscretizationResolution
public void setDiscretizationResolution(double resolution)
Set the resolution used for discretization in the getTriMesh function.
The meaning of this parameter depends on the type of surface.
- Parameters:
resolution- [in] the resolution parameter.
-
SurfaceEqual
public boolean SurfaceEqual(Surface surface, double threshold)
Check if this surface is identical to other surface .- Parameters:
surface- [in] other surface to compare to.threshold- [in] threshold for when surfaces can be considered
identical.- Returns:
- true if identical, false otherwise.
-
-