public class SegmentationAreaTree extends java.lang.Object implements AreaTree
Modifier and Type | Field and Description |
---|---|
protected Page |
page
The source tree
|
protected AreaImpl |
rootarea
The root node area
|
Constructor and Description |
---|
SegmentationAreaTree(Page srcpage)
Create a new tree of areas by the analysis of a box tree
|
Modifier and Type | Method and Description |
---|---|
protected void |
createGrids(AreaImpl root)
Goes through all the areas in the tree and creates the grids in these areas
|
Area |
findBasicAreas()
Creates the area tree skeleton - selects the visible boxes and converts
them to areas
|
Area |
getAreaAt(int x,
int y)
Finds the bottom-most area node present at the given coordinates in the area tree.
|
Area |
getAreaByName(java.lang.String name)
Finds an area by the given name.
|
Area |
getRoot()
Obtains the root node of the area tree.
|
java.util.Set<Tag> |
getUsedTags()
Obtains all the tags that are really used in the tree.
|
static boolean |
isVisuallySeparated(Box box) |
protected Page page
protected AreaImpl rootarea
public SegmentationAreaTree(Page srcpage)
srcpage
- the source box treepublic Area getRoot()
AreaTree
public Area findBasicAreas()
protected void createGrids(AreaImpl root)
root
- the root node of the tree of areaspublic static boolean isVisuallySeparated(Box box)
public Area getAreaAt(int x, int y)
SearchableAreaContainer
getAreaAt
in interface SearchableAreaContainer
x
- the X coordinatey
- the Y coordinatenull
when no node is found.public Area getAreaByName(java.lang.String name)
SearchableAreaContainer
getAreaByName
in interface SearchableAreaContainer
name
- the name of the areanull
when nothing is found.public java.util.Set<Tag> getUsedTags()