Class IndexedTriMeshN0


  • public class IndexedTriMeshN0
    extends IndexedTriMesh
    an Indexed Triangle mesh with zero normals
    • Method Detail

      • getVertexNormal

        public Vector3D getVertexNormal​(long i,
                                        VertexIdx vidx)
        Description copied from class: IndexedTriMesh
        Get normal of vertex vidx of triangle at index i.
        Overrides:
        getVertexNormal in class IndexedTriMesh
        Parameters:
        i - [in] the index of the triangle.
        vidx - [in] the triangle vertex.
        Returns:
        reference to normal vector.
        Warning: Using the virtual function comes with a performance penalty.
        If possible, use functions implemented on subtypes directly.
      • getVertex

        public Vector3D getVertex​(long i,
                                  VertexIdx vidx)
        Description copied from class: IndexedTriMesh
        get vertex vidx of triangle at index i.
        Overrides:
        getVertex in class IndexedTriMesh
        Parameters:
        i - [in] the index of the triangle
        vidx - [in] the index of the triangle vertex
        Returns:
        reference to vertex.
        Warning: Using the virtual function comes with a performance penalty.
        If possible, use functions implemented on subtypes directly (like
        IndexedTriMeshN0::getTriVertex).
      • getIndexedTriangle

        public IndexedTriangle_32 getIndexedTriangle​(long i)
        Description copied from class: IndexedTriMesh
        get the indexed triangle at index i
        Overrides:
        getIndexedTriangle in class IndexedTriMesh
        Parameters:
        i - [in] the index of the triangle
        Returns:
        an indexed triangle
        Warning: Using the virtual function comes with a performance penalty.
        If possible, use functions implemented on subtypes directly.
      • getTriangle

        public Triangle getTriangle​(long i)
        Description copied from class: TriMesh
        gets the triangle at index idx.
        Overrides:
        getTriangle in class TriMesh
        Parameters:
        i - [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
      • add

        public void add​(IndexedTriangle triangle)
        Add indexed triangle to the triangle mesh.
        Parameters:
        triangle - [in] the indexed triangle to add.
      • getTriVertex

        public Vector3D getTriVertex​(long i,
                                     long triIdx)
        get vertex i of triangle at index triIdx.
        Parameters:
        i - [in] should be in interval [0;2]
        triIdx - [in] index of triangle in the triangle mesh
        Returns:
        a reference to the given vertex.
      • getTriangles

        public VectorIndexedTriangle getTriangles()
        get triangle list
        Returns:
        vector of triangles
      • calcFaceArea

        public double calcFaceArea​(long triIdx)
        calculate area of triangle at index triIdx
        Returns:
        the area.
      • calcFaceCentroid

        public Vector3D calcFaceCentroid​(long triIdx)
        calculate centroid of triangle at index triIdx
        Returns:
        the centroid.
      • calcFaceNormal

        public Vector3D calcFaceNormal​(long triIdx)
        calculate face normal of triangle at index triIdx
        Returns:
        the face normal.
      • resize

        public void resize​(long nsize)
        Set the number of triangles in the mesh.
        Parameters:
        nsize - [in] the new size of the mesh.
      • getNrTris

        public int getNrTris()
        Description copied from class: IndexedTriMesh
        The number of triangles in the mesh
        Overrides:
        getNrTris in class IndexedTriMesh
        Returns:
        nr of triangles
      • getSize

        public long getSize()
        Description copied from class: TriMesh
        gets the number of triangles in the triangle array.
        Overrides:
        getSize in class TriMesh
      • 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