Class Model

java.lang.Object
com.agisoft.metashape.Model
All Implemented Interfaces:
AutoCloseable

public class Model extends Object implements AutoCloseable
Polygonal model.
  • Field Details

    • swigCMemOwn

      protected transient boolean swigCMemOwn
  • Constructor Details

    • Model

      protected Model(long cPtr, boolean cMemoryOwn)
    • Model

      public Model(Model model)
  • Method Details

    • getCPtr

      protected static long getCPtr(Model obj)
    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • delete

      public void delete()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • getKey

      public int getKey()
      Model identifier.
    • getChunk

      public Optional<Chunk> getChunk()
      Chunk container, may be null.
    • setLabel

      public void setLabel(String label)
      Model label.
    • getLabel

      public String getLabel()
      Model label.
    • getTextures

      public Model.Texture[] getTextures()
      List of textures in the model.
    • getActiveTexture

      public Optional<Model.Texture> getActiveTexture(Model.TextureType type)
      Active texture of a given type, may be null.
    • setMesh

      public void setMesh(Optional<Model.Mesh> mesh)
      Model mesh, may be null.
    • getMesh

      public Optional<Model.Mesh> getMesh()
      Model mesh, may be null.
    • getPath

      public String getPath()
      Path to model file.
    • setMeta

      public void setMeta(Map<String,String> meta)
      Model meta data.
    • getMeta

      public Map<String,String> getMeta()
      Model meta data.
    • getFaceCount

      public int getFaceCount()
      Face count.
    • getVertexCount

      public int getVertexCount()
      Vertex count;
    • hasUV

      public boolean hasUV()
      Returns true if model has UV coordinates.
    • hasVertexColors

      public boolean hasVertexColors()
      Returns true if model has vertex colors.
    • hasVertexConfidence

      public boolean hasVertexConfidence()
      Returns true if model has confidence values.
    • pickPoint

      public Optional<Vector> pickPoint(Vector origin, Vector target)
      Returns ray intersection with the model surface.
      Parameters:
      origin - Ray origin.
      target - Point on the ray.
      Returns:
      Coordinates of the intersection point, may be null.
    • renderPreview

      public Image renderPreview(long width, long height, Matrix transform, Progress progress)
      Generate model preview image.
      Parameters:
      width - Preview image width.
      height - Preview image height.
      transform - 4x4 viewpoint transformation matrix.
      Returns:
      Preview image.