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 TriMeshPtr
clone()
make a clone of this triangle meshvoid
delete()
Triangle
get(long i)
static long
getCPtr(IndexedTriArray obj)
long
getGlobalIndex(int idx)
vector_ui
getIndexes()
get the index mappinglong
getSize()
gets the number of triangles in the triangle array.IndexedTriArray
getSubRange(long first, long last)
Triangle
getTriangle(long idx)
gets the triangle at index idx.void
getTriangle(long i, Triangle dst)
gets the triangle at index idx.void
getTriangle(long i, Triangle_f dst)
gets the triangle at index idx.GeometryData.GeometryType
getType()
the type of this primitivevoid
scale(double s)
Scale all vertices in the mesh.void
set(long i, Triangle d)
long
size()
gets the number of triangles in the triangle array.void
sortAxis(int axis)
sorts the triangles in the range [first,last[.void
sortAxis(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:TriMesh
make a clone of this triangle mesh
-
scale
public void scale(double s)
Description copied from class:TriMesh
Scale 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:TriMesh
gets the triangle at index idx.- Overrides:
getTriangle
in 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:TriMesh
gets the triangle at index idx.- Overrides:
getTriangle
in 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:TriMesh
gets the triangle at index idx. Using Floating point presicion- Overrides:
getTriangle
in 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:GeometryData
the type of this primitive- Overrides:
getType
in classGeometryData
-
getSize
public long getSize()
Description copied from class:TriMesh
gets the number of triangles in the triangle array.
-
-