Package org.bzdev.p3d

Interface Model3DOps<T extends Model3DOps.Triangle>

All Superinterfaces:
Shape3D
All Known Implementing Classes:
Model3D

public interface Model3DOps<T extends Model3DOps.Triangle> extends Shape3D
Class providing basic operations for a Model3D. The operations included are ones needed to add objects to a model.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Interface providing basic operations for triangles.
  • Method Summary

    Modifier and Type
    Method
    Description
    addFlippedTriangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3)
    Add a flipped triangle to the model, specifying the triangle by its vertices.
    addFlippedTriangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, Color color)
    Add a flipped triangle to the model, specifying the triangle by its vertices and color.
    addFlippedTriangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, Color color, Object tag)
    Add a flipped triangle to the model, specifying the triangle by its vertices and color, also specifying a tag.
    void
    Add an existing model to this model.
    void
    addModel(Model3DOps<?> m3d, Object tag)
    Add an existing model to this model, providing a tag.
    addTriangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3)
    Add a triangle to the model, specifying the triangle by its vertices.
    addTriangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, Color color)
    Add a triangle to the model, specifying the triangle by its vertices and its color.
    addTriangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, Color color, Object tag)
    Add a triangle to the model, specifying the triangle by its vertices and its color, also specifying a tag.
    Add a triangle to the model.
  • Method Details

    • addModel

      void addModel(Model3DOps<?> m3d)
      Add an existing model to this model.
      Parameters:
      m3d - the model to add
    • addModel

      void addModel(Model3DOps<?> m3d, Object tag)
      Add an existing model to this model, providing a tag.
      Parameters:
      m3d - the model to add
      tag - the tag naming the objects in this model
    • addTriangle

      T addTriangle(Model3DOps.Triangle triangle)
      Add a triangle to the model. The triangle that is stored may differ from the triangle passed as this method's argument: while the type may be different, some classes that implement Model3DOps can apply transformations and will need to create a different triangle as a result.
      Parameters:
      triangle - the triangle to add
      Returns:
      the triangle stored by this model
    • addTriangle

      T addTriangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3) throws IllegalArgumentException
      Add a triangle to the model, specifying the triangle by its vertices. The orientation of the triangle is determined by the right-hand rule when going from vertex 1 to vertex 2 to vertex 3.
      Parameters:
      x1 - the x coordinate of vertex 1
      y1 - the y coordinate of vertex 1
      z1 - the z coordinate of vertex 1
      x2 - the x coordinate of vertex 2
      y2 - the y coordinate of vertex 2
      z2 - the z coordinate of vertex 2
      x3 - the x coordinate of vertex 3
      y3 - the y coordinate of vertex 3
      z3 - the z coordinate of vertex 3
      Returns:
      the triangle stored by this model
      Throws:
      IllegalArgumentException - one of the first 9 arguments had the value Double.NaN
    • addFlippedTriangle

      T addFlippedTriangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3) throws IllegalArgumentException
      Add a flipped triangle to the model, specifying the triangle by its vertices. The orientation of the triangle is the opposite to what the right-hand rule when going from vertex 1 to vertex 2 to vertex 3 would suggest.
      Parameters:
      x1 - the x coordinate of vertex 1
      y1 - the y coordinate of vertex 1
      z1 - the z coordinate of vertex 1
      x2 - the x coordinate of vertex 2
      y2 - the y coordinate of vertex 2
      z2 - the z coordinate of vertex 2
      x3 - the x coordinate of vertex 3
      y3 - the y coordinate of vertex 3
      z3 - the z coordinate of vertex 3
      Returns:
      the triangle stored by this model
      Throws:
      IllegalArgumentException - one of the first 9 arguments had the value Double.NaN
    • addTriangle

      T addTriangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, Color color) throws IllegalArgumentException
      Add a triangle to the model, specifying the triangle by its vertices and its color. The orientation of the triangle is determined by the right-hand rule when going from vertex 1 to vertex 2 to vertex 3.
      Parameters:
      x1 - the x coordinate of vertex 1
      y1 - the y coordinate of vertex 1
      z1 - the z coordinate of vertex 1
      x2 - the x coordinate of vertex 2
      y2 - the y coordinate of vertex 2
      z2 - the z coordinate of vertex 2
      x3 - the x coordinate of vertex 3
      y3 - the y coordinate of vertex 3
      z3 - the z coordinate of vertex 3
      color - the color of the triangle; null if none is specified
      Returns:
      the triangle stored by this model
      Throws:
      IllegalArgumentException - one of the first 9 arguments had the value Double.NaN
    • addFlippedTriangle

      T addFlippedTriangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, Color color) throws IllegalArgumentException
      Add a flipped triangle to the model, specifying the triangle by its vertices and color. The orientation of the triangle is the opposite to what the right-hand rule when going from vertex 1 to vertex 2 to vertex 3 would suggest.
      Parameters:
      x1 - the x coordinate of vertex 1
      y1 - the y coordinate of vertex 1
      z1 - the z coordinate of vertex 1
      x2 - the x coordinate of vertex 2
      y2 - the y coordinate of vertex 2
      z2 - the z coordinate of vertex 2
      x3 - the x coordinate of vertex 3
      y3 - the y coordinate of vertex 3
      z3 - the z coordinate of vertex 3
      color - the color of the triangle; null if none is specified
      Returns:
      the triangle stored by this model
      Throws:
      IllegalArgumentException - one of the first 9 arguments had the value Double.NaN
    • addTriangle

      T addTriangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, Color color, Object tag) throws IllegalArgumentException
      Add a triangle to the model, specifying the triangle by its vertices and its color, also specifying a tag. The orientation of the triangle is determined by the right-hand rule when going from vertex 1 to vertex 2 to vertex 3.
      Parameters:
      x1 - the x coordinate of vertex 1
      y1 - the y coordinate of vertex 1
      z1 - the z coordinate of vertex 1
      x2 - the x coordinate of vertex 2
      y2 - the y coordinate of vertex 2
      z2 - the z coordinate of vertex 2
      x3 - the x coordinate of vertex 3
      y3 - the y coordinate of vertex 3
      z3 - the z coordinate of vertex 3
      color - the color of the triangle; null if none is specified
      tag - the tag; null if there is none
      Returns:
      the triangle stored by this model
      Throws:
      IllegalArgumentException - a tag was a triangle or one of the first 9 arguments had the value Double.NaN
    • addFlippedTriangle

      T addFlippedTriangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, Color color, Object tag) throws IllegalArgumentException
      Add a flipped triangle to the model, specifying the triangle by its vertices and color, also specifying a tag. The orientation of the triangle is the opposite to what the right-hand rule when going from vertex 1 to vertex 2 to vertex 3 would suggest.
      Parameters:
      x1 - the x coordinate of vertex 1
      y1 - the y coordinate of vertex 1
      z1 - the z coordinate of vertex 1
      x2 - the x coordinate of vertex 2
      y2 - the y coordinate of vertex 2
      z2 - the z coordinate of vertex 2
      x3 - the x coordinate of vertex 3
      y3 - the y coordinate of vertex 3
      z3 - the z coordinate of vertex 3
      color - the color of the triangle; null if none is specified
      tag - the tag; null if there is none
      Returns:
      the triangle stored by this model
      Throws:
      IllegalArgumentException - a tag was a triangle or one of the first 9 arguments had the value Double.NaN