SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
pqSMTKOperationPanel.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_paraview_appcomponents_pqSMTKOperationPanel_h
11 #define smtk_extension_paraview_appcomponents_pqSMTKOperationPanel_h
12 #include "smtk/extension/paraview/appcomponents/smtkPQComponentsExtModule.h"
13 #include "smtk/extension/qt/qtUIManager.h"
14 
15 #include "smtk/operation/Operation.h" // for Index
16 
17 #include "smtk/resource/Observer.h"
18 
19 #include "smtk/PublicPointerDefs.h"
20 
21 #include "smtk/extension/paraview/appcomponents/pqQtKeywordWrapping.h"
22 
23 #include <QWidget>
24 
25 class pqServer;
26 class pqPipelineSource;
27 
28 class pqSMTKWrapper;
29 
30 class QListWidgetItem;
31 
47 class SMTKPQCOMPONENTSEXT_EXPORT pqSMTKOperationPanel : public QWidget
48 {
49  Q_OBJECT
50  typedef QWidget Superclass;
51 
52 public:
53  pqSMTKOperationPanel(QWidget* parent = nullptr);
54  ~pqSMTKOperationPanel() override;
55 
56  smtk::extension::qtUIManager* attributeUIManager() const { return m_attrUIMgr; }
57 
58  smtk::view::AvailableOperationsPtr availableOperations() const { return m_availableOperations; }
59 
60 Q_SIGNALS:
61  void titleChanged(QString title);
62 
63 public Q_SLOTS:
65  virtual void observeWrapper(pqSMTKWrapper*, pqServer*);
66 
68  virtual void unobserveWrapper(pqSMTKWrapper*, pqServer*);
69 
75  virtual bool editOperation(smtk::operation::Operation::Index index);
76 
82  virtual bool editOperation(smtk::operation::OperationPtr operation);
83 
85  virtual void runOperation();
86 
88  virtual void runOperation(smtk::operation::OperationPtr operation);
89 
94  virtual void cancelEditing();
95 
96 protected Q_SLOTS:
97  virtual void toggleFilterBySelection(bool);
98  virtual void operationListClicked(QListWidgetItem* item);
99  virtual void operationListDoubleClicked(QListWidgetItem* item);
100  virtual void operationListActivated(QListWidgetItem* item);
101  virtual void operationListCurrentItemChanged(QListWidgetItem* item, QListWidgetItem* prev);
102 
103 protected:
105  virtual void displayDocumentation(const smtk::operation::Operation::Index& index);
106 
107  class Internal;
108  Internal* m_p{ nullptr };
109  pqSMTKWrapper* m_wrapper{
110  nullptr
111  }; // TODO: Remove the need for me. This ties us to a single pqServer.
113  smtk::extension::qtUIManager* m_attrUIMgr{ nullptr };
114  std::weak_ptr<smtk::resource::Resource> m_rsrc;
115  smtk::view::AvailableOperationsPtr m_availableOperations;
117 };
118 
119 #endif // smtk_extension_paraview_appcomponents_pqSMTKOperationPanel_h
pqSMTKOperationPanel::Internal
Definition: pqSMTKOperationPanel.cxx:54
PublicPointerDefs.h
smtk::extension::qtUIManager
Container for managers whose content is presented via Qt widgets.
Definition: qtUIManager.h:57
smtk::common::Observers::Key
Definition: Observers.h:106
smtk::operation::OperationPtr
smtk::shared_ptr< smtk::operation::Operation > OperationPtr
Definition: PublicPointerDefs.h:351
smtk::view::AvailableOperationsPtr
smtk::shared_ptr< smtk::view::AvailableOperations > AvailableOperationsPtr
Definition: PublicPointerDefs.h:621