Module imp3d

Class FrustumIrregular

All Implemented Interfaces:
Transformation, Pickable, Renderable, Manageable, PersistenceCapable, Shareable, UserFields, XObject, Map, Serializable

public class FrustumIrregular extends FrustumBase implements Renderable
This class represents a frustum with a variable number of sectors for the top and bottom surface. This radii for each sector is variable. Primarily meant to represent a layer of a tree crown but can also be used generally as a 3D object.
Since:
30.7.2013
Author:
yong
See Also:
  • Field Details

    • sectorCount

      protected int sectorCount
    • baseRadii

      protected float[] baseRadii
    • topRadii

      protected float[] topRadii
    • $TYPE

      public static final Node.NType $TYPE
    • sectorCount$Field

      public static final Node.NType.Field sectorCount$Field
    • baseRadii$FIELD

      public static final Node.NType.Field baseRadii$FIELD
    • topRadii$FIELD

      public static final Node.NType.Field topRadii$FIELD
    • baseOpen$FIELD

      public static final Node.NType.Field baseOpen$FIELD
    • topOpen$FIELD

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

    • FrustumIrregular

      public FrustumIrregular()
    • FrustumIrregular

      public FrustumIrregular(float len, int sectorCount, float[] baseRadii, float[] topRadii)
    • FrustumIrregular

      public FrustumIrregular(int sectorCount, float[] baseRadii, float[] topRadii)
  • 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
    • draw

      public void draw(Object object, boolean asNode, RenderState rs)
      Specified by:
      draw in interface Renderable
    • pick

      public void pick(Object object, boolean asNode, Point3d origin, Vector3d direction, Matrix4d transformation, PickList list)
      Description copied from interface: Pickable
      Computes intersections of a given ray with this shape.
      Specified by:
      pick in interface Pickable
      Parameters:
      object - the object of which this shape is an attribute
      asNode - true iff object is a node
      origin - the origin of the ray, in local coordinates
      direction - the direction of the ray, in local coordinates
      transformation - the transformation from local coordinates to world coordinates
      list - the list to which intersections have to be added
    • getSectorCount

      public int getSectorCount()
    • getBaseRadii

      public float[] getBaseRadii()
    • getTopRadii

      public float[] getTopRadii()
    • setSectorCount

      public void setSectorCount(int value)
    • setBaseRadii

      public void setBaseRadii(float[] value)
    • setTopRadii

      public void setTopRadii(float[] value)
    • setBaseRadii

      public void setBaseRadii(int index, float value)
    • setTopRadii

      public void setTopRadii(int index, float value)
    • isBaseOpen

      public boolean isBaseOpen()
    • setBaseOpen

      public void setBaseOpen(boolean v)
    • isTopOpen

      public boolean isTopOpen()
    • setTopOpen

      public void setTopOpen(boolean v)
    • resetRadii

      public void resetRadii(int sectorCount, float radiusValue)
    • radiusMax

      public float radiusMax()
    • getSurfaceArea

      public double getSurfaceArea()
      Calculates the estimated surface area of this irregular frustum. Todo: returns 0
      Overrides:
      getSurfaceArea in class ShadedNull
      Returns:
      area
    • getVolume

      public double getVolume()
      Calculates the estimated volume of this irregular frustum. Assumes area of sector changes linearly from bottom to top.
      Overrides:
      getVolume in class ShadedNull
      Returns:
      volume