Salome HOME
d210fc513b488a01c349fc749fd4a13bfbf095ee
[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_Listener;
15
16 class PARTSET_EXPORT PartSet_Module: public QObject, public XGUI_Module
17 {
18 Q_OBJECT
19
20 public:
21   PartSet_Module(XGUI_Workshop* theWshop);
22   virtual ~PartSet_Module();
23
24   virtual void createFeatures();
25   virtual void featureCreated(XGUI_Command* theFeature);
26   std::string featureFile(const std::string&);
27
28   virtual void launchOperation(const QString& theCmdId);
29
30   /// Displays or erase the current operation preview, if it has it.
31   /// \param isDisplay the state whether the presentation should be displayed or erased
32   void visualizePreview(bool isDisplay);
33
34 public slots:
35   void onFeatureTriggered();
36   /// SLOT, that is called after the operation is started. Perform some specific for module
37   /// actions, e.g. connect the sketch feature to the viewer selection and show the sketch preview.
38   void onOperationStarted();
39   /// SLOT, that is called after the operation is stopped. Disconnect the sketch feature
40   /// from the viewer selection and show the sketch preview.
41   void onOperationStopped(ModuleBase_Operation* theOperation);
42   /// SLOT, that is called by the selection in the viewer is changed.
43   /// The selection is sent to the current operation if it listen the selection.
44   void onMouseReleased(QPoint thePoint);
45   /// SLOT, that is called by the selection in the viewer is changed.
46   /// The selection is sent to the current operation if it listen the selection.
47   /// \thePoint the mouse point
48   void onMouseMoved(QPoint thePoint);
49
50   /// SLOT, to apply to the current viewer the operation
51   /// \param theX the X projection value
52   /// \param theY the Y projection value
53   /// \param theZ the Z projection value
54   void onViewerProjectionChange(double theX, double theY, double theZ);
55
56 private:
57   XGUI_Workshop* myWorkshop;
58   PartSet_Listener* myListener;
59
60   std::map<std::string, std::string> myFeaturesInFiles;
61 };
62
63 #endif