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>
16 class XGUI_ViewWindow;
19 class PartSet_Listener;
20 class ModelAPI_Feature;
22 class PARTSET_EXPORT PartSet_Module: public QObject, public XGUI_Module
27 PartSet_Module(XGUI_Workshop* theWshop);
28 virtual ~PartSet_Module();
30 virtual void createFeatures();
31 virtual void featureCreated(XGUI_Command* theFeature);
32 virtual QStringList nestedFeatures(QString theFeature);
33 std::string featureFile(const std::string&);
35 virtual void launchOperation(const QString& theCmdId);
37 /// Displays or erase the current operation preview, if it has it.
39 /// \param isDisplay the state whether the presentation should be displayed or erased
40 void visualizePreview(boost::shared_ptr<ModelAPI_Feature> theFeature, bool isDisplay);
43 void onFeatureTriggered();
44 /// SLOT, that is called after the operation is started. Perform some specific for module
45 /// actions, e.g. connect the sketch feature to the viewer selection and show the sketch preview.
46 void onOperationStarted();
47 /// SLOT, that is called after the operation is stopped. Disconnect the sketch feature
48 /// from the viewer selection and show the sketch preview.
49 void onOperationStopped(ModuleBase_Operation* theOperation);
51 /// SLOT, that is called by the selection in the viewer is changed.
52 /// The selection is sent to the current operation if it listens selection.
53 void onSelectionChanged();
54 /// SLOT, that is called by mouse click in the viewer.
55 /// The mouse released 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 onMouseReleased(XGUI_ViewWindow* theWindow, 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 theWindow the window where the signal appears
62 /// \param theEvent the mouse event
63 void onMouseMoved(XGUI_ViewWindow* theWindow, QMouseEvent* theEvent);
65 /// SLOT, that is called by the key in the viewer is clicked.
66 /// \param theWindow the window where the signal appears
67 /// \param theEvent the mouse event
68 void onKeyRelease(XGUI_ViewWindow*, QKeyEvent*);
70 /// SLOT, to apply to the current viewer the operation
71 /// \param theX the X projection value
72 /// \param theY the Y projection value
73 /// \param theZ the Z projection value
74 void onPlaneSelected(double theX, double theY, double theZ);
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 void onFeatureConstructed(boost::shared_ptr<ModelAPI_Feature> theFeature);
81 XGUI_Workshop* myWorkshop;
82 PartSet_Listener* myListener;
84 std::map<std::string, std::string> myFeaturesInFiles;