X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_OperationFeatureEdit.h;h=267b494c67d2bc75b0a5833e1982e0b667481fe1;hb=d22fc665c79c31c9eea0625e04c2e941adfdf7be;hp=67223fce62fa0b756da56fae9c00c33cda84ca0c;hpb=19bc85698899d6bee8704e7b0953ee045b0eb66f;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_OperationFeatureEdit.h b/src/PartSet/PartSet_OperationFeatureEdit.h index 67223fce6..267b494c6 100644 --- a/src/PartSet/PartSet_OperationFeatureEdit.h +++ b/src/PartSet/PartSet_OperationFeatureEdit.h @@ -11,6 +11,7 @@ #include class QMouseEvent; +class ModuleBase_ISelection; /*! \class PartSet_OperationFeatureEdit @@ -66,30 +67,36 @@ Q_OBJECT /// \param theId the feature identifier /// \param theParent the operation parent /// \param theFeature the parent feature - PartSet_OperationFeatureEdit(const QString& theId, QObject* theParent, FeaturePtr theFeature); + PartSet_OperationFeatureEdit(const QString& theId, QObject* theParent, CompositeFeaturePtr theFeature); /// Destructor virtual ~PartSet_OperationFeatureEdit(); + + /// Initialisation of operation with preliminary selection + /// \param theSelected the list of selected presentations + /// \param theHighlighted the list of highlighted presentations + /// \param theViewer a viewer to have the viewer the eye position + virtual void initSelection(ModuleBase_ISelection* theSelection, + ModuleBase_IViewer* theViewer); + /// Processes the mouse pressed in the point /// \param theEvent the mouse event /// \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); + virtual void mousePressed(QMouseEvent* theEvent, ModuleBase_IViewer* theViewer, ModuleBase_ISelection* theSelection); + /// Gives the current mouse point in the viewer /// \param theEvent the mouse event /// \param theView a viewer to have the viewer the eye position - virtual void mouseMoved(QMouseEvent* theEvent, Handle_V3d_View theView); + virtual void mouseMoved(QMouseEvent* theEvent, ModuleBase_IViewer* theViewer); /// 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& theHighlighted); + virtual void mouseReleased(QMouseEvent* theEvent, ModuleBase_IViewer* theViewer, + ModuleBase_ISelection* theSelection); /// Processes the mouse double click in the point /// \param theEvent the mouse event @@ -97,8 +104,7 @@ Q_OBJECT /// \param theSelected the list of selected presentations /// \param theHighlighted the list of highlighted presentations virtual void mouseDoubleClick(QMouseEvent* theEvent, Handle_V3d_View theView, - const std::list& theSelected, - const std::list& theHighlighted); + ModuleBase_ISelection* theSelection); protected: /// \brief Virtual method called when operation is started @@ -114,22 +120,37 @@ Q_OBJECT /// 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 FeaturePtr createFeature(const bool theFlushMessage = true); + virtual FeaturePtr createFeature(const bool theFlushMessage = true, + CompositeFeaturePtr theCompositeFeature = CompositeFeaturePtr()); protected: + void fillFeature2Attribute(const QList& thePresentations, + ModuleBase_IViewer* theViewer, + std::map >& theFeature2Attribute); + /// 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); + //void blockSelection(bool isBlocked, const bool isRestoreSelection = true); /// Sends the features - void sendFeatures(); + /// \param theIsAllFeatures a boolean value whether all features should be send or only the highlighted ones + void sendFeatures(const bool theIsAllFeatures); + + /// Sends signal about the current features are to be deactivated + void emitFeaturesDeactivation(); private: + // the next map should be removed when selection is processed in the move function + std::map > myHighlightedFeature2Attribute; /// a map of a feature to attributes + std::map > myAllFeature2Attribute; /// a map of a feature to attributes + Point myCurPoint; ///< the current 3D point clicked or moved bool myIsBlockedSelection; ///< the state of the last state of selection blocked signal + bool myIsBlockedByDoubleClick; ///< the block value by double click is processed to avoid + ///< the mouse button release processing before the double click is finished }; #endif