Class VisualArea


  • public class VisualArea
    extends Object
    A class that represents a visual area in the resulting constructed visual structure.
    Author:
    Tomas Popela, burgetr
    • 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()
      • 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