SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
10 #ifndef smtk_extension_qtDiagram_h
11 #define smtk_extension_qtDiagram_h
13 #include "smtk/extension/qt/Exports.h"
14 #include "smtk/extension/qt/qtBaseView.h"
16 #include "smtk/project/Project.h"
17 #include "smtk/task/Manager.h"
18 #include "smtk/view/Configuration.h"
20 #include "smtk/common/Managers.h"
21 #include "smtk/common/TypeContainer.h"
23 #include "smtk/string/Token.h"
27 #include "nlohmann/json.hpp"
31 #include <unordered_map>
32 #include <unordered_set>
43 class qtDiagramGenerator;
44 class qtDiagramLegend;
47 class qtDiagramViewMode;
103 bool addNode(
qtBaseNode* node,
bool enforceInteractionMode =
true);
113 bool addArc(
qtBaseArc* arc,
bool enforceSelectionMode =
true);
123 std::unordered_set<qtBaseArc*> arcsOfNode(
qtBaseNode* node);
131 const std::unordered_map<
133 std::unordered_map<smtk::string::Token, std::unordered_set<qtBaseArc*>>>*
137 std::unordered_set<qtBaseNode*> predecessorsOf(
qtBaseNode* successor)
const;
148 const std::unordered_map<smtk::string::Token, std::unordered_set<qtBaseArc*>>* findArcs(
153 static std::shared_ptr<smtk::view::Configuration> defaultConfiguration();
161 bool configure(
const nlohmann::json& data);
162 nlohmann::json configuration()
const;
184 const std::unordered_map<smtk::string::Token, std::shared_ptr<qtDiagramViewMode>>& modes()
const;
187 smtk::common::Managers::Ptr managers()
const;
191 const std::unordered_map<smtk::string::Token, std::shared_ptr<qtDiagramGenerator>>& generators()
196 void includeInView(
const QRectF& inclusion,
int priority = 0);
214 bool nodesEnabled()
const;
216 bool nodeSelectionEnabled()
const;
218 bool arcSelectionEnabled()
const;
223 QWidget* sidebar()
const;
232 void enableNodes(
bool shouldEnable);
234 void enableNodeSelection(
bool shouldEnable);
236 void enableArcSelection(
bool shouldEnable);
241 virtual void toggleSidebar(
bool showSidebar);
246 virtual bool updateSMTKSelection();
255 virtual void updateQtSelection();
259 void modeChangeRequested(QAction* modeAction);
261 void onNodeGeometryChanged();
270 #endif // smtk_extension_qtDiagram_h
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
A graphics item that represents an arc between nodes in a diagram.
Definition: qtBaseArc.h:34
A base class for all view types implemented using Qt.
Definition: qtBaseView.h:46
A widget that holds a Qt scene graph.
Definition: qtDiagramView.h:37
A Graphical Item that represents a node connected by arcs in a scene.
Definition: qtBaseNode.h:47
A QGraphicsScene that holds QGraphicsItems for diagrams.
Definition: qtDiagramScene.h:43
Definition: qtDiagram.cxx:102
A widget that displays diagrams of SMTK resources.
Definition: qtDiagram.h:70
An interactive legend to control what is displayed in a qtDiagram.
Definition: qtDiagramLegend.h:39
#define smtkSuperclassMacro(...)
Add a typedef to the superclass of this class.
Definition: SharedFromThis.h:147
A string token identified by an integer.
Definition: Token.h:29
An object to handle modal interaction in a diagram view.
Definition: qtDiagramViewMode.h:47
#define smtkTypenameMacro(...)
Add typedefs to a class for identifcation.
Definition: SharedFromThis.h:98