Package org.robwork.sdurw_geometry
Class IndexedTriArray
- java.lang.Object
-
- org.robwork.sdurw_geometry.GeometryData
-
- org.robwork.sdurw_geometry.TriMesh
-
- org.robwork.sdurw_geometry.IndexedTriArray
-
public class IndexedTriArray extends TriMesh
this class is a proxy to a triangle mesh where the triangles
can be indirectly copied in an efficient manner.
Each "virtual" triangle index is mapped to the actual triangle index.
By rearanging the mapping the order of the triangles in the mesh are
rearanged to the proxy user, without changing the actual triangle mesh.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.robwork.sdurw_geometry.TriMesh
TriMesh.TriCenterIterator, TriMesh.VerticeIterator
-
Nested classes/interfaces inherited from class org.robwork.sdurw_geometry.GeometryData
GeometryData.GeometryType
-
-
Constructor Summary
Constructors Constructor Description IndexedTriArray(long cPtr, boolean cMemoryOwn)IndexedTriArray(TriMeshPtr objArr)constructor - creates a proxy that initially maps triangles
from [0:0,1:1,2:2,....,i:i]IndexedTriArray(TriMeshPtr objArr, SWIGTYPE_p_rw__core__PtrT_std__vectorT_unsigned_long_t_t idxArr)constructor - creates a proxy where the initial mapping
is determined by idxArr.
idxArr must be same length as the number of triangles.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TriMeshPtrclone()make a clone of this triangle meshvoiddelete()Triangleget(long i)static longgetCPtr(IndexedTriArray obj)longgetGlobalIndex(int idx)vector_uigetIndexes()get the index mappinglonggetSize()gets the number of triangles in the triangle array.IndexedTriArraygetSubRange(long first, long last)TrianglegetTriangle(long idx)gets the triangle at index idx.voidgetTriangle(long i, Triangle dst)gets the triangle at index idx.voidgetTriangle(long i, Triangle_f dst)gets the triangle at index idx.GeometryData.GeometryTypegetType()the type of this primitivevoidscale(double s)Scale all vertices in the mesh.voidset(long i, Triangle d)longsize()gets the number of triangles in the triangle array.voidsortAxis(int axis)sorts the triangles in the range [first,last[.voidsortAxis(int axis, Transform3D t3d)-
Methods inherited from class org.robwork.sdurw_geometry.TriMesh
getCPtr, getTriMesh, getTriMesh, getVolume, isConvex, setConvexEnabled
-
Methods inherited from class org.robwork.sdurw_geometry.GeometryData
getCPtr, toString
-
-
-
-
Constructor Detail
-
IndexedTriArray
public IndexedTriArray(long cPtr, boolean cMemoryOwn)
-
IndexedTriArray
public IndexedTriArray(TriMeshPtr objArr)
constructor - creates a proxy that initially maps triangles
from [0:0,1:1,2:2,....,i:i]- Parameters:
objArr- [in] the triangle mesh on which to create a proxy
-
IndexedTriArray
public IndexedTriArray(TriMeshPtr objArr, SWIGTYPE_p_rw__core__PtrT_std__vectorT_unsigned_long_t_t idxArr)
constructor - creates a proxy where the initial mapping
is determined by idxArr.
idxArr must be same length as the number of triangles.
- Parameters:
objArr- [in] the triangle mesh on which to create a proxyidxArr- [in] the index mapping
-
-
Method Detail
-
getCPtr
public static long getCPtr(IndexedTriArray obj)
-
getIndexes
public vector_ui getIndexes()
get the index mapping
-
sortAxis
public void sortAxis(int axis)
sorts the triangles in the range [first,last[. the vertices of the triangles
are projected onto the axis and then sorted in regard to the projected value
from small to high- Parameters:
axis-
-
sortAxis
public void sortAxis(int axis, Transform3D t3d)
-
getSubRange
public IndexedTriArray getSubRange(long first, long last)
-
clone
public TriMeshPtr clone()
Description copied from class:TriMeshmake a clone of this triangle mesh
-
scale
public void scale(double s)
Description copied from class:TriMeshScale all vertices in the mesh.
-
getGlobalIndex
public long getGlobalIndex(int idx)
-
get
public Triangle get(long i)
-
set
public void set(long i, Triangle d)
-
getTriangle
public Triangle getTriangle(long idx)
Description copied from class:TriMeshgets the triangle at index idx.- Overrides:
getTrianglein classTriMesh- Parameters:
idx- [in] the index of the triangle.- Returns:
- the triangle at index idx
-
getTriangle
public void getTriangle(long i, Triangle dst)Description copied from class:TriMeshgets the triangle at index idx.- Overrides:
getTrianglein classTriMesh- Parameters:
i- [in] the index of the triangle.dst- [out] where to store the triangle at index idx
-
getTriangle
public void getTriangle(long i, Triangle_f dst)Description copied from class:TriMeshgets the triangle at index idx. Using Floating point presicion- Overrides:
getTrianglein classTriMesh- Parameters:
i- [in] the index of the triangle.dst- [out] where to store the triangle at index idx
-
getType
public GeometryData.GeometryType getType()
Description copied from class:GeometryDatathe type of this primitive- Overrides:
getTypein classGeometryData
-
getSize
public long getSize()
Description copied from class:TriMeshgets the number of triangles in the triangle array.
-
-