SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
qtTaskEditor.h
1 //=========================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //=========================================================================
10 #ifndef smtk_extension_qtTaskEditor_h
11 #define smtk_extension_qtTaskEditor_h
12 
13 #include "smtk/extension/qt/diagram/qtDiagramGenerator.h"
14 
15 #include "smtk/project/Project.h"
16 #include "smtk/task/Manager.h"
17 #include "smtk/view/Configuration.h"
18 
19 #include "smtk/common/Managers.h"
20 #include "smtk/common/TypeContainer.h"
21 
22 #include "smtk/PublicPointerDefs.h"
23 
24 #include "nlohmann/json.hpp"
25 
26 #include <QWidget>
27 
28 namespace smtk
29 {
30 namespace extension
31 {
32 
33 class qtBaseArc;
34 class qtBaseNode;
35 class qtBaseTaskNode;
36 
40 class SMTKQTEXT_EXPORT qtTaskEditor : public qtDiagramGenerator
41 {
42  Q_OBJECT
43 
44 public:
47 
49  const smtk::view::Information& info,
51  qtDiagram* parent);
52  ~qtTaskEditor() override;
53 
54  void updateSceneNodes(
55  std::unordered_set<smtk::resource::PersistentObject*>& created,
56  std::unordered_set<smtk::resource::PersistentObject*>& modified,
57  std::unordered_set<smtk::resource::PersistentObject*>& expunged,
58  const smtk::operation::Operation& operation,
59  const smtk::operation::Operation::Result& result) override;
60 
61  void updateSceneArcs(
62  std::unordered_set<smtk::resource::PersistentObject*>& created,
63  std::unordered_set<smtk::resource::PersistentObject*>& modified,
64  std::unordered_set<smtk::resource::PersistentObject*>& expunged,
65  const smtk::operation::Operation& operation,
66  const smtk::operation::Operation::Result& result) override;
67 
69  static std::shared_ptr<smtk::view::Configuration> defaultConfiguration();
70 
72  bool addWorklet(const std::string& workletName, std::array<double, 2> location);
73 
75  bool acceptDropProposal(QDragEnterEvent* event) override;
76 
78  void moveDropPoint(QDragMoveEvent* event) override;
79 
81  void abortDrop(QDragLeaveEvent* event) override;
82 
84  bool acceptDrop(QDropEvent* event) override;
85 
87  qtBaseTaskNode* findTaskNode(const smtk::task::Task* task) const;
88 
89 protected:
90  template<bool RemoveUnusedArcs>
91  bool updateArcs(
93  QRectF& modBounds,
94  ArcLegendEntries& legendInfo);
95  class Internal;
96  Internal* m_p;
97 };
98 
99 } // namespace extension
100 } // namespace smtk
101 #endif // smtk_extension_qtTaskEditor_h
smtk
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
PublicPointerDefs.h
smtk::view::Information
A class for information passed to views during initialization.
Definition: Information.h:32
smtk::extension::qtTaskEditor::Internal
Definition: qtTaskEditor.cxx:104
smtk::extension::qtDiagramGenerator::ArcLegendEntries
std::unordered_map< smtk::string::Token, qtDiagramLegendEntry * > ArcLegendEntries
Subclasses may use this to pass information about arc types registered with the legend.
Definition: qtDiagramGenerator.h:51
smtk::operation::Operation
Operation is a base class for all SMTK operations.
Definition: Operation.h:62
smtk::extension::qtDiagram
A widget that displays diagrams of SMTK resources.
Definition: qtDiagram.h:70
smtk::extension::qtTaskEditor
A widget that displays SMTK tasks available to users in a diagram.
Definition: qtTaskEditor.h:40
smtk::extension::qtBaseTaskNode
A Graphical Item that represents a task as a node in a scene.
Definition: qtBaseTaskNode.h:43
smtkSuperclassMacro
#define smtkSuperclassMacro(...)
Add a typedef to the superclass of this class.
Definition: SharedFromThis.h:147
smtk::view::Configuration::Component
Configure one item in a view, which may contain children.
Definition: Configuration.h:32
smtk::task::Task
Task is a base class for all SMTK tasks.
Definition: Task.h:70
smtk::extension::qtDiagramGenerator
A base class that maintains a diagram in the face of operations which modify the state of the diagram...
Definition: qtDiagramGenerator.h:43
smtk::resource::PersistentObject
An abstract base class for SMTK resources and their components.
Definition: PersistentObject.h:39
smtkTypenameMacro
#define smtkTypenameMacro(...)
Add typedefs to a class for identifcation.
Definition: SharedFromThis.h:98