umbrello/umbrello
#include <layoutgenerator.h>
Public Types | |
typedef QList< QPointF > | EdgePoints |
typedef QHash< QString, EdgePoints > | EdgeType |
typedef QHash< QString, QRectF > | NodeType |
Public Member Functions | |
LayoutGenerator () | |
bool | apply (UMLScene *scene) |
bool | generate (UMLScene *scene, const QString &variant=QString()) |
bool | isEnabled () |
Public Member Functions inherited from DotGenerator | |
DotGenerator () | |
bool | createDotFile (UMLScene *scene, const QString &fileName, const QString &variant="default") |
bool | readConfigFile (QString diagramType, const QString &variant="default") |
void | setUseFullNodeLabels (bool state) |
void | setUsePosition (bool state) |
bool | useFullNodeLabels () |
bool | usePosition () |
Static Public Member Functions | |
static bool | availableConfigFiles (UMLScene *scene, QHash< QString, QString > &configFiles) |
static QString | currentDotPath () |
Static Public Member Functions inherited from DotGenerator | |
static bool | availableConfigFiles (UMLScene *scene, QHash< QString, QString > &configFiles) |
Protected Member Functions | |
QPointF | mapToScene (const QPointF &p) |
QPoint | origin (const QString &id) |
bool | parseLine (const QString &line) |
bool | readGeneratedDotFile (const QString &fileName) |
Protected Member Functions inherited from DotGenerator | |
bool | findItem (QStringList ¶ms, const QString &search) |
QString | fixID (const QString &_id) |
Protected Attributes | |
QRectF | m_boundingRect |
QString | m_dotPath |
QHash< QString, QPointF > | m_edgeLabelPosition |
EdgeType | m_edges |
NodeType | m_nodes |
Protected Attributes inherited from DotGenerator | |
QString | m_configFileName |
QHash< QString, QString > | m_dotParameters |
QHash< QString, QString > | m_edgeParameters |
QString | m_generator |
QHash< QString, QString > | m_nodeParameters |
QPointF | m_origin |
double | m_scale |
bool | m_useFullNodeLabels |
bool | m_usePosition |
Friends | |
QDebug | operator<< (QDebug out, LayoutGenerator &c) |
Detailed Description
The class LayoutGenerator provides calculated layouts of diagrams.
It uses the dot executable from the graphviz package for calculation of widget positions.
The implementation calls dot with information from the displayed widgets and associations by creating a temporary dot file based on a layout configure file, which is located in the umbrello/layouts subdir of the "data" resource type. The config file is determined from the type of the currently displayed diagram and the layout chosen by the user.
Dot creates a file containing the calculated widget positions. The widget positions are retrieved from this file and used to move widgets on the provided diagram. Additional points in association lines are removed.
Definition at line 89 of file layoutgenerator.h.
Member Typedef Documentation
typedef QList<QPointF> LayoutGenerator::EdgePoints |
Definition at line 93 of file layoutgenerator.h.
typedef QHash<QString,EdgePoints> LayoutGenerator::EdgeType |
Definition at line 94 of file layoutgenerator.h.
typedef QHash<QString,QRectF> LayoutGenerator::NodeType |
Definition at line 92 of file layoutgenerator.h.
Constructor & Destructor Documentation
|
inline |
constructor
Definition at line 99 of file layoutgenerator.h.
Member Function Documentation
|
inline |
apply auto layout to the given scene
- Parameters
-
scene
- Returns
- true if autolayout has been applied
Definition at line 229 of file layoutgenerator.h.
|
inlinestatic |
Return a list of available templates for a given scene type.
- Parameters
-
scene The diagram configFiles will contain the collected list of config files
- Returns
- true if collecting succeeds
Definition at line 304 of file layoutgenerator.h.
|
inlinestatic |
Return the path where dot is installed.
- Returns
- string with dot path
Definition at line 127 of file layoutgenerator.h.
|
inline |
generate layout and apply it to the given diagram.
- Returns
- true if generating succeeded
Definition at line 156 of file layoutgenerator.h.
|
inline |
Return state if layout generator is enabled.
It is enabled when the dot application has been found.
- Returns
- true if enabled
Definition at line 110 of file layoutgenerator.h.
|
inlineprotected |
map dot coordinate to scene coordinate
- Parameters
-
p dot point to map
- Returns
- uml scene coordinate
Definition at line 587 of file layoutgenerator.h.
|
inlineprotected |
Return the origin of node based on the bottom/left corner.
- Parameters
-
id The widget id to fetch the origin from
- Returns
- QPoint instance with the coordinates
Definition at line 332 of file layoutgenerator.h.
|
inlineprotected |
Parse line from dot generated plain-ext output format.
The format is documented at http://graphviz.org/content/output-formats#dplain-ext and looks like:
graph 1 28.083 10.222 node ITfDmJvJE00m 8.0833 8.7361 0.86111 0.45833 QObject solid box black lightgrey edge sL4cKPpHnJkU sL4cKPpHnJkU 7 8.1253 7.2568 8.2695 7.2687 8.375 7.3127 8.375 7.3889 8.375 7.4377 8.3317 7.4733 8.2627 7.4957 Aggregation 8.8472 7.3889 solid black
- Parameters
-
line line in dot plain-ext output format
- Returns
- true if line could be parsed successfully
Definition at line 384 of file layoutgenerator.h.
|
inlineprotected |
Read generated dot file and extract positions of the contained widgets.
- Returns
- true if extracting succeeded
Definition at line 355 of file layoutgenerator.h.
Friends And Related Function Documentation
|
friend |
Member Data Documentation
|
protected |
Definition at line 592 of file layoutgenerator.h.
|
protected |
contains path to dot executable
Definition at line 596 of file layoutgenerator.h.
|
protected |
contains global node parameters
Definition at line 595 of file layoutgenerator.h.
|
protected |
list of edges found in parsed dot file
Definition at line 594 of file layoutgenerator.h.
|
protected |
list of nodes found in parsed dot file
Definition at line 593 of file layoutgenerator.h.
The documentation for this class was generated from the following file:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.