Package org.robwork.sdurw_geometry
Class IndexedTriMesh_fPtr
- java.lang.Object
-
- org.robwork.sdurw_geometry.IndexedTriMesh_fPtr
-
public class IndexedTriMesh_fPtr extends java.lang.Object
Ptr stores a pointer and optionally takes ownership of the value.
-
-
Constructor Summary
Constructors Constructor Description IndexedTriMesh_fPtr()
Default constructor yielding a NULL-pointer.IndexedTriMesh_fPtr(long cPtr, boolean cMemoryOwn)
IndexedTriMesh_fPtr(IndexedTriMesh_f 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 IndexedTriMesh_f
__ref__()
Dereferencing operator.TriMeshPtr
clone()
make a clone of this triangle meshvoid
delete()
IndexedTriMesh_f
deref()
The pointer stored in the object.boolean
equals(IndexedTriMesh_f p)
static long
getCPtr(IndexedTriMesh_fPtr obj)
IndexedTriMesh_f
getDeref()
Member access operator.IndexedTriangle_32
getIndexedTriangle(long i)
get the indexed triangle at index iSWIGTYPE_p_unsigned_char
getIndexPtr()
Pointer to the start of the index array.short
getIndexSize()
The size of the index type used.SWIGTYPE_p_void
getIndices()
Get pointer to first element of index array.SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_float_t_t
getNormals()
Get vector of normals.int
getNrTris()
The number of triangles in the meshlong
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.short
getTriangleStride()
The stride of a triangle.TriMeshPtr
getTriMesh()
TriMeshPtr
getTriMesh(boolean forceCopy)
GeometryData.GeometryType
getType()
Vector3Df
getVertex(long i)
Get vertex from vertex list.Vector3Df
getVertex(long i, VertexIdx vidx)
get vertex vidx of triangle at index i.Vector3Df
getVertexNormal(long i, VertexIdx vidx)
Get normal of vertex vidx of triangle at index i.SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_float_t_t
getVertices()
Get vector of vertices.double
getVolume()
calculate a volume of this triangle meshboolean
hasFaceNormals()
Check if trimesh has face normals defined.boolean
hasVertexNormals()
Check if trimesh has vertex normals defined.boolean
isConvex()
boolean
isNull()
checks if the pointer is nullboolean
isShared()
check if this Ptr has shared ownership or none
ownershipvoid
scale(double scale)
void
setConvexEnabled(boolean isConvex)
long
size()
java.lang.String
toString(GeometryData.GeometryType type)
format GeometryType to string
-
-
-
Constructor Detail
-
IndexedTriMesh_fPtr
public IndexedTriMesh_fPtr(long cPtr, boolean cMemoryOwn)
-
IndexedTriMesh_fPtr
public IndexedTriMesh_fPtr()
Default constructor yielding a NULL-pointer.
-
IndexedTriMesh_fPtr
public IndexedTriMesh_fPtr(IndexedTriMesh_f ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(IndexedTriMesh_fPtr obj)
-
delete
public void delete()
-
deref
public IndexedTriMesh_f deref()
The pointer stored in the object.
-
__ref__
public IndexedTriMesh_f __ref__()
Dereferencing operator.
-
getDeref
public IndexedTriMesh_f getDeref()
Member access operator.
-
equals
public boolean equals(IndexedTriMesh_f 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
-
getNormals
public SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_float_t_t getNormals()
Get vector of normals.- Returns:
- reference to vector.
-
getVertices
public SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_float_t_t getVertices()
Get vector of vertices.- Returns:
- reference to vector.
-
getTriangleStride
public short getTriangleStride()
The stride of a triangle.- Returns:
- the stride.
-
getIndexSize
public short getIndexSize()
The size of the index type used.- Returns:
- Typically 2 (uint16_t) or 4 (uint32_t).
-
getIndexPtr
public SWIGTYPE_p_unsigned_char getIndexPtr()
Pointer to the start of the index array.- Returns:
- pointer to byte array.
-
size
public long size()
-
getVertex
public Vector3Df getVertex(long i)
Get vertex from vertex list.- Parameters:
i
- [in] the vertex id (NOT the triangle id).- Returns:
- a reference to the vertex.
-
getVertex
public Vector3Df getVertex(long i, VertexIdx vidx)
get vertex vidx of triangle at index i.- Parameters:
i
- [in] the index of the trianglevidx
- [in] the index of the triangle vertex- Returns:
- reference to vertex.
Warning: Using the virtual function comes with a performance penalty.
If possible, use functions implemented on subtypes directly (like
IndexedTriMeshN0::getTriVertex).
-
hasVertexNormals
public boolean hasVertexNormals()
Check if trimesh has vertex normals defined.- Returns:
- true if vertex normals are defined.
-
hasFaceNormals
public boolean hasFaceNormals()
Check if trimesh has face normals defined.- Returns:
- true if face normals are defined.
-
getVertexNormal
public Vector3Df getVertexNormal(long i, VertexIdx vidx)
Get normal of vertex vidx of triangle at index i.- Parameters:
i
- [in] the index of the triangle.vidx
- [in] the triangle vertex.- Returns:
- reference to normal vector.
Warning: Using the virtual function comes with a performance penalty.
If possible, use functions implemented on subtypes directly.
-
getIndexedTriangle
public IndexedTriangle_32 getIndexedTriangle(long i)
get the indexed triangle at index i- Parameters:
i
- [in] the index of the triangle- Returns:
- an indexed triangle
Warning: Using the virtual function comes with a performance penalty.
If possible, use functions implemented on subtypes directly.
-
getNrTris
public int getNrTris()
The number of triangles in the mesh- Returns:
- nr of triangles
-
getType
public GeometryData.GeometryType getType()
-
getIndices
public SWIGTYPE_p_void getIndices()
Get pointer to first element of index array.- Returns:
- pointer to first element.
-
scale
public void scale(double scale)
-
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.
-
clone
public TriMeshPtr clone()
make a clone of this triangle mesh- Returns:
- clone of this trimesh
-
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
-
toString
public java.lang.String toString(GeometryData.GeometryType type)
format GeometryType to string- Parameters:
type
-
-
-