Class Diagram
java.lang.Object
org.stathissideris.ascii2image.graphics.Diagram
-
Constructor Summary
ConstructorDescriptionDiagram
(TextGrid grid, ConversionOptions options, ProcessingOptions processingOptions) An outline of the inner workings of this very important (and monstrous) constructor is presented here. -
Method Summary
Modifier and TypeMethodDescriptionReturns a list of all DiagramShapes in the Diagram, including the ones within CompositeDiagramShapesgetCellFor
(ShapePoint point) int
int
getCellMaxX
(TextGrid.Cell cell) static int
getCellMaxX
(TextGrid.Cell cell, int cellXSize) int
getCellMaxY
(TextGrid.Cell cell) static int
getCellMaxY
(TextGrid.Cell cell, int cellYSize) int
getCellMidX
(TextGrid.Cell cell) static int
getCellMidX
(TextGrid.Cell cell, int cellXSize) int
getCellMidY
(TextGrid.Cell cell) static int
getCellMidY
(TextGrid.Cell cell, int cellYSize) int
getCellMinX
(TextGrid.Cell cell) static int
getCellMinX
(TextGrid.Cell cell, int cellXSize) int
getCellMinY
(TextGrid.Cell cell) static int
getCellMinY
(TextGrid.Cell cell, int cellYSize) int
int
float
int
getWidth()
-
Constructor Details
-
Diagram
An outline of the inner workings of this very important (and monstrous) constructor is presented here. Boundary processing is the first step of the process:
- Copy the grid into a work grid and remove all type-on-line and point markers from the work grid
- Split grid into distinct shapes by plotting the grid onto an AbstractionGrid and its getDistinctShapes() method.
- Find all the possible boundary sets of each of the distinct shapes. This can produce duplicate shapes (if the boundaries are the same when filling from the inside and the outside).
- Remove duplicate boundaries.
- Remove obsolete boundaries. Obsolete boundaries are the ones that are the sum of their parts when plotted as filled shapes. (see method removeObsoleteShapes())
- Seperate the found boundary sets to open, closed or mixed (See CellSet class on how its done).
- Are there any closed boundaries?
- YES. Subtract all the closed boundaries from each of the open ones. That should convert the mixed shapes into open.
- NO. In this (harder) case, we use the method breakTrulyMixedBoundaries() of CellSet to break boundaries into open and closed shapes (would work in any case, but it's probably slower than the other method). This method is based on tracing from the lines' ends and splitting when we get to an intersection.
- If we had to eliminate any mixed shapes, we seperate the found boundary sets again to open, closed or mixed.
At this stage, the boundary processing is all complete and we proceed with using those boundaries to create the shapes:
- Create closed shapes.
- Create open shapes. That's when the line end corrections are also applied, concerning the positioning of the ends of lines see methods connectEndsToAnchors() and moveEndsToCellEdges() of DiagramShape.
- Assign color codes to closed shapes.
- Assing extended markup tags to closed shapes.
- Create arrowheads.
- Create point markers.
Finally, the text processing occurs: [pending]
- Parameters:
grid
-options
-processingOptions
-
-
-
Method Details
-
getAllDiagramShapes
Returns a list of all DiagramShapes in the Diagram, including the ones within CompositeDiagramShapes- Returns:
-
getMinimumOfCellDimension
public float getMinimumOfCellDimension() -
getShapesIterator
-
getHeight
public int getHeight()- Returns:
-
getWidth
public int getWidth()- Returns:
-
getCellWidth
public int getCellWidth()- Returns:
-
getCellHeight
public int getCellHeight()- Returns:
-
getCompositeShapes
- Returns:
-
getShapes
- Returns:
-
getCellMinX
-
getCellMinX
-
getCellMidX
-
getCellMidX
-
getCellMaxX
-
getCellMaxX
-
getCellMinY
-
getCellMinY
-
getCellMidY
-
getCellMidY
-
getCellMaxY
-
getCellMaxY
-
getCellFor
-
getTextObjects
- Returns:
-