X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_OperationEditLine.h;h=d42d0e545fb38022f6f716bd69b77935b83425bc;hb=004fa7f94b343a782405d3fe21973521150729b4;hp=826a5f9aedf77a4132e8dcf6fc3d94db16e2a0fc;hpb=65350bc1b9ac17e42959fb98d650a7791b3cdf06;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_OperationEditLine.h b/src/PartSet/PartSet_OperationEditLine.h index 826a5f9ae..d42d0e545 100644 --- a/src/PartSet/PartSet_OperationEditLine.h +++ b/src/PartSet/PartSet_OperationEditLine.h @@ -16,7 +16,7 @@ class QMouseEvent; \class PartSet_OperationEditLine * \brief The operation for the sketch feature creation */ -class PARTSET_EXPORT PartSet_OperationEditLine : public PartSet_OperationSketchBase +class PARTSET_EXPORT PartSet_OperationEditLine : public PartSet_OperationSketchBase { Q_OBJECT /// Struct to define gp point, with the state is the point is initialized @@ -60,9 +60,10 @@ public: /// Destructor virtual ~PartSet_OperationEditLine(); - /// Returns that this operator can be started above already running one. - /// The runned operation should be the sketch feature modified operation - virtual bool isGranted() const; + /// Returns that this operator can be started above already running one. + /// The runned operation should be the sketch feature modified operation + /// \param theOperation the previous running operation + virtual bool isGranted(ModuleBase_IOperation* theOperation) const; /// Returns the operation local selection mode /// \param theFeature the feature object to get the selection mode @@ -71,24 +72,36 @@ public: /// Initializes some fields accorging to the feature /// \param theFeature the feature - virtual void init(boost::shared_ptr theFeature); + /// \param theSelected the list of selected presentations + /// \param theHighlighted the list of highlighted presentations + virtual void init(boost::shared_ptr theFeature, + const std::list& theSelected, + const std::list& theHighlighted); + + /// Returns the operation sketch feature + /// \returns the sketch instance + virtual boost::shared_ptr sketch() const; /// Processes the mouse pressed in the point - /// \param thePoint a point clicked in the viewer /// \param theEvent the mouse event - virtual void mousePressed(QMouseEvent* theEvent, Handle_V3d_View theView); + /// \param theView a viewer to have the viewer the eye position + /// \param theSelected the list of selected presentations + /// \param theHighlighted the list of highlighted presentations + virtual void mousePressed(QMouseEvent* theEvent, Handle_V3d_View theView, + const std::list& theSelected, + const std::list& theHighlighted); /// Gives the current mouse point in the viewer - /// \param thePoint a point clicked in the viewer /// \param theEvent the mouse event - /// \param theSelected the list of selected presentations - virtual void mouseMoved(QMouseEvent* theEvent, Handle_V3d_View theView, - const std::list& theSelected); + /// \param theView a viewer to have the viewer the eye position + virtual void mouseMoved(QMouseEvent* theEvent, Handle_V3d_View theView); /// Gives the current selected objects to be processed by the operation /// \param thePoint a point clicked in the viewer /// \param theEvent the mouse event /// \param theSelected the list of selected presentations + /// \param theHighlighted the list of highlighted presentations virtual void mouseReleased(QMouseEvent* theEvent, Handle_V3d_View theView, - const std::list& theSelected); + const std::list& theSelected, + const std::list& theHighlighted); protected: /// \brief Virtual method called when operation is started /// Virtual method called when operation started (see start() method for more description) @@ -101,10 +114,18 @@ protected: /// Creates an operation new feature /// Returns NULL feature. This is an operation of edition, not creation. + /// \param theFlushMessage the flag whether the create message should be flushed /// \returns the created feature - virtual boost::shared_ptr createFeature(); + virtual boost::shared_ptr createFeature(const bool theFlushMessage = true); protected: + /// Emits a signal about the selection blocking. Emits a signal to change the selection. + /// If the block is true, the signal clear selection, otherwise if restore selection flag allows, + /// the internal operation features are to be selected + /// \param isBlocked the state whether the operation is blocked or unblocked + /// \param isRestoreSelection the state whether the selected objects should be reselected + void blockSelection(bool isBlocked, const bool isRestoreSelection = true); + /// \brief Save the point to the line. /// \param theFeature the source feature /// \param theDeltaX the delta for X coordinate is moved @@ -113,11 +134,15 @@ protected: void moveLinePoint(boost::shared_ptr theFeature, double theDeltaX, double theDeltaY, const std::string& theAttribute); + /// Sends the features + void sendFeatures(); private: boost::shared_ptr mySketch; ///< the sketch feature + std::list myFeatures; ///< the features to apply the edit operation Point myCurPoint; ///< the current 3D point clicked or moved gp_Pnt myCurPressed; ///< the current 3D point clicked or moved + bool myIsBlockedSelection; ///< the state of the last state of selection blocked signal }; #endif