SHAPER  9.12.0
ModuleBase_IWorkshop.h
1 // Copyright (C) 2014-2023 CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef ModuleBase_IWorkshop_H
21 #define ModuleBase_IWorkshop_H
22 
23 #include "ModuleBase.h"
24 #include "ModuleBase_Definitions.h"
25 #include <ModuleBase_FilterValidated.h>
26 
27 #include <ModelAPI_Object.h>
28 #include <GeomAPI_AISObject.h>
29 #include <Config_FeatureMessage.h>
30 
31 #include <QObject>
32 
33 class ModuleBase_IModule;
35 class ModuleBase_IViewer;
41 class QMainWindow;
42 
47 class MODULEBASE_EXPORT ModuleBase_IWorkshop : public QObject
48 {
49 Q_OBJECT
50  public:
53  ModuleBase_IWorkshop(QObject* theParent);
54 
55  virtual ~ModuleBase_IWorkshop()
56  {}
57 
59  virtual ModuleBase_ISelection* selection() const = 0;
60 
62  virtual ModuleBase_IModule* module() const = 0;
63 
65  virtual ModuleBase_IViewer* viewer() const = 0;
66 
69 
71  virtual ModuleBase_IErrorMgr* errorMgr() const = 0;
72 
75  Handle(ModuleBase_FilterValidated) validatorFilter();
76 
79 
81  virtual ModuleBase_Operation* currentOperation() const = 0;
82 
84  virtual bool canStartOperation(QString theId, bool& isCommitted) = 0;
85 
88  virtual void processLaunchOperation(ModuleBase_Operation* theOperation) = 0;
89 
93  virtual ModuleBase_Operation* findStartedOperation(const QString& theId) = 0;
94 
98  virtual bool canStopOperation(ModuleBase_Operation* theOperation) = 0;
99 
103  virtual void stopOperation(ModuleBase_Operation* theOperation,
104  bool& isCommitted) = 0;
105 
108  virtual AISObjectPtr findPresentation(const ObjectPtr& theObject) const = 0;
109 
112  virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const = 0;
113 
116  virtual bool isVisible(const ObjectPtr& theObject) const = 0;
117 
119  virtual QObjectPtrList displayedObjects() const = 0;
120 
124  virtual void setSelected(const QList<std::shared_ptr<ModuleBase_ViewerPrs>>& theValues) = 0;
125 
128  virtual void setStatusBarMessage(const QString& theMessage) = 0;
129 
131  virtual void updateCommandStatus() = 0;
132 
135  virtual std::shared_ptr<Config_FeatureMessage> featureInfo(const QString& theId) const = 0;
136 
138  virtual QMainWindow* desktop() const = 0;
139 
142  virtual bool hasSHIFTPressed() const = 0;
143 
144  virtual void deactivateCurrentSelector() = 0;
145 
148  virtual bool enableUpdateViewer(bool isEnabled) = 0;
149 
153  virtual void applyCurrentSelectionModes(const AISObjectPtr& theAIS) = 0;
154 
156  virtual void undo() = 0;
157 
159  virtual void setCancelEnabled(bool toEnable) = 0;
160 
162  virtual bool isCancelEnabled() const = 0;
163 
165  virtual void showHelpPage(const QString& thePage) const = 0;
166 
167 signals:
170 
173 
174 protected:
176  Handle(ModuleBase_FilterValidated) myValidatorFilter;
177 };
178 
179 #endif
A filter which provides filtering of selection in 3d viewer.
Definition: ModuleBase_FilterValidated.h:39
An interface to Errors manager object.
Definition: ModuleBase_IErrorMgr.h:38
Interface to a module.
Definition: ModuleBase_IModule.h:70
A class for Property panel object definition.
Definition: ModuleBase_IPropertyPanel.h:35
A class which provides interface of activation/deactivate selection modes and using selection filters...
Definition: ModuleBase_ISelectionActivate.h:36
A class which provides access to selection.
Definition: ModuleBase_ISelection.h:44
A Base object for definition of connector object to Salome Viewer.
Definition: ModuleBase_IViewer.h:47
Class which provides access to Workshop object services.
Definition: ModuleBase_IWorkshop.h:48
virtual void showHelpPage(const QString &thePage) const =0
Show help of a current operation.
virtual bool isCancelEnabled() const =0
Returns current state of cancel button.
virtual ModuleBase_IErrorMgr * errorMgr() const =0
Returns error manager.
virtual AISObjectPtr findPresentation(const ObjectPtr &theObject) const =0
Returns AIS object by data object.
virtual ModuleBase_ISelectionActivate * selectionActivate() const =0
A selection activate in 3D View handler.
virtual void stopOperation(ModuleBase_Operation *theOperation, bool &isCommitted)=0
Commits if possible or aborts the given operation.
virtual void undo()=0
Undo last command.
virtual ModuleBase_ISelection * selection() const =0
Return current selection instance.
virtual bool isVisible(const ObjectPtr &theObject) const =0
Returns true if the object is displayed.
virtual ModuleBase_IViewer * viewer() const =0
Returns current viewer.
virtual void applyCurrentSelectionModes(const AISObjectPtr &theAIS)=0
The methods applys current defined selection modes to given AIS presentation.
virtual ObjectPtr findPresentedObject(const AISObjectPtr &theAIS) const =0
Returns data object by AIS.
virtual ModuleBase_Operation * findStartedOperation(const QString &theId)=0
Returns started operation by the operation identifier.
virtual ModuleBase_IModule * module() const =0
Returns instance of loaded module.
virtual bool enableUpdateViewer(bool isEnabled)=0
Temporary enable or disable viewer update.
virtual void processLaunchOperation(ModuleBase_Operation *theOperation)=0
Performs the operation launch.
virtual ModuleBase_Operation * currentOperation() const =0
Returns currently active operation.
virtual bool hasSHIFTPressed() const =0
Returns true if SHIFT is pressed.
virtual void setStatusBarMessage(const QString &theMessage)=0
Shows the message in the status bar.
virtual ModuleBase_IPropertyPanel * propertyPanel() const =0
Returns property panel.
virtual void updateCommandStatus()=0
Update of commands status.
virtual void setSelected(const QList< std::shared_ptr< ModuleBase_ViewerPrs >> &theValues)=0
Select features clearing previous selection.
virtual bool canStopOperation(ModuleBase_Operation *theOperation)=0
Returns true if the operation with id theId can be stopped.
virtual bool canStartOperation(QString theId, bool &isCommitted)=0
Returns true if the operation with id theId can be started.
virtual void setCancelEnabled(bool toEnable)=0
Set enabled state of cancel button in property panel.
void propertyPanelActivated()
Signal which is emited after activation of property panel.
virtual QMainWindow * desktop() const =0
Returns main window of the application.
void selectionChanged()
Signal selection changed.
virtual std::shared_ptr< Config_FeatureMessage > featureInfo(const QString &theId) const =0
Returns feature info according to given feature ID.
virtual QObjectPtrList displayedObjects() const =0
Returns list of currently displayed objects.
Base class for all operations.
Definition: ModuleBase_Operation.h:53
Presentation.
Definition: ModuleBase_ViewerPrs.h:37