Interface MeshModel

All Superinterfaces:
Serializable
All Known Implementing Classes:
MeshModelImpl

public interface MeshModel extends Serializable
The main object for triangular meshes. Each mesh model consists of one or more mesh facets.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds a new mesh facet to the model.
    void
    Applies the visitor to all mesh facets sequentially.
    void
    compute(MeshVisitor visitor, boolean concurrently)
    Applies the visitor to all mesh facets.
    default boolean
    Recomputes vertex normals of only mesh faces for which the normals are missing.
    boolean
    estimateVertexNormals(boolean recomputeAll)
    Recomputes normals of vertices.
    javax.vecmath.Point3d
    Returns central point computed from mesh vertices
    returns list of mesh facets
    gets the material of the model
    long
    Returns number of vertices (sum of all facets).
    boolean
    Returns true if the mesh vertices have set curvature values.
    boolean
    Returns true if at least any vertex normals were automatically estimated.
    boolean
     
    boolean
    Returns true, if persistent data stored in the file(s) was modified, e.g., the model was moved in the space.
    void
    Removes duplicate vertices that differ only in normal vectors or texture coordinates.
  • Method Details

    • getFacets

      List<MeshFacet> getFacets()
      returns list of mesh facets
      Returns:
      list of mesh facets
    • addFacet

      void addFacet(MeshFacet facet)
      Adds a new mesh facet to the model.
      Parameters:
      facet - new mesh facet
    • getMaterial

      Material getMaterial()
      gets the material of the model
      Returns:
      material
    • hasMaterial

      boolean hasMaterial()
      Returns:
      true if material exists
    • hasCurvature

      boolean hasCurvature()
      Returns true if the mesh vertices have set curvature values.
      Returns:
      true if the mesh vertices have set curvature values.
    • compute

      void compute(MeshVisitor visitor, boolean concurrently)
      Applies the visitor to all mesh facets. If the visitor is thread-safe and the concurrently is true, then the visitor is applied to all mesh facet concurrently using all CPU cores.
      Parameters:
      visitor - Visitor to be applied for the computation
      concurrently - Parallel computation
      Throws:
      NullPointerException - if the visitor is null
    • compute

      void compute(MeshVisitor visitor)
      Applies the visitor to all mesh facets sequentially.
      Parameters:
      visitor - Visitor to be applied for the computation
      Throws:
      NullPointerException - if the visitor is null
    • simplifyModel

      void simplifyModel()
      Removes duplicate vertices that differ only in normal vectors or texture coordinates. Multiple normals are replaced with the average normal. If the texture coordinate differ then randomly selected one is used.
    • getNumVertices

      long getNumVertices()
      Returns number of vertices (sum of all facets).
      Returns:
      Number of vertices
    • getCentroid

      javax.vecmath.Point3d getCentroid()
      Returns central point computed from mesh vertices
      Returns:
      centroid
    • hasEstimatedVertNormals

      boolean hasEstimatedVertNormals()
      Returns true if at least any vertex normals were automatically estimated. Returns false if all vertex normals were predefined in the mesh file
      Returns:
      true if at least any vertex normals were automatically estimated.
    • estimateVertexNormals

      boolean estimateVertexNormals(boolean recomputeAll)
      Recomputes normals of vertices.
      Parameters:
      recomputeAll - If true, then all normals are recomputed (estimated). If false, then only missing vertex normals are recomputed.
      Returns:
      true if some normals were recomputed
    • estimateMissingVertexNormals

      default boolean estimateMissingVertexNormals()
      Recomputes vertex normals of only mesh faces for which the normals are missing.
      Returns:
      true if (some) normals were recomputed
    • isPersistentDataModified

      boolean isPersistentDataModified()
      Returns true, if persistent data stored in the file(s) was modified, e.g., the model was moved in the space.
      Returns:
      true, if persistent data stored in the file(s) was modified.