]> SALOME platform Git repositories - modules/shaper.git/blob - src/PartSet/PartSet_Module.h
Salome HOME
ba120ea0940d858fc4f0210e96c93b685fd21a48
[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 XGUI_ViewWindow;
15 class QMouseEvent;
16 class PartSet_Listener;
17
18 class PARTSET_EXPORT PartSet_Module: public QObject, public XGUI_Module
19 {
20 Q_OBJECT
21
22 public:
23   PartSet_Module(XGUI_Workshop* theWshop);
24   virtual ~PartSet_Module();
25
26   virtual void createFeatures();
27   virtual void featureCreated(XGUI_Command* theFeature);
28   virtual QStringList nestedFeatures(QString theFeature);
29   std::string featureFile(const std::string&);
30
31   virtual void launchOperation(const QString& theCmdId);
32
33   /// Displays or erase the current operation preview, if it has it.
34   /// \param isDisplay the state whether the presentation should be displayed or erased
35   void visualizePreview(bool isDisplay);
36
37 public slots:
38   void onFeatureTriggered();
39   /// SLOT, that is called after the operation is started. Perform some specific for module
40   /// actions, e.g. connect the sketch feature to the viewer selection and show the sketch preview.
41   void onOperationStarted();
42   /// SLOT, that is called after the operation is stopped. Disconnect the sketch feature
43   /// from the viewer selection and show the sketch preview.
44   void onOperationStopped(ModuleBase_Operation* theOperation);
45
46   /// SLOT, that is called by the selection in the viewer is changed.
47   /// The selection is sent to the current operation if it listens selection.
48   void onSelectionChanged();
49   /// SLOT, that is called by mouse click in the viewer.
50   /// The mouse released point is sent to the current operation to be processed.
51   /// \param theWindow the window where the signal appears
52   /// \param theEvent the mouse event
53   void onMouseReleased(XGUI_ViewWindow* theWindow, QMouseEvent* theEvent);
54   /// SLOT, that is called by the selection in the viewer is changed.
55   /// The mouse moved point is sent to the current operation to be processed.
56   /// \param theWindow the window where the signal appears
57   /// \param theEvent the mouse event
58   void onMouseMoved(XGUI_ViewWindow* theWindow, QMouseEvent* theEvent);
59
60   /// SLOT, to apply to the current viewer the operation
61   /// \param theX the X projection value
62   /// \param theY the Y projection value
63   /// \param theZ the Z projection value
64   void onPlaneSelected(double theX, double theY, double theZ);
65
66 private:
67   XGUI_Workshop* myWorkshop;
68   PartSet_Listener* myListener;
69
70   std::map<std::string, std::string> myFeaturesInFiles;
71 };
72
73 #endif