Package org.robwork.sdurw_geometry
Class TriMesh
- java.lang.Object
-
- org.robwork.sdurw_geometry.GeometryData
-
- org.robwork.sdurw_geometry.TriMesh
-
- Direct Known Subclasses:
IndexedTriArray
,IndexedTriMesh
,IndexedTriMesh_f
,Object3DGeneric
,PlainTriMesh
,PlainTriMesh_f
,PlainTriMeshN1
,PlainTriMeshN1_f
,PlainTriMeshN3
,PlainTriMeshN3_f
public class TriMesh extends GeometryData
interface of a triangle mesh. The interface defines a way to get
triangles from a triangle array/mesh.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TriMesh.TriCenterIterator
struct for iterating over the centers of triangles in a meshstatic class
TriMesh.VerticeIterator
struct for iterating over the centers of triangles in a mesh-
Nested classes/interfaces inherited from class org.robwork.sdurw_geometry.GeometryData
GeometryData.GeometryType
-
-
Constructor Summary
Constructors Constructor Description TriMesh(long cPtr, boolean cMemoryOwn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TriMeshPtr
clone()
make a clone of this triangle meshvoid
delete()
static long
getCPtr(TriMesh obj)
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()
gets a trimesh representation of this geometry data.
The trimesh that is returned is by default a copy, which means
ownership is transfered to the caller.TriMeshPtr
getTriMesh(boolean forceCopy)
gets a trimesh representation of this geometry data.
The trimesh that is returned is by default a copy, which means
ownership is transfered to the caller.double
getVolume()
calculate a volume of this triangle meshboolean
isConvex()
test if this geometry data is convexvoid
scale(double scale)
Scale all vertices in the mesh.void
setConvexEnabled(boolean isConvex)
long
size()
gets the number of triangles in the triangle array.-
Methods inherited from class org.robwork.sdurw_geometry.GeometryData
getCPtr, getType, toString
-
-
-
-
Method Detail
-
getCPtr
public static long getCPtr(TriMesh obj)
-
delete
public void delete()
- Overrides:
delete
in classGeometryData
-
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)
Description copied from class:GeometryData
gets a trimesh representation of this geometry data.
The trimesh that is returned is by default a copy, which means
ownership is transfered to the caller. Specifying forceCopy to false
will enable copy by reference and ownership is not necesarilly transfered.
This is more efficient, though pointer is only alive as long as this
GeometryData is alive.
- Overrides:
getTriMesh
in classGeometryData
- Returns:
- TriMesh representation of this GeometryData
-
getTriMesh
public TriMeshPtr getTriMesh()
Description copied from class:GeometryData
gets a trimesh representation of this geometry data.
The trimesh that is returned is by default a copy, which means
ownership is transfered to the caller. Specifying forceCopy to false
will enable copy by reference and ownership is not necesarilly transfered.
This is more efficient, though pointer is only alive as long as this
GeometryData is alive.
- Overrides:
getTriMesh
in classGeometryData
- Returns:
- TriMesh representation of this GeometryData
-
isConvex
public boolean isConvex()
Description copied from class:GeometryData
test if this geometry data is convex- Overrides:
isConvex
in classGeometryData
- Returns:
- true if convex
-
setConvexEnabled
public void setConvexEnabled(boolean isConvex)
-
getVolume
public double getVolume()
calculate a volume of this triangle mesh
-
-