Class PolygonObjParser.VertexAttributes

java.lang.Object
org.apache.commons.geometry.io.euclidean.threed.obj.PolygonObjParser.VertexAttributes
Enclosing class:
PolygonObjParser

public static final class PolygonObjParser.VertexAttributes extends Object
Class representing a set of attributes for a face vertex. All index values are 0-based and positive, in contrast with OBJ indices which are 1-based and support negative values. If an index value is not given in the OBJ content, it is set to -1.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
    Vertex normal index.
    private final int
    Texture coordinate index.
    private final int
    Vertex index.
  • Constructor Summary

    Constructors
    Constructor
    Description
    VertexAttributes(int vertexIndex, int textureIndex, int normalIndex)
    Construct a new instance with the given vertices.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Get the normal index for this instance or -1 if not specified in the OBJ content.
    int
    Get the texture index for this instance or -1 if not specified in the OBJ content.
    int
    Get the vertex position index for this instance.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • vertexIndex

      private final int vertexIndex
      Vertex index.
    • textureIndex

      private final int textureIndex
      Texture coordinate index.
    • normalIndex

      private final int normalIndex
      Vertex normal index.
  • Constructor Details

    • VertexAttributes

      VertexAttributes(int vertexIndex, int textureIndex, int normalIndex)
      Construct a new instance with the given vertices.
      Parameters:
      vertexIndex - vertex index
      textureIndex - texture index
      normalIndex - vertex normal index
  • Method Details

    • getVertexIndex

      public int getVertexIndex()
      Get the vertex position index for this instance. This value is required and is guaranteed to be a valid index into the list of vertex positions parsed so far in the OBJ content.
      Returns:
      vertex index
    • getTextureIndex

      public int getTextureIndex()
      Get the texture index for this instance or -1 if not specified in the OBJ content.
      Returns:
      texture index or -1 if not specified in the OBJ content.
    • getNormalIndex

      public int getNormalIndex()
      Get the normal index for this instance or -1 if not specified in the OBJ content.
      Returns:
      normal index or -1 if not specified in the OBJ content.