Module imp3d

Class VoronoiCell

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

public class VoronoiCell extends Sphere implements Pickable, Renderable, Raytraceable
See Also:
  • Field Details

    • showVoronoiNucleus

      protected boolean showVoronoiNucleus
    • showNeighbours

      protected boolean showNeighbours
    • showVoronoiDiagram

      protected boolean showVoronoiDiagram
    • showVoronoiFaces

      protected boolean showVoronoiFaces
    • showVoronoiPoints

      protected boolean showVoronoiPoints
    • showDelaunayDiagram

      protected boolean showDelaunayDiagram
    • showDelaunayFaces

      protected boolean showDelaunayFaces
    • showDelaunayPoints

      protected boolean showDelaunayPoints
    • $TYPE

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

      public static final Node.NType.Field showVoronoiNucleus$FIELD
    • showNeighbours$FIELD

      public static final Node.NType.Field showNeighbours$FIELD
    • showVoronoiDiagram$FIELD

      public static final Node.NType.Field showVoronoiDiagram$FIELD
    • showVoronoiFaces$FIELD

      public static final Node.NType.Field showVoronoiFaces$FIELD
    • showVoronoiPoints$FIELD

      public static final Node.NType.Field showVoronoiPoints$FIELD
    • showDelaunayDiagram$FIELD

      public static final Node.NType.Field showDelaunayDiagram$FIELD
    • showDelaunayFaces$FIELD

      public static final Node.NType.Field showDelaunayFaces$FIELD
    • showDelaunayPoints$FIELD

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

    • VoronoiCell

      public VoronoiCell()
    • VoronoiCell

      public VoronoiCell(float radius)
    • VoronoiCell

      public VoronoiCell(float radius, Tuple3d p)
    • VoronoiCell

      public VoronoiCell(float radius, double x, double y, double z)
    • VoronoiCell

      public VoronoiCell(float radius, double i, double j, double k, double scale)
  • Method Details

    • setTetrahedralization

      public void setTetrahedralization(Tetrahedralization tetrahedralization)
    • getX

      public double getX()
    • getY

      public double getY()
    • getZ

      public double getZ()
    • asPoint3f

      public Point3f asPoint3f()
    • asPoint3d

      public Point3d asPoint3d()
    • deleteAdjacent

      public final void deleteAdjacent()
      Account for the deletion of an adjacent tetrahedron.
    • getAdjacent

      public final Tetrahedron getAdjacent()
      Answer one of the adjacent tetrahedron
      Returns:
    • getOrder

      public final int getOrder()
      Answer the number of tetrahedra adjacent to the receiver vertex in the tetrahedralization

      Returns:
    • getVoronoiPointsSet

      public Set<Point3d> getVoronoiPointsSet()
      returns a set of points that build the voronoi faces for this VoronoiCell
      Returns:
      set of voronoi points
    • getVoronoiPointsArray

      public Point3d[] getVoronoiPointsArray()
      returns an array of points that build the voronoi faces for this VoronoiCell
      Returns:
      array of voronoi points
    • getVoronoiPointsList

      public List<Point3d> getVoronoiPointsList()
      returns a list of points that build the voronoi faces for this VoronoiCell
      Returns:
      list of voronoi points
    • getNeighboursAll

      public Collection<VoronoiCell> getNeighboursAll()
      Answer the collection of neighbouring VoronoiCells around this one.
      Returns:
      collection of neighbouring VoronoiCells
    • getNeighbours

      public Collection<VoronoiCell> getNeighbours()
      Answer the cleaned collection of neighbouring VoronoiCells around this one. (cleaned --> without VoronoiCell.getId()==-1)
      Returns:
      cleaned collection of neighbouring VoronoiCells
    • getNumberOfNeighboursAll

      public int getNumberOfNeighboursAll()
      Answer the number of neighbouring VoronoiCells around this one.
      Returns:
      number of neighbouring VoronoiCells
    • getNumberOfNeighbours

      public int getNumberOfNeighbours()
      Answer the number of neighbouring VoronoiCells around this one.
      Returns:
      number of neighbouring VoronoiCells
    • inSphere

      public final int inSphere(VoronoiCell a, VoronoiCell b, VoronoiCell c, VoronoiCell d)
      Return +1 if the receiver lies inside the sphere passing through a, b, c, and d; -1 if it lies outside; and 0 if the five points are cospherical. The vertices a, b, c, and d must be ordered so that they have a positive orientation (as defined by orientation(VoronoiCell, VoronoiCell, VoronoiCell)), or the sign of the result will be reversed.

      Parameters:
      a - , b, c, d - the points defining the sphere, in oriented order
      Returns:
      +1 if the receiver lies inside the sphere passing through a, b, c, and d; -1 if it lies outside; and 0 if the five points are cospherical
    • orientation

      public final int orientation(VoronoiCell a, VoronoiCell b, VoronoiCell c)
      Answer +1 if the orientation of the receiver is positive with respect to the plane defined by {a, b, c}, -1 if negative, or 0 if the test point is coplanar

      Parameters:
      a - , b, c - the points defining the plane
      Returns:
      +1 if the orientation of the query point is positive with respect to the plane, -1 if negative and 0 if the test point is coplanar
    • reset

      public final void reset()
      Reset the state associated with a tetrahedralization.
    • setAdjacent

      public final void setAdjacent(Tetrahedron tetrahedron)
      Note one of the adjacent tetrahedron

      Parameters:
      tetrahedron -
    • toString

      public String toString()
      Overrides:
      toString in class Node
    • pick

      public static void pick(float radius, Point3d origin, Vector3d direction, PickList list)
    • pick

      public void pick(Object object, boolean asNode, Point3d origin, Vector3d direction, Matrix4d t, PickList list)
      Description copied from interface: Pickable
      Computes intersections of a given ray with this shape.
      Specified by:
      pick in interface Pickable
      Overrides:
      pick in class Sphere
      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
      t - the transformation from local coordinates to world coordinates
      list - the list to which intersections have to be added
    • draw

      public void draw(Object object, boolean asNode, RenderState rs)
      Specified by:
      draw in interface Renderable
      Overrides:
      draw in class Sphere
    • isAuxiliary

      protected boolean isAuxiliary(Point3d[] face)
    • isAuxiliaryCell

      public boolean isAuxiliaryCell()
    • isInternalCell

      public boolean isInternalCell()
    • isBorderCell

      public boolean isBorderCell()
    • createRaytracerLeaf

      public RaytracerLeaf createRaytracerLeaf(Object object, boolean asNode, long pathId, GraphState gs)
      Specified by:
      createRaytracerLeaf in interface Raytraceable
      Overrides:
      createRaytracerLeaf in class Sphere
    • 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 Sphere
      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 Sphere
      Returns:
      new instance of class of this node
    • isShowVoronoiNucleus

      public boolean isShowVoronoiNucleus()
    • setShowVoronoiNucleus

      public void setShowVoronoiNucleus(boolean value)
    • isShowNeighbours

      public boolean isShowNeighbours()
    • setShowNeighbours

      public void setShowNeighbours(boolean value)
    • isShowVoronoiDiagram

      public boolean isShowVoronoiDiagram()
    • setShowVoronoiDiagram

      public void setShowVoronoiDiagram(boolean value)
    • isShowVoronoiFaces

      public boolean isShowVoronoiFaces()
    • setShowVoronoiFaces

      public void setShowVoronoiFaces(boolean value)
    • isShowVoronoiPoints

      public boolean isShowVoronoiPoints()
    • setShowVoronoiPoints

      public void setShowVoronoiPoints(boolean value)
    • isShowDelaunayDiagram

      public boolean isShowDelaunayDiagram()
    • setShowDelaunayDiagram

      public void setShowDelaunayDiagram(boolean value)
    • isShowDelaunayFaces

      public boolean isShowDelaunayFaces()
    • setShowDelaunayFaces

      public void setShowDelaunayFaces(boolean value)
    • isShowDelaunayPoints

      public boolean isShowDelaunayPoints()
    • setShowDelaunayPoints

      public void setShowDelaunayPoints(boolean value)
    • getSurfaceArea

      public double getSurfaceArea()
      Calculates the area of an object. Intersection with other object are not considered.The total area will be calculated.
      Overrides:
      getSurfaceArea in class Sphere
      Returns:
      volume
    • getVolume

      public double getVolume()
      Calculates the volume. Intersection with other object are not considered.The total volume will be calculated.
      Overrides:
      getVolume in class Sphere
      Returns:
      volume