SHAPER  9.12.0
XGUI_ModuleConnector.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 XGUI_ModuleConnector_H
21 #define XGUI_ModuleConnector_H
22 
23 #include "XGUI.h"
24 #include <ModuleBase_Definitions.h>
25 #include <ModuleBase_IWorkshop.h>
26 
27 class XGUI_Workshop;
28 class XGUI_Displayer;
29 
34 class XGUI_EXPORT XGUI_ModuleConnector : public ModuleBase_IWorkshop
35 {
36 Q_OBJECT
37  public:
40  XGUI_ModuleConnector(XGUI_Workshop* theWorkshop);
41 
42  virtual ~XGUI_ModuleConnector();
43 
45  virtual ModuleBase_ISelection* selection() const;
46 
48  virtual ModuleBase_IModule* module() const;
49 
51  virtual ModuleBase_IViewer* viewer() const;
52 
55 
57  virtual ModuleBase_IErrorMgr* errorMgr() const;
58 
61 
63  virtual ModuleBase_Operation* currentOperation() const;
64 
68  virtual bool canStartOperation(QString theId, bool& isCommitted);
69 
72  virtual void processLaunchOperation(ModuleBase_Operation* theOperation);
73 
77  virtual ModuleBase_Operation* findStartedOperation(const QString& theId);
78 
82  virtual bool canStopOperation(ModuleBase_Operation* theOperation);
83 
87  virtual void stopOperation(ModuleBase_Operation* theOperation,
88  bool& isCommitted);
89 
91  virtual AISObjectPtr findPresentation(const ObjectPtr& theObject) const;
92 
94  virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const;
95 
98  virtual bool isVisible(const ObjectPtr& theObject) const;
99 
101  virtual QObjectPtrList displayedObjects() const;
102 
105  virtual void setSelected(const QList<std::shared_ptr<ModuleBase_ViewerPrs>>& theValues);
106 
109  virtual void setStatusBarMessage(const QString& theMessage);
110 
112  virtual void updateCommandStatus();
113 
116  virtual std::shared_ptr<Config_FeatureMessage> featureInfo(const QString& theId) const;
117 
119  virtual QMainWindow* desktop() const;
120 
123  virtual bool hasSHIFTPressed() const;
124 
125  virtual void deactivateCurrentSelector();
126 
129  virtual bool enableUpdateViewer(bool isEnabled);
130 
132  XGUI_Workshop* workshop() const { return myWorkshop; }
133 
137  virtual void applyCurrentSelectionModes(const AISObjectPtr& theAIS);
138 
140  virtual void undo();
141 
143  virtual void setCancelEnabled(bool toEnable);
144 
146  virtual bool isCancelEnabled() const;
147 
149  virtual void showHelpPage(const QString& thePage) const;
150 
151 private:
152  QObjectPtrList activeObjects(const QObjectPtrList& theObjList) const;
153 
155  XGUI_Workshop* myWorkshop;
156 };
157 
158 #endif
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.
virtual QMainWindow * desktop() const =0
Returns main window of the application.
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
Displayer.
Definition: XGUI_Displayer.h:172
Implementation of IWorkshop interface which provides access to Workshop services at module level.
Definition: XGUI_ModuleConnector.h:35
XGUI_Workshop * workshop() const
Returns workshop.
Definition: XGUI_ModuleConnector.h:132
Class which defines a configuration of the application (Workshop) and launches it.
Definition: XGUI_Workshop.h:82