KDStateMachineEditor API Documentation
2.1
Loading...
Searching...
No Matches
src
core
layout
graphvizlayout
graphvizlayouter.cpp
Go to the documentation of this file.
1
/*
2
This file is part of the KDAB State Machine Editor Library.
3
4
SPDX-FileCopyrightText: 2014 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5
Author: Kevin Funk <kevin.funk@kdab.com>
6
7
SPDX-License-Identifier: LGPL-2.1-only OR LicenseRef-KDAB-KDStateMachineEditor
8
9
Licensees holding valid commercial KDAB State Machine Editor Library
10
licenses may use this file in accordance with the KDAB State Machine Editor
11
Library License Agreement provided with the Software.
12
13
Contact info@kdab.com if any conditions of this licensing are not clear to you.
14
*/
15
16
#include "
graphvizlayouter.h
"
17
18
#include "
graphvizlayouterbackend_p.h
"
19
#include "
element.h
"
20
#include "
state.h
"
21
22
#include "debug.h"
23
24
#include <QRectF>
25
26
using namespace
KDSME
;
27
28
GraphvizLayouter::GraphvizLayouter
(QObject *parent)
29
:
Layouter
(parent)
30
, m_backend(new
GraphvizLayouterBackend
)
31
{
32
}
33
34
GraphvizLayouter::~GraphvizLayouter
()
35
{
36
delete
m_backend;
37
}
38
39
QRectF
GraphvizLayouter::layout
(
State
*state,
const
LayoutProperties
*properties)
40
{
41
if
(!state) {
42
qCWarning(KDSME_CORE) <<
"Null state passed to layout function"
;
43
return
QRectF();
44
}
45
46
qCDebug(KDSME_CORE) << state << properties;
47
48
// open context
49
m_backend->
openLayout
(state, properties);
50
51
// Step 1: Create Graphviz structures out of the State/Transition tree
52
// Step 1.1: build nodes
53
m_backend->
buildState
(state);
54
// Step 1.2: build edges
55
m_backend->
buildTransitions
(state);
56
57
m_backend->
layout
();
58
59
// Step 2: Import the information from the Graphviz structures to the State/Transition tree
60
m_backend->
import
();
61
62
const
QRectF boundingRect = m_backend->
boundingRect
();
63
m_backend->
closeLayout
();
64
return
boundingRect;
65
}
GraphvizLayouterBackend
Definition
graphvizlayouterbackend_p.h:34
GraphvizLayouterBackend::openLayout
void openLayout(KDSME::State *state, const KDSME::LayoutProperties *properties)
Definition
graphvizlayouterbackend.cpp:617
GraphvizLayouterBackend::buildTransitions
void buildTransitions(const KDSME::State *state)
Definition
graphvizlayouterbackend.cpp:635
GraphvizLayouterBackend::buildState
void buildState(KDSME::State *state)
Definition
graphvizlayouterbackend.cpp:630
GraphvizLayouterBackend::layout
void layout()
Definition
graphvizlayouterbackend.cpp:578
GraphvizLayouterBackend::closeLayout
void closeLayout()
Definition
graphvizlayouterbackend.cpp:625
GraphvizLayouterBackend::boundingRect
QRectF boundingRect() const
Definition
graphvizlayouterbackend.cpp:650
GraphvizLayouterBackend::import
void import()
Definition
graphvizlayouterbackend.cpp:645
KDSME::GraphvizLayouter::GraphvizLayouter
GraphvizLayouter(QObject *parent=nullptr)
Definition
graphvizlayouter.cpp:28
KDSME::GraphvizLayouter::layout
QRectF layout(State *state, const LayoutProperties *properties) override
Definition
graphvizlayouter.cpp:39
KDSME::GraphvizLayouter::~GraphvizLayouter
~GraphvizLayouter()
Definition
graphvizlayouter.cpp:34
KDSME::LayoutProperties
Definition
layoutproperties.h:29
KDSME::Layouter
Definition
layouter.h:34
KDSME::State
Definition
state.h:29
element.h
graphvizlayouter.h
graphvizlayouterbackend_p.h
KDSME
Definition
mainwindow.h:21
state.h
© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDStateMachineEditor
Create Qt State Machine metacode using a graphical user interface
https://github.com/KDAB/KDStateMachineEditor
Generated on Tue Jul 15 2025 15:21:47 for KDStateMachineEditor API Documentation by doxygen 1.9.8