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