Packagecom.yworks.yfiles.layout.router.polyline
Classpublic class DynamicObstacleDecomposition
InheritanceDynamicObstacleDecomposition Inheritance YObject Inheritance Object
Implements ObstaclePartition, DynamicDecomposition

An com.yworks.yfiles.layout.router.polyline.ObstaclePartition that decomposes its area dynamically and implements the com.yworks.yfiles.layout.router.polyline.DynamicDecomposition interface.

The partitioning strategy is based on binary space partitioning. It divides the partition space recursively in two cells until each cell is completely covered from one or more obstacles or completely empty.

See also

com.yworks.yfiles.layout.router.polyline.ObstaclePartition
com.yworks.yfiles.layout.router.polyline.DynamicDecomposition


Public Properties
 PropertyDefined By
  bounds : YRectangle
[read-only] Returns the bounds of the decomposition area.
DynamicObstacleDecomposition
  cutObstacleCost : Number
Specifies the costs incurred for every obstacle that must be cut in a subdivision.
DynamicObstacleDecomposition
  unbalancedObstaclesCost : Number
Specifies the costs incurred if the distribution after a subdivision of obstacles is unbalanced in sub-cells.
DynamicObstacleDecomposition
  unbalancedRatioCost : Number
Specifies the costs incurred if the subdivision produces unbalanced rectangles.
DynamicObstacleDecomposition
Public Methods
 MethodDefined By
  
DynamicObstacleDecomposition(init:Boolean = true)
Constructs a dynamic obstacle decomposition.
DynamicObstacleDecomposition
  
Adds the given dynamic decomposition listener to receive com.yworks.yfiles.layout.router.polyline.PartitionCell subdivision and creation events from this decomposition.
DynamicObstacleDecomposition
  
clear():void
DynamicObstacleDecomposition
 Inherited
equals(o:Object):Boolean
YObject
  
Returns the com.yworks.yfiles.layout.router.polyline.PartitionCell s in which the given rectangle lies.
DynamicObstacleDecomposition
  
Returns all cells that are completely covered by the given obstacle.
DynamicObstacleDecomposition
  
getClass():Class
[override]
DynamicObstacleDecomposition
  
Returns the already existing (leaf) com.yworks.yfiles.layout.router.polyline.PartitionCell s within the given rectangle.
DynamicObstacleDecomposition
  
Returns the neighbor cells of the given cell.
DynamicObstacleDecomposition
  
Returns all obstacles that cover the given partition cell.
DynamicObstacleDecomposition
 Inherited
hashCode():int
YObject
  
init(obstacles:List, partitionBounds:YRectangle):void
Initializes this dynamic obstacle decomposition with the given obstacles and partition bounds.
DynamicObstacleDecomposition
  
[static] Constructs a dynamic obstacle decomposition.
DynamicObstacleDecomposition
  
Removes the given dynamic decomposition listener so that it no longer receives com.yworks.yfiles.layout.router.polyline.PartitionCell subdivision and creation events from this decomposition.
DynamicObstacleDecomposition
Protected Methods
 MethodDefined By
  
Notifies all registered dynamic decomposition listeners about the newly created cell.
DynamicObstacleDecomposition
  
Notifies all registered dynamic decomposition listeners about the finalized cell.
DynamicObstacleDecomposition
  
Notifies all registered dynamic decomposition listeners about a subdivision.
DynamicObstacleDecomposition
  
getGeometricCutCosts(cut:Number, min:Number, max:Number, orthogonalMin:Number, orthogonalMax:Number):Number
Calculates the cost of a cut with respect to the geometry of the sub-cells.
DynamicObstacleDecomposition
  
getObstacleCutCosts(numObstaclesInFirstHalf:int, numObstaclesInSecondHalf:int, numObstaclesOnCut:int):Number
Calculates the cost of a cut with respect to the subdivided obstacles.
DynamicObstacleDecomposition
  
Initializes this object.
DynamicObstacleDecomposition
Property Detail
boundsproperty
bounds:YRectangle  [read-only]

Returns the bounds of the decomposition area.


Implementation
    public function get bounds():YRectangle
cutObstacleCostproperty 
cutObstacleCost:Number

Specifies the costs incurred for every obstacle that must be cut in a subdivision.


Implementation
    public function get cutObstacleCost():Number
    public function set cutObstacleCost(value:Number):void
unbalancedObstaclesCostproperty 
unbalancedObstaclesCost:Number

Specifies the costs incurred if the distribution after a subdivision of obstacles is unbalanced in sub-cells.


Implementation
    public function get unbalancedObstaclesCost():Number
    public function set unbalancedObstaclesCost(value:Number):void
unbalancedRatioCostproperty 
unbalancedRatioCost:Number

Specifies the costs incurred if the subdivision produces unbalanced rectangles.


Implementation
    public function get unbalancedRatioCost():Number
    public function set unbalancedRatioCost(value:Number):void
Constructor Detail
DynamicObstacleDecomposition()Constructor
public function DynamicObstacleDecomposition(init:Boolean = true)

Constructs a dynamic obstacle decomposition.

Parameters
init:Boolean (default = true) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods. This parameter can safely be ignored/omitted when calling the constructor.
Method Detail
addDynamicDecompositionListener()method
public function addDynamicDecompositionListener(listener:DynamicDecomposition_Listener):void

Adds the given dynamic decomposition listener to receive com.yworks.yfiles.layout.router.polyline.PartitionCell subdivision and creation events from this decomposition. These events occur when the decomposition changes the partition by subdividing cells into sub-cells or new cell are created.

Parameters

listener:DynamicDecomposition_Listener — the dynamic decomposition listener.

See also

clear()method 
public function clear():void

fireCreateCellEvent()method 
protected function fireCreateCellEvent(createdCell:PartitionCell):void

Notifies all registered dynamic decomposition listeners about the newly created cell.

Parameters

createdCell:PartitionCell — The newly created cell.

See also

fireFinalizeCellEvent()method 
protected function fireFinalizeCellEvent(finalizedCell:PartitionCell):void

Notifies all registered dynamic decomposition listeners about the finalized cell.

Parameters

finalizedCell:PartitionCell — The cell that has been finalized.

See also

fireSubdividedEvent()method 
protected function fireSubdividedEvent(cell:PartitionCell, subCells:List):void

Notifies all registered dynamic decomposition listeners about a subdivision.

Parameters

cell:PartitionCell — The cell that has been subdivided.
 
subCells:List — The new sub cells of the divided cell.

See also

getCells()method 
public function getCells(rect:YRectangle):List

Returns the com.yworks.yfiles.layout.router.polyline.PartitionCell s in which the given rectangle lies.

Parameters

rect:YRectangle — The rectangle to get the cells for.

Returns
List — The cells in which the given rectangle lies.

See also

getCells2()method 
public function getCells2(obstacle:Obstacle):List

Returns all cells that are completely covered by the given obstacle.

Parameters

obstacle:Obstacle — The obstacle to get the covered cells for.

Returns
List — An unmodifiable list of com.yworks.yfiles.layout.router.polyline.PartitionCell instances that are completely covered by the given obstacle.

See also

getClass()method 
override public function getClass():Class

Returns
Class
getExistingCells()method 
public function getExistingCells(rect:YRectangle):List

Returns the already existing (leaf) com.yworks.yfiles.layout.router.polyline.PartitionCell s within the given rectangle.

Parameters

rect:YRectangle — The rectangle to get the cells for.

Returns
List — The cells in which the given rectangle lies.

See also

getGeometricCutCosts()method 
protected function getGeometricCutCosts(cut:Number, min:Number, max:Number, orthogonalMin:Number, orthogonalMax:Number):Number

Calculates the cost of a cut with respect to the geometry of the sub-cells. The cost ranges between 0 and 1.

Parameters

cut:Number — The coordinate of the cut.
 
min:Number — The left side of the subdivided cell.
 
max:Number — The right side of the subdivided cell.
 
orthogonalMin:Number — The upper side of the subdivided cell.
 
orthogonalMax:Number — The lower side of the subdivided cell.

Returns
Number — Costs of a cut with respect to the geometry of the sub-cells.
getNeighbors()method 
public function getNeighbors(cell:PartitionCell):List

Returns the neighbor cells of the given cell.

Parameters

cell:PartitionCell — The cell to get the neighbors for.

Returns
List — The neighbor cells of the given cell.
getObstacleCutCosts()method 
protected function getObstacleCutCosts(numObstaclesInFirstHalf:int, numObstaclesInSecondHalf:int, numObstaclesOnCut:int):Number

Calculates the cost of a cut with respect to the subdivided obstacles. The cost ranges between 0 and 1.

Parameters

numObstaclesInFirstHalf:int — The number of obstacles that lie completely in the first half.
 
numObstaclesInSecondHalf:int — The number of obstacles that lie completely in the second half.
 
numObstaclesOnCut:int — The number of obstacles that lie on the cut.

Returns
Number — Costs of a cut with respect to the subdivided obstacles.
getObstacles()method 
public function getObstacles(cell:PartitionCell):List

Returns all obstacles that cover the given partition cell.

Parameters

cell:PartitionCell — The cell to get the obstacles for.

Returns
List — An unmodifiable list of com.yworks.yfiles.layout.router.polyline.Obstacle instances that cover the given cell.

See also

init()method 
public function init(obstacles:List, partitionBounds:YRectangle):void

Initializes this dynamic obstacle decomposition with the given obstacles and partition bounds. This method must be called before any other method is invoked.

Parameters

obstacles:List — A list of com.yworks.yfiles.layout.router.polyline.Obstacle objects.
 
partitionBounds:YRectangle — The bounds of the partition.

See also

initDynamicObstacleDecomposition()method 
protected final function initDynamicObstacleDecomposition():void

Initializes this object. See the documentation of the corresponding factory method newDynamicObstacleDecomposition() for details.

See also

newDynamicObstacleDecomposition()method 
public static function newDynamicObstacleDecomposition():DynamicObstacleDecomposition

Constructs a dynamic obstacle decomposition.

Returns
DynamicObstacleDecomposition
removeDynamicDecompositionListener()method 
public function removeDynamicDecompositionListener(listener:DynamicDecomposition_Listener):void

Removes the given dynamic decomposition listener so that it no longer receives com.yworks.yfiles.layout.router.polyline.PartitionCell subdivision and creation events from this decomposition.

Parameters

listener:DynamicDecomposition_Listener — the dynamic decomposition listener.

See also