# Class VoronoiCore

java.lang.Object
com.treemap.swing.originalfastvoronoi.VoronoiCore

public class VoronoiCore extends Object
Core class for generating Voronoi Treemaps. position and weight of sites is changed on each iteration to get the wanted area for a cell.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected boolean`
  `cancelOnAreaErrorThreshold`
  `protected boolean`
  `cancelOnMaxIterat`
  `protected PolygonSimple`
  `clipPolygon`
  `protected double`
  `completeArea`
  `protected double`
  `currentAreaError`
  `protected double`
  `currentEuclidChange`
  Temporary, only for debugging
  `protected PowerDiagram`
  `diagram`
  `protected double`
  `errorAreaThreshold`
  `double`
  `lastAreaError`
  `double`
  `lastAVGError`
  `protected double`
  `lastEuclidChange`
  `double`
  `lastMaxError`
  `double`
  `lastSumErrorChange`
  `protected boolean`
  `preflowFinished`
  `protected OpenList`
  `sites`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `VoronoiCore()`
  `VoronoiCore(OpenList sites, PolygonSimple clipPolygon)`
  `VoronoiCore(PolygonSimple clipPolygon)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addSite(Site site)`
  Adds a site, which is a voronoi cell to the list
  `void`
  `doIterate()`
  `void`
  `doIterate(int iterationAmount)`
  `boolean`
  `getAggressiveMode()`
  `double`
  `getPreflowPercentage()`
  `OpenList`
  `getSites()`
  `boolean`
  `isCancelOnAreaErrorThreshold()`
  `boolean`
  `isUseExtrapolation()`
  `void`
  `iterate()`
  `static void`
  `main(String[] args)`
  `void`
  `setAggressiveMode(boolean aggressiveMode)`
  `void`
  `setCancelOnAreaErrorThreshold(boolean cancelOnThreshold)`
  `void`
  `setCancelOnMaxIterat(boolean cancelOnMaxIterat)`
  `void`
  `setClipPolygon(PolygonSimple polygon)`
  The resulting Voronoi Cells are clipped with this polygon
  `void`
  `setErrorAreaThreshold(double errorAreaThreshold)`
  `void`
  `setGuaranteeValidCells(boolean guaranteeInvariant)`
  `void`
  `setNumberMaxIterations(int numberMaxIterations)`
  `void`
  `setPreflowIncrease(double preflowIncrease)`
  If a region wants to increase its area by the factor preflowIncrease it is considered for preflow extrapolation.
  `void`
  `setPreflowPercentage(double preflowPercentage)`
  `void`
  `setSites(OpenList sites)`
  `void`
  `setUseExtrapolation(boolean useExtrapolation)`
  `void`
  `setUseNegativeWeights(boolean useNegativeWeights)`
  `void`
  `voroDiagram()`
  Computes the diagram and sets the results

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### cancelOnAreaErrorThreshold

    protected boolean cancelOnAreaErrorThreshold

  - ### cancelOnMaxIterat

    protected boolean cancelOnMaxIterat

  - ### errorAreaThreshold

    protected double errorAreaThreshold

  - ### clipPolygon

    protected PolygonSimple clipPolygon

  - ### sites

    protected OpenList sites

  - ### completeArea

    protected double completeArea

  - ### preflowFinished

    protected boolean preflowFinished

  - ### diagram

    protected PowerDiagram diagram

  - ### currentAreaError

    protected double currentAreaError

  - ### currentEuclidChange

    protected double currentEuclidChange
    Temporary, only for debugging

  - ### lastAreaError

    public double lastAreaError

  - ### lastAVGError

    public double lastAVGError

  - ### lastMaxError

    public double lastMaxError

  - ### lastSumErrorChange

    public double lastSumErrorChange

  - ### lastEuclidChange

    protected double lastEuclidChange

- ## Constructor Details

  - ### VoronoiCore

    public VoronoiCore()

  - ### VoronoiCore

    public VoronoiCore(PolygonSimple clipPolygon)

  - ### VoronoiCore

    public VoronoiCore(OpenList sites, PolygonSimple clipPolygon)

- ## Method Details

  - ### setClipPolygon

    public void setClipPolygon(PolygonSimple polygon)
    The resulting Voronoi Cells are clipped with this polygon
    Parameters:
      `polygon` -

  - ### addSite

    public void addSite(Site site)
    Adds a site, which is a voronoi cell to the list
    Parameters:
      `site` -

  - ### iterate

    public void iterate()

  - ### voroDiagram

    public void voroDiagram()
    Computes the diagram and sets the results

  - ### doIterate

    public void doIterate()

  - ### doIterate

    public void doIterate(int iterationAmount)

  - ### setCancelOnAreaErrorThreshold

    public void setCancelOnAreaErrorThreshold(boolean cancelOnThreshold)

  - ### isCancelOnAreaErrorThreshold

    public boolean isCancelOnAreaErrorThreshold()

  - ### setCancelOnMaxIterat

    public void setCancelOnMaxIterat(boolean cancelOnMaxIterat)

  - ### setErrorAreaThreshold

    public void setErrorAreaThreshold(double errorAreaThreshold)

  - ### setSites

    public void setSites(OpenList sites)

  - ### getSites

    public OpenList getSites()

  - ### setUseExtrapolation

    public void setUseExtrapolation(boolean useExtrapolation)

  - ### isUseExtrapolation

    public boolean isUseExtrapolation()

  - ### getPreflowPercentage

    public double getPreflowPercentage()

  - ### setPreflowIncrease

    public void setPreflowIncrease(double preflowIncrease)
    If a region wants to increase its area by the factor preflowIncrease it is considered for preflow extrapolation. default value is 1.6 (experimental)

  - ### setGuaranteeValidCells

    public void setGuaranteeValidCells(boolean guaranteeInvariant)

  - ### setNumberMaxIterations

    public void setNumberMaxIterations(int numberMaxIterations)

  - ### setPreflowPercentage

    public void setPreflowPercentage(double preflowPercentage)

  - ### setUseNegativeWeights

    public void setUseNegativeWeights(boolean useNegativeWeights)

  - ### setAggressiveMode

    public void setAggressiveMode(boolean aggressiveMode)

  - ### getAggressiveMode

    public boolean getAggressiveMode()

  - ### main

    public static void main(String[] args)
    Parameters:
      `args` -