Class 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.
    • 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 proxy
        idxArr - [in] the index mapping
    • Method Detail

      • delete

        public void delete()
        Overrides:
        delete in class TriMesh
      • 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
        Overrides:
        clone in class TriMesh
        Returns:
        clone of this trimesh
      • scale

        public void scale​(double s)
        Description copied from class: TriMesh
        Scale all vertices in the mesh.
        Overrides:
        scale in class TriMesh
      • getGlobalIndex

        public long getGlobalIndex​(int idx)
      • 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 class TriMesh
        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 class TriMesh
        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 class TriMesh
        Parameters:
        i - [in] the index of the triangle.
        dst - [out] where to store the triangle at index idx
      • getSize

        public long getSize()
        Description copied from class: TriMesh
        gets the number of triangles in the triangle array.
        Overrides:
        getSize in class TriMesh
      • size

        public long size()
        Description copied from class: TriMesh
        gets the number of triangles in the triangle array.
        Overrides:
        size in class TriMesh