Package cz.vutbr.fit.layout.vips.impl
Class VisualArea
- java.lang.Object
-
- cz.vutbr.fit.layout.vips.impl.VisualArea
-
public class VisualArea extends Object
A class that represents a visual area in the resulting constructed visual structure.- Author:
- Tomas Popela, burgetr
-
-
Constructor Summary
Constructors Constructor Description VisualArea()VisualArea(VisualArea src)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBlock(VisualBlock blockRoot)Adds a block to contained blocks.voidaddChild(VisualArea child)Adds a new child area to this area.voidaddChildren(List<VisualArea> children)Adds a set of children to the area.List<VisualBlock>getBlockRoots()Gets the visual blocks contained in this area.RectangulargetBounds()intgetDoC()Returns areas's degree of coherence DoC.List<VisualArea>getChildren()Gets all child areas.intgetMaxSeparator()Finds the maximal separator weight in this area and all sub-areas.List<Separator>getSeparators()Gets a list of separators contained in this area.intgetX1()intgetX2()intgetY1()intgetY2()booleanisEmpty()Checks whether the area is empty (it contains no visual blocks).booleanisFinished()Checks whether the visual area is finished.voidsetBlockRoots(List<VisualBlock> vipsBlocks)Sets the blocks contained in this area.voidsetBounds(Rectangular bounds)Sets the visual area bounds.voidsetDoC(int doC)voidsetFinished(boolean finished)voidsetSeparators(List<Separator> separators)Sets a list of separators contained in this area.voidsetX1(int x)voidsetX2(int x)voidsetY1(int y)voidsetY2(int y)StringtoString()
-
-
-
Constructor Detail
-
VisualArea
public VisualArea()
-
VisualArea
public VisualArea(VisualArea src)
-
-
Method Detail
-
getBlockRoots
public List<VisualBlock> getBlockRoots()
Gets the visual blocks contained in this area.- Returns:
- A list of visual blocks.
-
addBlock
public void addBlock(VisualBlock blockRoot)
Adds a block to contained blocks.- Parameters:
blockRoot- New block
-
setBlockRoots
public void setBlockRoots(List<VisualBlock> vipsBlocks)
Sets the blocks contained in this area.- Parameters:
vipsBlocks- a list of the block root nodes
-
isEmpty
public boolean isEmpty()
Checks whether the area is empty (it contains no visual blocks).- Returns:
truewhen the area is empty
-
addChild
public void addChild(VisualArea child)
Adds a new child area to this area.- Parameters:
child- New child area
-
addChildren
public void addChildren(List<VisualArea> children)
Adds a set of children to the area.- Parameters:
children-
-
getChildren
public List<VisualArea> getChildren()
Gets all child areas.- Returns:
- A list of child areas.
-
setSeparators
public void setSeparators(List<Separator> separators)
Sets a list of separators contained in this area.- Parameters:
separators- the new list of separators
-
getSeparators
public List<Separator> getSeparators()
Gets a list of separators contained in this area.- Returns:
- a list of separators
-
setBounds
public void setBounds(Rectangular bounds)
Sets the visual area bounds.- Parameters:
bounds- the new bounds.
-
setX1
public void setX1(int x)
-
setX2
public void setX2(int x)
-
setY1
public void setY1(int y)
-
setY2
public void setY2(int y)
-
getX1
public int getX1()
-
getX2
public int getX2()
-
getY1
public int getY1()
-
getY2
public int getY2()
-
getBounds
public Rectangular getBounds()
-
getDoC
public int getDoC()
Returns areas's degree of coherence DoC. The DoC of each new block is set based on the maximum weight of the separators in the block’s region.- Returns:
- Degree of coherence - DoC
-
setDoC
public void setDoC(int doC)
-
isFinished
public boolean isFinished()
Checks whether the visual area is finished. The area is finished when it cannot be segmented anymore.- Returns:
truewhen the area is finished
-
setFinished
public void setFinished(boolean finished)
-
getMaxSeparator
public int getMaxSeparator()
Finds the maximal separator weight in this area and all sub-areas.- Returns:
- the maximal separator weight
-
-