Module rgg

Class F

All Implemented Interfaces:
Transformation, VertexSequence.Vertex, Manageable, PersistenceCapable, Shareable, UserFields, XObject, TurtleModifier, Map, Serializable
Direct Known Subclasses:
DTGShoot, MTGNode

public class F extends Shoot
The turtle command F(x) represents a cylinder along the local z-direction. In addition, this command translates the local coordinate system along the axis of the cylinder such that the origin of the children's coordinate system coincides with the center of the cylinder's top.
The diameter of the cylinder is diameter, if this value is non-negative, otherwise it is taken from the field localDiameter of the current TurtleState. The shader of the cylinder is defined by the color, if this value is non-negative, otherwise it is taken from the the current TurtleState. The length of the axis is defined by length.
This corresponds to the turtle command F(x) of the GROGRA software.
Author:
Ole Kniemeyer
See Also:
  • Field Details

    • length

      public float length
    • diameter

      public float diameter
    • color

      public int color
    • $TYPE

      public static final Node.NType $TYPE
    • length$FIELD

      public static final Node.NType.Field length$FIELD
    • diameter$FIELD

      public static final Node.NType.Field diameter$FIELD
    • color$FIELD

      public static final Node.NType.Field color$FIELD
  • Constructor Details

    • F

      public F()
    • F

      public F(float argument)
    • F

      public F(float length, float diameter, int color)
    • F

      public F(float length, float diameter)
  • Method Details

    • getNTypeImpl

      protected Node.NType getNTypeImpl()
      Description copied from class: Node
      This method returns the Node.NType which describes the managed fields of the class of this node. This method has to be implemented in every concrete subclass.
      Overrides:
      getNTypeImpl in class ShadedNull
      Returns:
      type describing the managed fields of the class of this node
    • newInstance

      protected Node newInstance()
      Description copied from class: Node
      This method returns a new instance of the class of this node. This method has to be implemented in every concrete subclass.
      Overrides:
      newInstance in class ShadedNull
      Returns:
      new instance of class of this node
    • getFloat

      protected float getFloat(FloatAttribute a, GraphState gs)
      Overrides:
      getFloat in class Shoot
    • getInt

      protected int getInt(IntAttribute a, GraphState gs)
      Overrides:
      getInt in class Shoot
    • getLength

      public float getLength(Object node, GraphState gs)
      Specified by:
      getLength in class TurtleStep
    • getSurfaceArea

      public double getSurfaceArea()
      Calculates the area of an object. Intersection with other object are not considered.The total area will be calculated. A=2*Pi*r*h
      Overrides:
      getSurfaceArea in class ShadedNull
      Returns:
      volume
    • getVolume

      public double getVolume()
      Calculates the volume. Intersection with other object are not considered.The total volume will be calculated. V=Pi*r^2*h
      Overrides:
      getVolume in class ShadedNull
      Returns:
      volume