1 #ifndef PartSet_Module_H
2 #define PartSet_Module_H
6 #include <XGUI_Module.h>
7 #include <XGUI_Command.h>
14 #include <boost/shared_ptr.hpp>
18 class PartSet_Listener;
19 class ModelAPI_Feature;
21 class PARTSET_EXPORT PartSet_Module: public QObject, public XGUI_Module
26 PartSet_Module(XGUI_Workshop* theWshop);
27 virtual ~PartSet_Module();
29 virtual void createFeatures();
30 virtual void featureCreated(XGUI_Command* theFeature);
31 virtual QStringList nestedFeatures(QString theFeature);
32 std::string featureFile(const std::string&);
34 /// Creates an operation and send it to loop
35 /// \param theCmdId the operation name
36 virtual void launchOperation(const QString& theCmdId);
38 /// Displays or erase the current operation preview, if it has it.
40 /// \param isDisplay the state whether the presentation should be displayed or erased
41 void visualizePreview(boost::shared_ptr<ModelAPI_Feature> theFeature, bool isDisplay);
44 void onFeatureTriggered();
45 /// SLOT, that is called after the operation is started. Perform some specific for module
46 /// actions, e.g. connect the sketch feature to the viewer selection and show the sketch preview.
47 void onOperationStarted();
48 /// SLOT, that is called after the operation is stopped. Disconnect the sketch feature
49 /// from the viewer selection and show the sketch preview.
50 void onOperationStopped(ModuleBase_Operation* theOperation);
52 /// SLOT, that is called by the selection in the viewer is changed.
53 /// The selection is sent to the current operation if it listens selection.
54 void onSelectionChanged();
55 /// SLOT, that is called by mouse click in the viewer.
56 /// The mouse released point is sent to the current operation to be processed.
57 /// \param theEvent the mouse event
58 void onMouseReleased(QMouseEvent* theEvent);
59 /// SLOT, that is called by the selection in the viewer is changed.
60 /// The mouse moved point is sent to the current operation to be processed.
61 /// \param theEvent the mouse event
62 void onMouseMoved(QMouseEvent* theEvent);
64 /// SLOT, that is called by the key in the viewer is clicked.
65 /// \param theEvent the mouse event
66 void onKeyRelease(QKeyEvent*);
68 /// SLOT, to apply to the current viewer the operation
69 /// \param theX the X projection value
70 /// \param theY the Y projection value
71 /// \param theZ the Z projection value
72 void onPlaneSelected(double theX, double theY, double theZ);
74 void onLaunchOperation(std::string theName, boost::shared_ptr<ModelAPI_Feature> theFeature);
76 /// SLOT, to visualize the feature in another local context mode
77 /// \param theFeature the feature to be put in another local context mode
78 /// \param theMode the mode appeared on the feature
79 void onFeatureConstructed(boost::shared_ptr<ModelAPI_Feature> theFeature,
82 /// Creates a new operation
83 /// \param theCmdId the operation name
84 ModuleBase_Operation* createOperation(const QString& theCmdId);
86 /// Sends the operation
87 /// \param theOperation the operation
88 void sendOperation(ModuleBase_Operation* theOperation);
91 XGUI_Workshop* myWorkshop;
92 PartSet_Listener* myListener;
94 std::map<std::string, std::string> myFeaturesInFiles;