Class IndexedTriMeshN0CPtr


  • public class IndexedTriMeshN0CPtr
    extends java.lang.Object
    Ptr stores a pointer and optionally takes ownership of the value.
    • Constructor Detail

      • IndexedTriMeshN0CPtr

        public IndexedTriMeshN0CPtr​(long cPtr,
                                    boolean cMemoryOwn)
      • IndexedTriMeshN0CPtr

        public IndexedTriMeshN0CPtr()
        Default constructor yielding a NULL-pointer.
      • IndexedTriMeshN0CPtr

        public IndexedTriMeshN0CPtr​(IndexedTriMeshN0 ptr)
        Do not take ownership of ptr.

        ptr can be null.

        The constructor is implicit on purpose.
    • Method Detail

      • delete

        public void delete()
      • isShared

        public boolean isShared()
        check if this Ptr has shared ownership or none
        ownership
        Returns:
        true if Ptr has shared ownership, false if it has no ownership.
      • isNull

        public boolean isNull()
        checks if the pointer is null
        Returns:
        Returns true if the pointer is null
      • getTriangle

        public Triangle getTriangle​(long i)
      • getTriangle

        public void getTriangle​(long i,
                                Triangle dst)
      • getTriangle

        public void getTriangle​(long i,
                                Triangle_f dst)
      • 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
      • calcFaceNormal

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

        public int getNrTris()
      • getSize

        public long getSize()
      • getTriangleStride

        public short getTriangleStride()
        The stride of a triangle.
        Returns:
        the stride.
      • getIndexSize

        public short getIndexSize()
        The size of the index type used.
        Returns:
        Typically 2 (uint16_t) or 4 (uint32_t).
      • size

        public long size()
      • hasVertexNormals

        public boolean hasVertexNormals()
        Check if trimesh has vertex normals defined.
        Returns:
        true if vertex normals are defined.
      • hasFaceNormals

        public boolean hasFaceNormals()
        Check if trimesh has face normals defined.
        Returns:
        true if face normals are defined.
      • getVolume

        public double getVolume()
        calculate a volume of this triangle mesh