Skip to content

Commit 49aab3d

Browse files
committed
Restructure documentation
1 parent e9fb8f9 commit 49aab3d

12 files changed

+116
-95
lines changed

LICENSE

Lines changed: 0 additions & 28 deletions
This file was deleted.

LICENSE.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
BSD-3-Clause license
2+
====================
3+
4+
Copyright (c) 2017, Dmitry Pinaev
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice, this
11+
list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
* Neither the name of copyright holder, nor the names of its contributors may
16+
be used to endorse or promote products derived from this software without
17+
specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
23+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
25+
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
28+
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.rst

Lines changed: 49 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ simple graph visualization and editing or extended further for using the
1010
`Dataflow paradigm <https://en.wikipedia.org/wiki/Dataflow_programming>`_ .
1111

1212
The library is written using the Model-View approach. The whole graph structure
13-
is defined by the user-provided ``GraphModel`` class. It is possible to create or
14-
add Nodes and Connections. The underlying data structures could be of any
15-
arbitrary type or representation.
13+
is defined by the user-provided class deriving from ``AbstractGraphModel`` class.
14+
It is possible to create or add Nodes and Connections. The underlying data
15+
structures could be of any arbitrary type or representation.
1616

17-
The ``GraphModel`` could or could not be attached to specialized
18-
``QGraphicsScene`` and ``QGraphicsView`` objects. I.e. the so-called "headless"
19-
`modus operandi` is possible.
17+
An instance of ``AbstractGraphModel`` could or could not be attached to
18+
specialized ``QGraphicsScene`` and ``QGraphicsView`` objects. I.e. the so-called
19+
"headless" `modus operandi` is possible.
2020

2121

2222
.. contents:: Navigation
@@ -36,8 +36,11 @@ fetches available data and propagates is further. Each change in the source node
3636
is immediately propagated through all the connections updating the whole graph.
3737

3838

39-
Supported Platforms
40-
===================
39+
Supported Environments
40+
======================
41+
42+
Platforms
43+
---------
4144

4245
* Linux (x64, gcc-7.0, clang-7) |ImageLink|_
4346
* OSX (Apple Clang - LLVM 3.6) |ImageLink|_
@@ -52,7 +55,7 @@ Supported Platforms
5255
.. _AppveyorImage: https://ci.appveyor.com/project/paceholder/nodeeditor/branch/master)
5356

5457
Dependencies
55-
============
58+
------------
5659

5760
* Qt >5.2
5861
* CMake 3.2
@@ -75,7 +78,7 @@ Building
7578
========
7679

7780
Linux
78-
^^^^^
81+
-----
7982

8083
::
8184

@@ -88,7 +91,7 @@ Linux
8891

8992

9093
Qt Creator
91-
^^^^^^^^^^
94+
----------
9295

9396
1. Open `CMakeLists.txt` as project.
9497
2. If you don't have the `Catch2` library installed, go to `Build Settings`, disable the checkbox `BUILD_TESTING`.
@@ -97,8 +100,8 @@ Qt Creator
97100
5. Click the button `Run`
98101

99102

100-
>>> Version 3 Roadmap <<<
101-
=========================
103+
Version 3 Roadmap
104+
=================
102105

103106
#. Headless mode. [done]
104107
You can create, populate, modify the derivative of AbstractGraphModel
@@ -124,12 +127,37 @@ Qt Creator
124127
Any suggestions are welcome!
125128

126129

130+
Contributing
131+
============
132+
133+
#. Be polite, respectful and collaborative.
134+
#. For submitting a bug:
135+
136+
#. Describe your environment (Qt version, compiler, OS etc)
137+
#. Describe steps to reproduce the issue
138+
139+
#. For submitting a pull request:
140+
141+
#. Create a proposal task first. We can come up with a better design together.
142+
#. Create a pull-request. If applicable create a simple example to your
143+
iescribe your problem in details, provide use cases,
144+
145+
#. For submitting a development request:
146+
147+
#. Describe your issue in details
148+
#. Provide some use cases.
149+
150+
#. I maintain this probject in my free time, when I am not busy with my work or
151+
my family. **If I do not react or do not answer for too long, please ping
152+
me**.
153+
154+
127155
Citing
128156
======
129157

130158
::
131159

132-
Dmitry Pinaev et al, Qt5 Node Editor, (2017), GitHub repository, https://github.com/paceholder/nodeeditor
160+
Dmitry Pinaev et al, Qt Node Editor, (2017), GitHub repository, https://github.com/paceholder/nodeeditor
133161

134162
BibTeX::
135163

@@ -160,7 +188,7 @@ Showcase
160188
========
161189

162190
Youtube videos
163-
^^^^^^^^^^^^^^
191+
--------------
164192

165193
.. image:: https://img.youtube.com/vi/pxMXjSvlOFw/0.jpg
166194
:target: https://www.youtube.com/watch?v=pxMXjSvlOFw
@@ -171,7 +199,7 @@ Youtube videos
171199
:target: https://www.youtube.com/watch?v=i_pB-Y0hCYQ
172200

173201
CANdevStudio
174-
^^^^^^^^^^^^
202+
------------
175203

176204
`CANdevStudio <https://github.com/GENIVI/CANdevStudio>`_ is a cost-effective,
177205
cross-platform replacement for CAN simulation software. CANdevStudio enables to
@@ -180,26 +208,26 @@ every automotive developer. Thanks to modularity it is easy to implement new,
180208
custom features.
181209

182210

183-
.. image:: pictures/showcase_CANdevStudio.png
211+
.. image:: docs/_static/showcase_CANdevStudio.png
184212

185213

186214
Chigraph
187-
^^^^^^^^
215+
--------
188216

189217
`Chigraph <https://github.com/chigraph/chigraph>`_ is a visual programming
190218
language for beginners that is unique in that it is an intuitive flow graph:
191219

192-
.. image:: pictures/chigraph.png
220+
.. image:: docs/_static/chigraph.png
193221

194222

195223
It features easy bindings to C/C++, package management, and a cool interface.
196224

197225

198226
Spkgen particle editor
199-
^^^^^^^^^^^^^^^^^^^^^^
227+
----------------------
200228

201229
`Spkgen <https://github.com/fredakilla/spkgen>`_ is an editor for the SPARK
202230
particles engine that uses a node-based interface to create particles effects for
203231
games
204232

205-
.. image:: pictures/spkgen.png
233+
.. image:: docs/_static/spkgen.png

docs/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ if(DOXYGEN_FOUND)
1111
set(DOXYGEN_INDEX_FILE ${CMAKE_CURRENT_BINARY_DIR}/html/index.html)
1212

1313
set(DOXYGEN_INPUT_DIR ${PROJECT_SOURCE_DIR}/src
14-
${PROJECT_SOURCE_DIR}/include)
14+
${PROJECT_SOURCE_DIR}/include
15+
${PROJECT_SOURCE_DIR}/examples/calculator)
1516
# Making string joined with " "
1617
list(JOIN DOXYGEN_INPUT_DIR " " DOXYGEN_INPUT_DIR_JOINED)
1718

docs/index.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ QtNodes Documentation
22
=====================
33

44
.. toctree::
5-
:maxdepth: 2
5+
:maxdepth: 3
66

77
overview
8+
todo
89
classes
10+
license_link
911

1012
Index
1113
==================

docs/license_link.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. include:: ../LICENSE.rst

docs/overview.rst

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Intro
55
-----
66

77

8-
QtNodes is a Qt5-based library designed for graphical representation of
8+
QtNodes is a Qt-based library designed for graphical representation of
99
the node graphs and performing various operations on them.
1010

1111
.. image:: /_static/calculator.png
@@ -25,10 +25,9 @@ The library could be used for two purposes:
2525
1. General-purpose graph visulalization and editing.
2626
2. Computing data in the nodes and propagating it through connections.
2727

28-
The "headless" mode is also supported. It is possible to create,
29-
delete, connect and disconnect nodes, as well as propagate data,
30-
without assigning your :cpp:type:`AbstractGraphModel` derivative to a
31-
:cpp:type:`BasicGraphicsScene`.
28+
The "headless" mode is also supported. It is possible to create, delete, connect
29+
and disconnect nodes, as well as propagate data, without assigning your
30+
:cpp:type:`AbstractGraphModel` derivative to a :cpp:type:`BasicGraphicsScene`.
3231

3332
Examples
3433
--------
@@ -40,29 +39,20 @@ The examples could be found in the folder ``examples``:
4039
- "legacy" examples from versions prior to ``3.0``:
4140

4241
- ``text``. Text is propagated between the nodes.
43-
- ``calculator``. Dataflow-based implementation of the simplest
42+
- ``calculator/main.cpp``. Dataflow-based implementation of the simplest
4443
calculator. We use an advanced model
4544
:cpp:type:`QtNodes::DataFlowGraphModel` capable of storing the registry of
4645
NodeDataModel and propagating user data beween the nodes.
46+
- ``calculator/headless_main.cpp``. The example loads a scene saved by a
47+
GUI-based ``calculator`` example and computes several results without
48+
creating any GUI elements.
4749
- ``connection_colors``. Demonstrates the ability to color the
4850
connections in correspondence to the connected data types.
49-
- ``images``. Another dataflow example where images are propagated
50-
between the nodes.
51+
- ``resizable_images``. The examples shows how to embed a widget into nodes and
52+
how to make the nodes resizable.
5153
- ``styles``. The example demonstrates graph style customization.
5254

5355

54-
TODOs
55-
-----
56-
57-
1. Dynamic ports
58-
2. `NodeGeometryDelegate`, `NodePaintDelegate`
59-
3. `ConnectionPaintDelegate`
60-
4. Python Wrapper using Shiboken
61-
5. Python examples
62-
6. Unit-Tests
63-
7. Documentation
64-
8. QML front-end
65-
6656

6757
Node Geometry
6858
-------------
@@ -97,16 +87,13 @@ Node Geometry
9787
9888
9989
100-
Size is recalculated when
101-
^^^^^^^^^^^^^^^^^^^^^^^^^
90+
Node's size must be recalculated in following cases:
10291

103-
0. After construction.
104-
1. Embedding the widget.
105-
2. After resizing.
106-
3. Before painting (conditional, depends on whether the font metrics
107-
was changed).
108-
4. When incoming data changed (could trigger size changes, maybe in
109-
captions).
110-
5. When embedded widget changes its size.
92+
#. After construction.
93+
#. Embedding the widget.
94+
#. After resizing.
95+
#. Before painting (conditional, depends on whether the font metrics was changed).
96+
#. When incoming data changed (could trigger size changes, maybe in captions).
97+
#. When embedded widget changes its size.
11198

11299

docs/readme_link.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. include:: ../README.rst

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
sphinx
22
breathe
3+
breath_rtd_theme

docs/todo.rst

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
TODO
2-
====
1+
To Be Implemented
2+
=================
33

44

5-
- Save/restore to Json. Maybe inherit the GraphModel from Serializable.
6-
- Check how styles work and what needs to be done. See old
7-
pull-requests.
8-
- Dynamic ports.
9-
- Python bindings.
10-
- QML front-end.
11-
- TESTS!
12-
- Website with documentation.
5+
- [✅ done] Save/restore to Json. Maybe inherit the GraphModel from Serializable
6+
- [➡️ work in progress] Vertical layout
7+
- [➡️ work in progress] Dynamic ports
8+
- [➡️ work in progress] Unit-Tests
9+
- [➡️ work in progress] Website with documentation
10+
- [⏸ not started] ``NodeGeometryDelegate``, ``NodePaintDelegate``
11+
- ``ConnectionPaintDelegate``
12+
- [⏸ not started] Check how styles work and what needs to be done. See old pull-requests
13+
- [☝ help needed] Python bindings. Maybe a wrapper using Shiboken
14+
- Python examples
15+
- [☝ help needed] QML front-end

include/QtNodes/internal/NodeGraphicsObject.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,11 @@ class NodeGraphicsObject : public QGraphicsObject
6060
void
6161
moveConnections() const;
6262

63-
6463
/// Repaints the node once with reacting ports.
6564
void
6665
reactToConnection(ConnectionGraphicsObject const * cgo);
6766

6867
protected:
69-
7068
void
7169
paint(QPainter* painter,
7270
QStyleOptionGraphicsItem const* option,
@@ -100,12 +98,10 @@ class NodeGraphicsObject : public QGraphicsObject
10098
contextMenuEvent(QGraphicsSceneContextMenuEvent* event) override;
10199

102100
private:
103-
104101
void
105102
embedQWidget();
106103

107104
private:
108-
109105
NodeId _nodeId;
110106

111107
AbstractGraphModel &_graphModel;

src/NodeConnectionInteraction.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ disconnect(PortType portToDisconnect) const
126126
ConnectionId incompleteConnectionId =
127127
makeIncompleteConnectionId(connectionId, portToDisconnect);
128128

129+
// Grabs the mouse
129130
auto const & draftConnection =
130131
_scene.makeDraftConnection(incompleteConnectionId);
131132

0 commit comments

Comments
 (0)