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 virtual void launchOperation(const QString& theCmdId);
36 /// Displays or erase the current operation preview, if it has it.
38 /// \param isDisplay the state whether the presentation should be displayed or erased
39 void visualizePreview(boost::shared_ptr<ModelAPI_Feature> theFeature, bool isDisplay);
42 void onFeatureTriggered();
43 /// SLOT, that is called after the operation is started. Perform some specific for module
44 /// actions, e.g. connect the sketch feature to the viewer selection and show the sketch preview.
45 void onOperationStarted();
46 /// SLOT, that is called after the operation is stopped. Disconnect the sketch feature
47 /// from the viewer selection and show the sketch preview.
48 void onOperationStopped(ModuleBase_Operation* theOperation);
50 /// SLOT, that is called by the selection in the viewer is changed.
51 /// The selection is sent to the current operation if it listens selection.
52 void onSelectionChanged();
53 /// SLOT, that is called by mouse click in the viewer.
54 /// The mouse released point is sent to the current operation to be processed.
55 /// \param theEvent the mouse event
56 void onMouseReleased(QMouseEvent* theEvent);
57 /// SLOT, that is called by the selection in the viewer is changed.
58 /// The mouse moved point is sent to the current operation to be processed.
59 /// \param theEvent the mouse event
60 void onMouseMoved(QMouseEvent* theEvent);
62 /// SLOT, that is called by the key in the viewer is clicked.
63 /// \param theEvent the mouse event
64 void onKeyRelease(QKeyEvent*);
66 /// SLOT, to apply to the current viewer the operation
67 /// \param theX the X projection value
68 /// \param theY the Y projection value
69 /// \param theZ the Z projection value
70 void onPlaneSelected(double theX, double theY, double theZ);
72 /// SLOT, to visualize the feature in another local context mode
73 /// \param theFeature the feature to be put in another local context mode
74 void onFeatureConstructed(boost::shared_ptr<ModelAPI_Feature> theFeature);
77 XGUI_Workshop* myWorkshop;
78 PartSet_Listener* myListener;
80 std::map<std::string, std::string> myFeaturesInFiles;