Class ObjFacetDefinitionReader

java.lang.Object
org.apache.commons.geometry.io.euclidean.threed.obj.AbstractObjPolygonReader
org.apache.commons.geometry.io.euclidean.threed.obj.ObjFacetDefinitionReader
All Implemented Interfaces:
Closeable, AutoCloseable, FacetDefinitionReader

public class ObjFacetDefinitionReader extends AbstractObjPolygonReader implements FacetDefinitionReader
Class for reading facets from OBJ content.
  • Field Details

    • vertices

      private final List<Vector3D> vertices
      List of vertices encountered in the input.
    • normals

      private final List<Vector3D> normals
      List of normals encountered in the input.
  • Constructor Details

    • ObjFacetDefinitionReader

      public ObjFacetDefinitionReader(Reader reader)
      Construct a new instance that reads OBJ content from the given reader.
      Parameters:
      reader - reader to read from
  • Method Details

    • readFacet

      public FacetDefinition readFacet()
      Return the next facet definition from the input source or null if no more facets are available.
      Specified by:
      readFacet in interface FacetDefinitionReader
      Returns:
      the next facet definition or null if no more facets are available
    • handleVertex

      protected void handleVertex(Vector3D vertex)
      Method called when a vertex is found in the OBJ content.
      Specified by:
      handleVertex in class AbstractObjPolygonReader
      Parameters:
      vertex - vertex value
    • handleNormal

      protected void handleNormal(Vector3D normal)
      Method called when a normal is found in the OBJ content.
      Specified by:
      handleNormal in class AbstractObjPolygonReader
      Parameters:
      normal - normal value