umbrello 2.32.3 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

layoutgenerator.h
Go to the documentation of this file.
1 /***************************************************************************
2 * This program is free software; you can redistribute it and/or modify *
3 * it under the terms of the GNU General Public License as published by *
4 * the Free Software Foundation; either version 2 of the License, or *
5 * (at your option) any later version. *
6 * *
7 * copyright (C) 2012-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef LAYOUTGENERATOR_H
12
13 #include "dotgenerator.h"
14 #include "optionstate.h"
15
17 #include <QRectF>
18
38 class LayoutGenerator : public DotGenerator
39 {
40 public:
41 typedef QHash<QString,QRectF> NodeType;
42 typedef QList<QPointF> EdgePoints;
43 typedef QHash<QString,EdgePoints> EdgeType;
44 typedef QMap<QString,QStringList> ParameterList;
45
46 LayoutGenerator();
47
48 bool isEnabled();
49 bool generate(UMLScene *scene, const QString &variant = QString());
50 bool apply(UMLScene *scene);
51 static bool availableConfigFiles(UMLScene *scene, QHash<QString,QString> &configFiles);
52 QPointF origin(const QString &id);
53 bool readGeneratedDotFile(const QString &fileName);
54 bool parseLine(const QString &line);
55 bool splitParameters(QMap<QString,QStringList> &map, const QString &s);
56 QPointF mapToScene(const QPointF &p);
57
58 protected:
59 QRectF m_boundingRect;
60 NodeType m_nodes;
61 EdgeType m_edges;
62 QHash<QString, QPointF> m_edgeLabelPosition;
63
64 friend QDebug operator<<(QDebug out, LayoutGenerator &c);
65 };
66
67 #if 0
68 static QDebug operator<<(QDebug out, LayoutGenerator &c);
69 #endif
70
71 #endif
UMLWidget::height
qreal height() const
Definition: umlwidget.h:114
associationline.h
LayoutGenerator
Definition: layoutgenerator.h:39
AssociationWidget
This class represents an association inside a diagram. Bugs and comments to umbrello-devel@kde....
Definition: associationwidget.h:52
x
int x
Definition: cxx11-lambda-functions-and-expressions.h:4
DotGenerator::generatorFullPath
QString generatorFullPath()
Definition: dotgenerator.cpp:194
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:41
UMLScene::associationList
const AssociationWidgetList associationList() const
Definition: umlscene.cpp:589
DotGenerator::m_version
int m_version
version of graphviz generator
Definition: dotgenerator.h:59
DotGenerator::setUseFullNodeLabels
void setUseFullNodeLabels(bool state)
Definition: dotgenerator.cpp:236
AssociationLine::count
int count() const
Definition: associationline.cpp:152
DotGenerator
Definition: dotgenerator.h:25
AssociationWidget::associationLine
AssociationLine * associationLine() const
Definition: associationwidget.cpp:658
DotGenerator::createDotFile
bool createDotFile(UMLScene *scene, const QString &fileName, const QString &variant=QLatin1String("default"))
Definition: dotgenerator.cpp:377
LayoutGenerator::mapToScene
QPointF mapToScene(const QPointF &p)
Definition: layoutgenerator.cpp:602
WidgetBase::localID
Uml::ID::Type localID() const
Definition: widgetbase.cpp:238
LayoutGenerator::isEnabled
bool isEnabled()
Definition: layoutgenerator.cpp:99
AssociationLine::removePoint
void removePoint(int index)
Definition: associationline.cpp:138
LayoutGenerator::ParameterList
QMap< QString, QStringList > ParameterList
Definition: layoutgenerator.h:44
Uml::RoleType::A
@ A
Definition: basictypes.h:239
DotGenerator::m_dotPath
QString m_dotPath
contains path to generator executable
Definition: dotgenerator.h:58
Uml::ID::toString
QString toString(const ID::Type &id)
Definition: basictypes.cpp:1263
cmds.h
Uml::AssociationType::toString
QString toString(Enum item)
Definition: basictypes.cpp:283
pngViewer
static QString pngViewer()
Definition: layoutgenerator.cpp:53
DotGenerator::m_scale
double m_scale
scale factor
Definition: dotgenerator.h:49
optionstate.h
Settings::optionState
OptionState & optionState()
Definition: optionstate.cpp:362
AssociationWidget::associationType
Uml::AssociationType::Enum associationType() const
Definition: associationwidget.cpp:1401
floatingtextwidget.h
LayoutGenerator::origin
QPointF origin(const QString &id)
Definition: layoutgenerator.cpp:346
AssociationWidget::widgetLocalIDForRole
Uml::ID::Type widgetLocalIDForRole(Uml::RoleType::Enum role) const
Definition: associationwidget.cpp:1469
UMLWidget::setStartMovePosition
void setStartMovePosition(const QPointF &position)
Definition: umlwidget.cpp:607
UMLWidget::setX
virtual void setX(qreal x)
Definition: umlwidget.cpp:1685
Uml::LayoutType::Spline
@ Spline
Definition: basictypes.h:149
Uml::LayoutType::Polyline
@ Polyline
Definition: basictypes.h:148
a
QString a
Definition: petalnode.cpp:18
umlwidget.h
uWarning
#define uWarning()
Definition: debug_utils.h:124
LayoutGenerator::LayoutGenerator
LayoutGenerator()
Definition: layoutgenerator.cpp:88
LayoutGenerator::EdgePoints
QList< QPointF > EdgePoints
Definition: layoutgenerator.h:42
Uml::LayoutType::Direct
@ Direct
Definition: basictypes.h:146
UMLScene::type
Uml::DiagramType::Enum type() const
Definition: umlscene.cpp:426
LayoutGenerator::m_edges
EdgeType m_edges
list of edges found in parsed dot file
Definition: layoutgenerator.h:61
Uml::CmdMoveWidget
Definition: cmdmovewidget.h:23
LayoutGenerator::EdgeType
QHash< QString, EdgePoints > EdgeType
Definition: layoutgenerator.h:43
AssociationLine
Definition: associationline.h:106
i18n
#define i18n
Definition: main.cpp:39
LayoutGenerator::NodeType
QHash< QString, QRectF > NodeType
Definition: layoutgenerator.h:41
UMLApp::beginMacro
void beginMacro(const QString &text)
Definition: uml.cpp:3460
uDebug
#define uDebug()
Definition: debug_utils.h:122
AssociationLine::cleanup
void cleanup()
Definition: associationline.cpp:160
UMLScene::widgetList
const UMLWidgetList widgetList() const
Definition: umlscene.cpp:603
FloatingTextWidget
Displays a line of text or an operation.
Definition: floatingtextwidget.h:37
Uml::RoleType::B
@ B
Definition: basictypes.h:240
LayoutGenerator::parseLine
bool parseLine(const QString &line)
Definition: layoutgenerator.cpp:398
Uml::DiagramType::toString
QString toString(Enum item)
Definition: basictypes.cpp:168
UMLApp::endMacro
void endMacro()
Definition: uml.cpp:3479
DotGenerator::m_edgeParameters
QHash< QString, QString > m_edgeParameters
contains global edge parameters
Definition: dotgenerator.h:52
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:278
AssociationLine::setLayout
void setLayout(Uml::LayoutType::Enum layout)
Definition: associationline.cpp:851
LayoutGenerator::splitParameters
bool splitParameters(QMap< QString, QStringList > &map, const QString &s)
UMLWidget::setY
virtual void setY(qreal y)
Definition: umlwidget.cpp:1697
operator<<
QDebug operator<<(QDebug out, const QXmlStreamAttribute &a)
Definition: shared.cpp:24
UMLWidget::adjustAssocs
virtual void adjustAssocs(qreal dx, qreal dy)
Definition: umlwidget.cpp:1310
associationwidget.h
LayoutGenerator::m_edgeLabelPosition
QHash< QString, QPointF > m_edgeLabelPosition
contains global node parameters
Definition: layoutgenerator.h:62
LayoutGenerator::m_boundingRect
QRectF m_boundingRect
Definition: layoutgenerator.h:59
AssociationWidget::resetTextPositions
virtual void resetTextPositions()
Definition: associationwidget.cpp:340
LayoutGenerator::m_nodes
NodeType m_nodes
list of nodes found in parsed dot file
Definition: layoutgenerator.h:60
uml.h
DotGenerator::m_origin
QPointF m_origin
Definition: dotgenerator.h:54
LayoutGenerator::operator<<
friend QDebug operator<<(QDebug out, LayoutGenerator &c)
debug_utils.h
AssociationWidget::saveIdealTextPositions
void saveIdealTextPositions()
Definition: associationwidget.cpp:1853
UMLScene
Definition: umlscene.h:69
DotGenerator::fixID
QString fixID(const QString &_id)
Definition: dotgenerator.cpp:573
WidgetBase::isPortWidget
bool isPortWidget()
Definition: widgetbase.h:263
AssociationLine::setEndPoints
bool setEndPoints(const QPointF &start, const QPointF &end)
Definition: associationline.cpp:291
AssociationLine::addPoint
void addPoint(const QPointF &point)
Definition: associationline.cpp:118
LayoutGenerator::generate
bool generate(UMLScene *scene, const QString &variant=QString())
Definition: layoutgenerator.cpp:109
LayoutGenerator::availableConfigFiles
static bool availableConfigFiles(UMLScene *scene, QHash< QString, QString > &configFiles)
Definition: layoutgenerator.cpp:309
Uml::LayoutType::Orthogonal
@ Orthogonal
Definition: basictypes.h:147
b
bool b
Definition: cxx11-null-pointer-constant.h:6
LayoutGenerator::readGeneratedDotFile
bool readGeneratedDotFile(const QString &fileName)
Definition: layoutgenerator.cpp:369
AssociationWidget::nameWidget
FloatingTextWidget * nameWidget() const
Definition: associationwidget.cpp:813
LayoutGenerator::apply
bool apply(UMLScene *scene)
Definition: layoutgenerator.cpp:195
UMLApp::executeCommand
void executeCommand(QUndoCommand *cmd)
Definition: uml.cpp:3438
textViewer
static QString textViewer()
Definition: layoutgenerator.cpp:66
WidgetBase::isPinWidget
bool isPinWidget()
Definition: widgetbase.h:262
dotgenerator.h
Import_Rose::diagramType
Uml::DiagramType::Enum diagramType(QString objType)
Definition: petaltree2uml.cpp:543
AssociationWidget::calculateEndingPoints
void calculateEndingPoints()
Definition: associationwidget.cpp:1611
layoutgenerator.h