Package org.robwork.sdurw_geometry
Class TriMeshPtr
- java.lang.Object
-
- org.robwork.sdurw_geometry.TriMeshPtr
-
public class TriMeshPtr extends java.lang.Object
Ptr stores a pointer and optionally takes ownership of the value.
-
-
Constructor Summary
Constructors Constructor Description TriMeshPtr()
Default constructor yielding a NULL-pointer.TriMeshPtr(long cPtr, boolean cMemoryOwn)
TriMeshPtr(TriMesh 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 TriMesh
__ref__()
Dereferencing operator.TriMeshPtr
clone()
make a clone of this triangle meshTriMeshCPtr
cptr()
void
delete()
TriMesh
deref()
The pointer stored in the object.boolean
equals(TriMesh p)
static long
getCPtr(TriMeshPtr obj)
TriMesh
getDeref()
Member access operator.long
getSize()
gets the number of triangles in the triangle array.Triangle
getTriangle(long idx)
gets the triangle at index idx.void
getTriangle(long idx, Triangle dst)
gets the triangle at index idx.void
getTriangle(long idx, Triangle_f dst)
gets the triangle at index idx.TriMeshPtr
getTriMesh()
TriMeshPtr
getTriMesh(boolean forceCopy)
GeometryData.GeometryType
getType()
the type of this primitivedouble
getVolume()
calculate a volume of this triangle meshboolean
isConvex()
boolean
isNull()
checks if the pointer is nullboolean
isShared()
check if this Ptr has shared ownership or none
ownershipvoid
scale(double scale)
Scale all vertices in the mesh.void
setConvexEnabled(boolean isConvex)
long
size()
gets the number of triangles in the triangle array.java.lang.String
toString(GeometryData.GeometryType type)
format GeometryType to string
-
-
-
Constructor Detail
-
TriMeshPtr
public TriMeshPtr(long cPtr, boolean cMemoryOwn)
-
TriMeshPtr
public TriMeshPtr()
Default constructor yielding a NULL-pointer.
-
TriMeshPtr
public TriMeshPtr(TriMesh ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(TriMeshPtr obj)
-
delete
public void delete()
-
deref
public TriMesh deref()
The pointer stored in the object.
-
__ref__
public TriMesh __ref__()
Dereferencing operator.
-
getDeref
public TriMesh getDeref()
Member access operator.
-
equals
public boolean equals(TriMesh 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 TriMeshCPtr cptr()
-
getTriangle
public Triangle getTriangle(long idx)
gets the triangle at index idx.- Parameters:
idx
- [in] the index of the triangle.- Returns:
- the triangle at index idx
-
getTriangle
public void getTriangle(long idx, Triangle dst)
gets the triangle at index idx.- Parameters:
idx
- [in] the index of the triangle.dst
- [out] where to store the triangle at index idx
-
getTriangle
public void getTriangle(long idx, Triangle_f dst)
gets the triangle at index idx. Using Floating point presicion- Parameters:
idx
- [in] the index of the triangle.dst
- [out] where to store the triangle at index idx
-
getSize
public long getSize()
gets the number of triangles in the triangle array.
-
size
public long size()
gets the number of triangles in the triangle array.
-
clone
public TriMeshPtr clone()
make a clone of this triangle mesh- Returns:
- clone of this trimesh
-
scale
public void scale(double scale)
Scale all vertices in the mesh.
-
getTriMesh
public TriMeshPtr getTriMesh(boolean forceCopy)
-
getTriMesh
public TriMeshPtr getTriMesh()
-
isConvex
public boolean isConvex()
-
setConvexEnabled
public void setConvexEnabled(boolean isConvex)
-
getVolume
public double getVolume()
calculate a volume of this triangle mesh
-
getType
public GeometryData.GeometryType getType()
the type of this primitive
-
toString
public java.lang.String toString(GeometryData.GeometryType type)
format GeometryType to string- Parameters:
type
-
-
-