Salome HOME
441014dde5a295d70edcb2c49c1b89f84153cfd5
[modules/shaper.git] / src / PartSet / PartSet_Module.h
1 #ifndef PartSet_Module_H
2 #define PartSet_Module_H
3
4 #include "PartSet.h"
5
6 #include <XGUI_Module.h>
7 #include <XGUI_Command.h>
8
9 #include <QMap>
10 #include <QObject>
11
12 #include <string>
13
14 class PARTSET_EXPORT PartSet_Module: public QObject, public XGUI_Module
15 {
16 Q_OBJECT
17
18 public:
19   PartSet_Module(XGUI_Workshop* theWshop);
20   virtual ~PartSet_Module();
21
22   virtual void createFeatures();
23   virtual void featureCreated(XGUI_Command* theFeature);
24   std::string featureFile(const std::string&);
25
26   virtual void launchOperation(const QString& theCmdId);
27
28 public slots:
29   void onFeatureTriggered();
30   /// SLOT, that is called after the operation is started. Perform some specific for module
31   /// actions, e.g. connect the sketch feature to the viewer selection and show the sketch preview.
32   void onOperationStarted();
33   /// SLOT, that is called after the operation is stopped. Disconnect the sketch feature
34   /// from the viewer selection and show the sketch preview.
35   void onOperationStopped(ModuleBase_Operation* theOperation);
36   /// SLOT, that is called by the selection in the viewer is changed.
37   /// The selection is sent to the current operation if it listen the selection.
38   void onViewSelectionChanged();
39
40 private:
41   /// Displays or erase the current operation preview, if it has it.
42   /// \param isDisplay the state whether the presentation should be displayed or erased
43   void visualizePreview(bool isDisplay);
44
45 private:
46   XGUI_Workshop* myWorkshop;
47
48   std::map<std::string, std::string> myFeaturesInFiles;
49 };
50
51 #endif