1 // File: PartSet_OperationFeatureEditMulti.h
2 // Created: 05 May 2014
3 // Author: Natalia ERMOLAEVA
5 #ifndef PartSet_OperationFeatureEditMulti_H
6 #define PartSet_OperationFeatureEditMulti_H
10 #include <PartSet_OperationSketchBase.h>
20 \class PartSet_OperationFeatureEditMulti
21 * \brief The operation for the sketch feature creation
23 class PARTSET_EXPORT PartSet_OperationFeatureEditMulti : public PartSet_OperationSketchBase
26 /// Struct to define gp point, with the state is the point is initialized
34 /// \param thePoint the point
35 Point(gp_Pnt thePoint)
43 /// clear the initialized flag.
46 myIsInitialized = false;
48 /// set the point and switch on the initialized flag
49 /// \param thePoint the point
50 void setPoint(const gp_Pnt& thePoint)
52 myIsInitialized = true;
56 bool myIsInitialized; /// the state whether the point is set
57 gp_Pnt myPoint; /// the point
61 /// Returns the operation type key
62 static std::string Type()
69 /// \param theId the feature identifier
70 /// \param theParent the operation parent
71 /// \param theFeature the parent feature
72 PartSet_OperationFeatureEditMulti(const QString& theId, QObject* theParent,
73 CompositeFeaturePtr theFeature);
75 virtual ~PartSet_OperationFeatureEditMulti();
77 /// Initialisation of operation with preliminary selection
78 /// \param theSelected the list of selected presentations
79 /// \param theHighlighted the list of highlighted presentations
80 /// \param theViewer a viewer to have the viewer the eye position
81 virtual void initSelection(ModuleBase_ISelection* theSelection,
82 ModuleBase_IViewer* theViewer);
84 /// Returns the operation sketch feature
85 /// \returns the sketch instance
86 virtual CompositeFeaturePtr sketch() const;
88 /// Processes the mouse pressed in the point
89 /// \param theEvent the mouse event
90 /// \param theView a viewer to have the viewer the eye position
91 /// \param theSelected the list of selected presentations
92 /// \param theHighlighted the list of highlighted presentations
93 //virtual void mousePressed(QMouseEvent* theEvent, ModuleBase_IViewer* theViewer, ModuleBase_ISelection* theSelection);
95 /// Gives the current mouse point in the viewer
96 /// \param theEvent the mouse event
97 /// \param theView a viewer to have the viewer the eye position
98 virtual void mouseMoved(QMouseEvent* theEvent, ModuleBase_IViewer* theViewer);
100 /// Gives the current selected objects to be processed by the operation
101 /// \param thePoint a point clicked in the viewer
102 /// \param theEvent the mouse event
103 /// \param theSelected the list of selected presentations
104 /// \param theHighlighted the list of highlighted presentations
105 virtual void mouseReleased(QMouseEvent* theEvent, ModuleBase_IViewer* theViewer,
106 ModuleBase_ISelection* theSelection);
109 /// \brief Virtual method called when operation is started
110 /// Virtual method called when operation started (see start() method for more description)
111 /// Switch off the multi selection state
112 virtual void startOperation();
114 /// Virtual method called when operation stopped - committed or aborted.
115 /// Restore the multi selection state
116 virtual void stopOperation();
119 /// Emits a signal about the selection blocking. Emits a signal to change the selection.
120 /// If the block is true, the signal clear selection, otherwise if restore selection flag allows,
121 /// the internal operation features are to be selected
122 /// \param isBlocked the state whether the operation is blocked or unblocked
123 /// \param isRestoreSelection the state whether the selected objects should be reselected
124 //void blockSelection(bool isBlocked, const bool isRestoreSelection = true);
126 /// Sends the features
130 // the next map should be removed when selection is processed in the move function
131 std::map<FeaturePtr, std::list<std::string> > myFeature2Attribute; /// a map of a feature to attributes
133 CompositeFeaturePtr mySketch; ///< the sketch feature
134 Point myCurPoint; ///< the current 3D point clicked or moved
135 bool myIsBlockedSelection; ///< the state of the last state of selection blocked signal