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 void
addBlock(VisualBlock blockRoot)
Adds a block to contained blocks.void
addChild(VisualArea child)
Adds a new child area to this area.void
addChildren(List<VisualArea> children)
Adds a set of children to the area.List<VisualBlock>
getBlockRoots()
Gets the visual blocks contained in this area.Rectangular
getBounds()
int
getDoC()
Returns areas's degree of coherence DoC.List<VisualArea>
getChildren()
Gets all child areas.int
getMaxSeparator()
Finds the maximal separator weight in this area and all sub-areas.List<Separator>
getSeparators()
Gets a list of separators contained in this area.int
getX1()
int
getX2()
int
getY1()
int
getY2()
boolean
isEmpty()
Checks whether the area is empty (it contains no visual blocks).boolean
isFinished()
Checks whether the visual area is finished.void
setBlockRoots(List<VisualBlock> vipsBlocks)
Sets the blocks contained in this area.void
setBounds(Rectangular bounds)
Sets the visual area bounds.void
setDoC(int doC)
void
setFinished(boolean finished)
void
setSeparators(List<Separator> separators)
Sets a list of separators contained in this area.void
setX1(int x)
void
setX2(int x)
void
setY1(int y)
void
setY2(int y)
String
toString()
-
-
-
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:
true
when 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:
true
when 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
-
-