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>
17 \class PartSet_OperationFeatureEditMulti
18 * \brief The operation for the sketch feature creation
20 class PARTSET_EXPORT PartSet_OperationFeatureEditMulti : public PartSet_OperationSketchBase
23 /// Struct to define gp point, with the state is the point is initialized
31 /// \param thePoint the point
32 Point(gp_Pnt thePoint)
40 /// clear the initialized flag.
43 myIsInitialized = false;
45 /// set the point and switch on the initialized flag
46 /// \param thePoint the point
47 void setPoint(const gp_Pnt& thePoint)
49 myIsInitialized = true;
53 bool myIsInitialized; /// the state whether the point is set
54 gp_Pnt myPoint; /// the point
58 /// Returns the operation type key
59 static std::string Type()
66 /// \param theId the feature identifier
67 /// \param theParent the operation parent
68 /// \param theFeature the parent feature
69 PartSet_OperationFeatureEditMulti(const QString& theId, QObject* theParent,
70 CompositeFeaturePtr theFeature);
72 virtual ~PartSet_OperationFeatureEditMulti();
74 /// Initialisation of operation with preliminary selection
75 /// \param theSelected the list of selected presentations
76 /// \param theHighlighted the list of highlighted presentations
77 virtual void initSelection(const QList<ModuleBase_ViewerPrs>& theSelected,
78 const QList<ModuleBase_ViewerPrs>& theHighlighted);
80 /// Returns the operation sketch feature
81 /// \returns the sketch instance
82 virtual CompositeFeaturePtr sketch() const;
84 /// Processes the mouse pressed in the point
85 /// \param theEvent the mouse event
86 /// \param theView a viewer to have the viewer the eye position
87 /// \param theSelected the list of selected presentations
88 /// \param theHighlighted the list of highlighted presentations
89 virtual void mousePressed(QMouseEvent* theEvent, ModuleBase_IViewer* theViewer, ModuleBase_ISelection* theSelection);
91 /// Gives the current mouse point in the viewer
92 /// \param theEvent the mouse event
93 /// \param theView a viewer to have the viewer the eye position
94 virtual void mouseMoved(QMouseEvent* theEvent, ModuleBase_IViewer* theViewer);
96 /// Gives the current selected objects to be processed by the operation
97 /// \param thePoint a point clicked in the viewer
98 /// \param theEvent the mouse event
99 /// \param theSelected the list of selected presentations
100 /// \param theHighlighted the list of highlighted presentations
101 virtual void mouseReleased(QMouseEvent* theEvent, ModuleBase_IViewer* theViewer,
102 ModuleBase_ISelection* theSelection);
105 /// \brief Virtual method called when operation is started
106 /// Virtual method called when operation started (see start() method for more description)
107 /// Switch off the multi selection state
108 virtual void startOperation();
110 /// Virtual method called when operation stopped - committed or aborted.
111 /// Restore the multi selection state
112 virtual void stopOperation();
115 /// Emits a signal about the selection blocking. Emits a signal to change the selection.
116 /// If the block is true, the signal clear selection, otherwise if restore selection flag allows,
117 /// the internal operation features are to be selected
118 /// \param isBlocked the state whether the operation is blocked or unblocked
119 /// \param isRestoreSelection the state whether the selected objects should be reselected
120 //void blockSelection(bool isBlocked, const bool isRestoreSelection = true);
122 /// Sends the features
126 CompositeFeaturePtr mySketch; ///< the sketch feature
127 QList<ModuleBase_ViewerPrs> myFeatures; ///< the features to apply the edit operation
128 Point myCurPoint; ///< the current 3D point clicked or moved
129 bool myIsBlockedSelection; ///< the state of the last state of selection blocked signal