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 classTriMesh.TriCenterIteratorstruct for iterating over the centers of triangles in a meshstatic classTriMesh.VerticeIteratorstruct 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 TriMeshPtrclone()make a clone of this triangle meshvoiddelete()static longgetCPtr(TriMesh obj)longgetSize()gets the number of triangles in the triangle array.TrianglegetTriangle(long idx)gets the triangle at index idx.voidgetTriangle(long idx, Triangle dst)gets the triangle at index idx.voidgetTriangle(long idx, Triangle_f dst)gets the triangle at index idx.TriMeshPtrgetTriMesh()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.TriMeshPtrgetTriMesh(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.doublegetVolume()calculate a volume of this triangle meshbooleanisConvex()test if this geometry data is convexvoidscale(double scale)Scale all vertices in the mesh.voidsetConvexEnabled(boolean isConvex)longsize()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:
deletein 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:GeometryDatagets 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:
getTriMeshin classGeometryData- Returns:
- TriMesh representation of this GeometryData
-
getTriMesh
public TriMeshPtr getTriMesh()
Description copied from class:GeometryDatagets 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:
getTriMeshin classGeometryData- Returns:
- TriMesh representation of this GeometryData
-
isConvex
public boolean isConvex()
Description copied from class:GeometryDatatest if this geometry data is convex- Overrides:
isConvexin classGeometryData- Returns:
- true if convex
-
setConvexEnabled
public void setConvexEnabled(boolean isConvex)
-
getVolume
public double getVolume()
calculate a volume of this triangle mesh
-
-