Class Line

All Implemented Interfaces:
Pickable, Hintable, Renderable, Savable

public class Line extends Mesh
  • Constructor Details

    • Line

      public Line()
    • Line

      public Line(String name)
      Constructs a new line with the given name. By default, the line has no information.
      Parameters:
      name - The name of the line.
    • Line

      public Line(String name, FloatBuffer vertex, FloatBuffer normal, FloatBuffer color, FloatBufferData coords)
      Constructor instantiates a new Line object with a given set of data. Any data can be null except for the vertex list. If vertices are null an exception will be thrown.
      Parameters:
      name - the name of the scene element. This is required for identification and comparison purposes.
      vertex - the vertices that make up the lines.
      normal - the normals of the lines.
      color - the color of each point of the lines.
      coords - the texture coordinates of the lines.
    • Line

      public Line(String name, ReadOnlyVector3[] vertex, ReadOnlyVector3[] normal, ReadOnlyColorRGBA[] color, ReadOnlyVector2[] texture)
      Constructor instantiates a new Line object with a given set of data. Any data can be null except for the vertex list. If vertices are null an exception will be thrown.
      Parameters:
      name - the name of the scene element. This is required for identification and comparison purposes.
      vertex - the vertices that make up the lines.
      normal - the normals of the lines.
      color - the color of each point of the lines.
      texture - the texture coordinates of the lines.
  • Method Details

    • appendCircle

      public void appendCircle(double radius, double x, double y, int segments, boolean insideOut)
      Puts a circle into vertex and normal buffer at the current buffer position. The buffers are enlarged and copied if they are too small.
      Parameters:
      radius - radius of the circle
      x - x coordinate of circle center
      y - y coordinate of circle center
      segments - number of line segments the circle is built from
      insideOut - false for normal winding (ccw), true for clockwise winding
    • isAntialiased

      public boolean isAntialiased()
      Returns:
      true if points are to be drawn antialiased
    • setAntialiased

      public void setAntialiased(boolean antialiased)
      Sets whether the point should be antialiased. May decrease performance. If you want to enabled antialiasing, you should also use an alphastate with a source of SourceFunction.SourceAlpha and a destination of DB_ONE_MINUS_SRC_ALPHA or DB_ONE.
      Parameters:
      antialiased - true if the line should be antialiased.
    • getLineWidth

      public float getLineWidth()
      Returns:
      the width of this line.
    • setLineWidth

      public void setLineWidth(float lineWidth)
      Sets the width of the line when drawn. Non anti-aliased line widths are rounded to the nearest whole number by opengl.
      Parameters:
      lineWidth - The lineWidth to set.
    • getStipplePattern

      public short getStipplePattern()
      Returns:
      the set stipplePattern. 0xFFFF means no stipple.
    • setStipplePattern

      public void setStipplePattern(short stipplePattern)
      The stipple or pattern to use when drawing this line. 0xFFFF is a solid line.
      Parameters:
      stipplePattern - a 16bit short whose bits describe the pattern to use when drawing this line
    • getStippleFactor

      public int getStippleFactor()
      Returns:
      the set stippleFactor.
    • setStippleFactor

      public void setStippleFactor(int stippleFactor)
      Parameters:
      stippleFactor - magnification factor to apply to the stipple pattern.
    • makeCopy

      public Line makeCopy(boolean shareGeometricData)
      Description copied from class: Spatial
      Create a copy of this spatial.
      Overrides:
      makeCopy in class Mesh
      Parameters:
      shareGeometricData - if true, reuse any data fields describing the geometric shape of the spatial, as applicable.
      Returns:
      the copy as described.
    • write

      public void write(OutputCapsule capsule) throws IOException
      Specified by:
      write in interface Savable
      Overrides:
      write in class Mesh
      Parameters:
      capsule - the capsule
      Throws:
      IOException - Signals that an I/O exception has occurred.
      See Also:
    • read

      public void read(InputCapsule capsule) throws IOException
      Specified by:
      read in interface Savable
      Overrides:
      read in class Mesh
      Parameters:
      capsule - the input capsule
      Throws:
      IOException - Signals that an I/O exception has occurred.
      See Also:
    • render

      public void render(Renderer renderer)
      Description copied from interface: Renderable
      Render the object using the supplied renderer instance.
      Specified by:
      render in interface Renderable
      Overrides:
      render in class Mesh
      Parameters:
      renderer - the renderer