]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
refs #80 - Sketch base GUI: create/draw point, circle and arc
authornds <natalia.donis@opencascade.com>
Fri, 20 Jun 2014 06:11:16 +0000 (10:11 +0400)
committernds <natalia.donis@opencascade.com>
Fri, 20 Jun 2014 06:11:16 +0000 (10:11 +0400)
1. Edit constraint text.

src/PartSet/CMakeLists.txt
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_OperationEditConstraint.cpp [new file with mode: 0644]
src/PartSet/PartSet_OperationEditConstraint.h [new file with mode: 0644]
src/PartSet/PartSet_OperationSketch.cpp
src/PartSet/PartSet_OperationSketch.h
src/PartSet/PartSet_OperationSketchBase.cpp

index 524327e825f4b254b4ae96962f856884dd6901f8..254cd957226fca26d3fd5e979e5ee2f888e53672 100644 (file)
@@ -17,6 +17,7 @@ SET(PROJECT_HEADERS
        PartSet_OperationConstraint.h
        PartSet_OperationCreateConstraint.h
        PartSet_OperationCreateFeature.h
+       PartSet_OperationEditConstraint.h
        PartSet_OperationEditFeature.h
        PartSet_OperationSketchBase.h
        PartSet_OperationSketch.h
@@ -38,6 +39,7 @@ SET(PROJECT_SOURCES
        PartSet_OperationConstraint.cpp
        PartSet_OperationCreateConstraint.cpp
        PartSet_OperationCreateFeature.cpp
+       PartSet_OperationEditConstraint.cpp
        PartSet_OperationEditFeature.cpp
        PartSet_OperationSketchBase.cpp
        PartSet_OperationSketch.cpp
index 7590e3b8020a80c81af673c17545b2937f45c6b6..ab0ad429bebdb06099a4f7f8da495de59f30e0cc 100644 (file)
@@ -2,6 +2,7 @@
 #include <PartSet_OperationSketch.h>
 #include <PartSet_OperationCreateFeature.h>
 #include <PartSet_OperationEditFeature.h>
+#include <PartSet_OperationEditConstraint.h>
 #include <PartSet_OperationConstraint.h>
 #include <PartSet_OperationCreateConstraint.h>
 #include <ModuleBase_Operation.h>
@@ -347,6 +348,8 @@ ModuleBase_Operation* PartSet_Module::createOperation(const std::string& theCmdI
       anOperation = new PartSet_OperationEditFeature(theCmdId.c_str(), this, aSketch);
     else if (PartSet_OperationCreateConstraint::canProcessKind(theCmdId))
       anOperation = new PartSet_OperationCreateConstraint(theCmdId.c_str(), this, aSketch);
+    else if (theCmdId == PartSet_OperationEditConstraint::Type())
+      anOperation = new PartSet_OperationEditConstraint(theCmdId.c_str(), this, aSketch);
     else if (theCmdId == PartSet_OperationConstraint::Type())
       anOperation = new PartSet_OperationConstraint(theCmdId.c_str(), this, aSketch);
   }
diff --git a/src/PartSet/PartSet_OperationEditConstraint.cpp b/src/PartSet/PartSet_OperationEditConstraint.cpp
new file mode 100644 (file)
index 0000000..5abe06d
--- /dev/null
@@ -0,0 +1,258 @@
+// File:        PartSet_OperationEditConstraint.h
+// Created:     05 May 2014
+// Author:      Natalia ERMOLAEVA
+
+#include <PartSet_OperationEditConstraint.h>
+#include <PartSet_Tools.h>
+#include <PartSet_OperationSketch.h>
+#include <PartSet_EditLine.h>
+#include <SketchPlugin_ConstraintLength.h>
+
+#include <ModuleBase_OperationDescription.h>
+#include <Model_Events.h>
+
+#include <XGUI_ViewerPrs.h>
+
+#include <SketchPlugin_Feature.h>
+#include <GeomDataAPI_Point2D.h>
+#include <ModelAPI_Data.h>
+#include <ModelAPI_Document.h>
+
+#include <Model_Events.h>
+
+#include <Events_Loop.h>
+
+#include <SketchPlugin_Line.h>
+
+#include <V3d_View.hxx>
+#include <AIS_LengthDimension.hxx>
+
+#ifdef _DEBUG
+#include <QDebug>
+#endif
+
+#include <QMouseEvent>
+
+using namespace std;
+
+PartSet_OperationEditConstraint::PartSet_OperationEditConstraint(const QString& theId,
+                                                 QObject* theParent,
+                                              FeaturePtr theFeature)
+: PartSet_OperationSketchBase(theId, theParent), mySketch(theFeature), myIsBlockedSelection(false)
+{
+  // changed
+  myEditor = new PartSet_EditLine(0);
+  connect(myEditor, SIGNAL(stopped(double)), this, SLOT(onEditStopped(double)));
+}
+
+PartSet_OperationEditConstraint::~PartSet_OperationEditConstraint()
+{
+}
+
+bool PartSet_OperationEditConstraint::isGranted(ModuleBase_IOperation* theOperation) const
+{
+  return theOperation->getDescription()->operationId().toStdString() == PartSet_OperationSketch::Type();
+}
+
+std::list<int> PartSet_OperationEditConstraint::getSelectionModes(FeaturePtr theFeature) const
+{
+  return PartSet_OperationSketchBase::getSelectionModes(theFeature);
+}
+
+void PartSet_OperationEditConstraint::init(FeaturePtr theFeature,
+                                     const std::list<XGUI_ViewerPrs>& theSelected,
+                                     const std::list<XGUI_ViewerPrs>& theHighlighted)
+{
+  setFeature(theFeature);
+
+  if (!theHighlighted.empty()) {
+    // if there is highlighted object, we check whether it is in the list of selected objects
+    // in that case this object is a handle of the moved lines. If there no such object in the selection,
+    // the hightlighted object should moved and the selection is skipped. The skipped selection will be
+    // deselected in the viewer by blockSelection signal in the startOperation method.
+    bool isSelected = false;
+    std::list<XGUI_ViewerPrs>::const_iterator anIt = theSelected.begin(), aLast = theSelected.end();
+    for (; anIt != aLast && !isSelected; anIt++) {
+      isSelected = (*anIt).feature() == feature();
+    }
+    if (!isSelected)
+      myFeatures = theHighlighted;
+    else
+      myFeatures = theSelected;
+  }
+  else
+    myFeatures = theSelected;
+}
+
+FeaturePtr PartSet_OperationEditConstraint::sketch() const
+{
+  return mySketch;
+}
+
+void PartSet_OperationEditConstraint::mousePressed(QMouseEvent* theEvent, Handle(V3d_View) theView,
+                                             const std::list<XGUI_ViewerPrs>& /*theSelected*/,
+                                             const std::list<XGUI_ViewerPrs>& theHighlighted)
+{
+  if (myFeatures.size() == 1)
+  {
+    FeaturePtr aFeature;
+    if (!theHighlighted.empty())
+      aFeature = theHighlighted.front().feature();
+
+    if (aFeature && aFeature == feature()) { // continue the feature edit
+    }
+    else {
+      XGUI_ViewerPrs aFeaturePrs = myFeatures.front();
+      commit();
+      emit featureConstructed(feature(), FM_Deactivation);
+
+      bool aHasShift = (theEvent->modifiers() & Qt::ShiftModifier);
+      if(aHasShift && !theHighlighted.empty()) {
+        std::list<XGUI_ViewerPrs> aSelected;
+        aSelected.push_back(aFeaturePrs);
+        aSelected.push_back(theHighlighted.front());
+        emit setSelection(aSelected);
+      }
+      else if (aFeature) {
+        restartOperation(PartSet_OperationEditConstraint::Type(), aFeature);
+      }
+    }
+  }
+}
+
+void PartSet_OperationEditConstraint::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View) theView)
+{
+  if (!(theEvent->buttons() &  Qt::LeftButton))
+    return;
+
+  gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theView);
+
+  blockSelection(true);
+  if (myCurPoint.myIsInitialized) {
+    double aCurX, aCurY;
+    PartSet_Tools::convertTo2D(myCurPoint.myPoint, sketch(), theView, aCurX, aCurY);
+
+    double aX, anY;
+    PartSet_Tools::convertTo2D(aPoint, sketch(), theView, aX, anY);
+
+    double aDeltaX = aX - aCurX;
+    double aDeltaY = anY - aCurY;
+
+    PartSet_Tools::moveFeature(feature(), aDeltaX, aDeltaY);
+
+    std::list<XGUI_ViewerPrs>::const_iterator anIt = myFeatures.begin(), aLast = myFeatures.end();
+    for (; anIt != aLast; anIt++) {
+      FeaturePtr aFeature = (*anIt).feature();
+      if (!aFeature || aFeature == feature())
+        continue;
+      PartSet_Tools::moveFeature(aFeature, aDeltaX, aDeltaY);
+    }
+  }
+  sendFeatures();
+
+  myCurPoint.setPoint(aPoint);
+}
+
+void PartSet_OperationEditConstraint::mouseReleased(QMouseEvent* theEvent, Handle(V3d_View) theView,
+                                              const std::list<XGUI_ViewerPrs>& /*theSelected*/,
+                                              const std::list<XGUI_ViewerPrs>& /*theHighlighted*/)
+{
+  std::list<XGUI_ViewerPrs> aFeatures = myFeatures;
+  if (myFeatures.size() == 1) {
+    blockSelection(false);
+  }
+  else {
+    commit();
+    std::list<XGUI_ViewerPrs>::const_iterator anIt = aFeatures.begin(), aLast = aFeatures.end();
+    for (; anIt != aLast; anIt++) {
+      FeaturePtr aFeature = (*anIt).feature();
+      if (aFeature)
+        emit featureConstructed(aFeature, FM_Deactivation);
+    }
+  }
+}
+
+void PartSet_OperationEditConstraint::mouseDoubleClick(QMouseEvent* theEvent, Handle_V3d_View theView,
+                                               const std::list<XGUI_ViewerPrs>& theSelected,
+                                               const std::list<XGUI_ViewerPrs>& theHighlighted)
+{
+  // changed
+  if (!theSelected.empty()) {
+
+    double aValue;
+    if(PartSet_Tools::featureValue(feature(), CONSTRAINT_ATTR_VALUE, aValue)) {
+      QPoint aPos = theEvent->globalPos();
+      myEditor->start(aPos, aValue);
+    }
+  }
+}
+
+void PartSet_OperationEditConstraint::startOperation()
+{
+  // do nothing in order to do not create a new feature
+  emit multiSelectionEnabled(false);
+
+  if (myFeatures.size() > 1)
+    blockSelection(true);
+
+  myCurPoint.clear();
+}
+
+void PartSet_OperationEditConstraint::stopOperation()
+{
+  emit multiSelectionEnabled(true);
+
+  blockSelection(false, myFeatures.size() > 1);
+
+  myFeatures.clear();
+}
+
+void PartSet_OperationEditConstraint::blockSelection(bool isBlocked, const bool isRestoreSelection)
+{
+  if (myIsBlockedSelection == isBlocked)
+    return;
+
+  myIsBlockedSelection = isBlocked;
+  if (isBlocked) {
+    emit setSelection(std::list<XGUI_ViewerPrs>());
+    emit stopSelection(myFeatures, true);
+  }
+  else {
+    emit stopSelection(myFeatures, false);
+    if (isRestoreSelection)
+      emit setSelection(myFeatures);
+  }
+}
+
+FeaturePtr PartSet_OperationEditConstraint::createFeature(const bool /*theFlushMessage*/)
+{
+  // do nothing in order to do not create a new feature
+  return FeaturePtr();
+}
+
+void PartSet_OperationEditConstraint::sendFeatures()
+{
+  static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_MOVED);
+
+  std::list<FeaturePtr > aFeatures;
+  std::list<XGUI_ViewerPrs>::const_iterator anIt = myFeatures.begin(), aLast = myFeatures.end();
+  for (; anIt != aLast; anIt++) {
+    FeaturePtr aFeature = (*anIt).feature();
+    if (!aFeature)
+      continue;
+
+    Model_FeatureUpdatedMessage aMessage(aFeature, anEvent);
+    Events_Loop::loop()->send(aMessage);
+  }
+  Events_Loop::loop()->flush(anEvent);
+  flushUpdated();
+}
+
+void PartSet_OperationEditConstraint::onEditStopped(double theValue)
+{
+  PartSet_Tools::setFeatureValue(feature(), theValue, CONSTRAINT_ATTR_VALUE);
+
+  flushUpdated();
+  commit();
+  //restartOperation(feature()->getKind(), FeaturePtr());
+}
diff --git a/src/PartSet/PartSet_OperationEditConstraint.h b/src/PartSet/PartSet_OperationEditConstraint.h
new file mode 100644 (file)
index 0000000..44c01bd
--- /dev/null
@@ -0,0 +1,155 @@
+// File:        PartSet_OperationEditConstraint.h
+// Created:     05 May 2014
+// Author:      Natalia ERMOLAEVA
+
+#ifndef PartSet_OperationEditConstraint_H
+#define PartSet_OperationEditConstraint_H
+
+#include "PartSet.h"
+
+#include <PartSet_OperationSketchBase.h>
+#include <QObject>
+
+class PartSet_EditLine;
+class QMouseEvent;
+
+/*!
+ \class PartSet_OperationEditConstraint
+ * \brief The operation for the sketch feature creation
+*/
+class PARTSET_EXPORT PartSet_OperationEditConstraint : public PartSet_OperationSketchBase                                                 
+{
+  Q_OBJECT
+  /// Struct to define gp point, with the state is the point is initialized
+  struct Point
+  {
+    /// Constructor
+    Point() {}
+    /// Constructor
+    /// \param thePoint the point
+    Point(gp_Pnt thePoint)
+    {
+      setPoint(thePoint);
+    }
+    ~Point() {}
+
+    /// clear the initialized flag.
+    void clear() { myIsInitialized = false; }
+    /// set the point and switch on the initialized flag
+    /// \param thePoint the point
+    void setPoint(const gp_Pnt& thePoint)
+    {
+      myIsInitialized = true;
+      myPoint = thePoint;
+    }
+
+    bool myIsInitialized; /// the state whether the point is set
+    gp_Pnt myPoint; /// the point
+  };
+
+public:
+  /// Returns the operation type key
+  static std::string Type() { return "EditConstraint"; }
+
+public:
+  /// Constructor
+  /// \param theId the feature identifier
+  /// \param theParent the operation parent
+  /// \param theFeature the parent feature
+  PartSet_OperationEditConstraint(const QString& theId, QObject* theParent,
+                            FeaturePtr theFeature);
+  /// Destructor
+  virtual ~PartSet_OperationEditConstraint();
+
+  /// 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
+  /// \return the selection mode
+  virtual std::list<int> getSelectionModes(FeaturePtr theFeature) const;
+
+  /// Initializes some fields accorging to the feature
+  /// \param theFeature the feature
+  /// \param theSelected the list of selected presentations
+  /// \param theHighlighted the list of highlighted presentations
+  virtual void init(FeaturePtr theFeature,
+                    const std::list<XGUI_ViewerPrs>& theSelected,
+                    const std::list<XGUI_ViewerPrs>& theHighlighted);
+
+  /// Returns the operation sketch feature
+  /// \returns the sketch instance
+  virtual FeaturePtr sketch() const;
+
+  /// 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<XGUI_ViewerPrs>& theSelected,
+                            const std::list<XGUI_ViewerPrs>& theHighlighted);
+  /// 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);
+  /// 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<XGUI_ViewerPrs>& theSelected,
+                            const std::list<XGUI_ViewerPrs>& theHighlighted);
+  /// Processes the mouse double click 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 mouseDoubleClick(QMouseEvent* theEvent, Handle_V3d_View theView,
+                                const std::list<XGUI_ViewerPrs>& theSelected,
+                                const std::list<XGUI_ViewerPrs>& theHighlighted);
+
+protected:
+  /// \brief Virtual method called when operation is started
+  /// Virtual method called when operation started (see start() method for more description)
+  /// Switch off the multi selection state
+  virtual void startOperation();
+
+  /// Virtual method called when operation stopped - committed or aborted.
+  /// Restore the multi selection state
+  virtual void stopOperation();
+
+  /// 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 FeaturePtr 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);
+
+  /// Sends the features
+  void sendFeatures();
+
+protected slots:
+  /// SLOT, that listens the value edited signal and set the new value to the feature
+  /// \param theValue the editor value
+  void onEditStopped(double theValue);
+
+private:
+  PartSet_EditLine* myEditor; ///< the constraint value editor
+  FeaturePtr mySketch; ///< the sketch feature
+  std::list<XGUI_ViewerPrs> myFeatures; ///< the features to apply the edit operation
+  Point myCurPoint; ///< the current 3D point clicked or moved
+  bool myIsBlockedSelection; ///< the state of the last state of selection blocked signal
+};
+
+#endif
index c028eab6e7a4e7233cd08ceeb7153ce5a44e8db4..ca9a6ac1e3757a2e43c5cd993005a78c14e44a1d 100644 (file)
@@ -5,9 +5,11 @@
 #include <PartSet_OperationSketch.h>
 
 #include <PartSet_OperationEditFeature.h>
+#include <PartSet_OperationEditConstraint.h>
 #include <PartSet_Tools.h>
 
 #include <SketchPlugin_Sketch.h>
+#include <SketchPlugin_ConstraintLength.h>
 
 #include <ModelAPI_Data.h>
 #include <ModelAPI_AttributeDouble.h>
@@ -90,14 +92,14 @@ void PartSet_OperationSketch::mousePressed(QMouseEvent* theEvent, Handle_V3d_Vie
     if (theHighlighted.size() == 1) {
       FeaturePtr aFeature = theHighlighted.front().feature();
       if (aFeature)
-        restartOperation(PartSet_OperationEditFeature::Type(), aFeature);
+        restartOperation(getOperationType(aFeature), aFeature);
     }
     else
       myFeatures = theHighlighted;
+
   }
 }
 
-#include <QLineEdit>
 void PartSet_OperationSketch::mouseReleased(QMouseEvent* theEvent, Handle_V3d_View theView,
                                             const std::list<XGUI_ViewerPrs>& theSelected,
                                             const std::list<XGUI_ViewerPrs>& theHighlighted)
@@ -105,59 +107,10 @@ void PartSet_OperationSketch::mouseReleased(QMouseEvent* theEvent, Handle_V3d_Vi
   if (!hasSketchPlane()) {
   }
   else {
-    if (!theSelected.empty()) {
-      XGUI_ViewerPrs aPrs = theSelected.front();
-      if (!aPrs.owner().IsNull()) {
-        Handle(AIS_DimensionOwner) anOwner = Handle(AIS_DimensionOwner)::DownCast(aPrs.owner());
-        if (!anOwner.IsNull() && anOwner->SelectionMode() == AIS_DSM_Text) {
-          Handle(SelectMgr_SelectableObject) anObject = anOwner->Selectable();
-          double aValue = 0;
-          if (!anObject.IsNull()) {
-            Handle(AIS_LengthDimension) aLenDim = Handle(AIS_LengthDimension)::DownCast(anObject);
-            if (!aLenDim.IsNull())
-              aValue = aLenDim->GetValue();
-          }
-
-          QLineEdit* aLine = new QLineEdit();
-          QPoint aViewPos = theEvent->globalPos();
-          QPoint aLinePos(aViewPos.x(), aViewPos.y());
-          aLine->move(aLinePos);
-          aLine->setText(QString::number(aValue));
-          aLine->show();
-        }
-      }
-    }
-  }
-}
-
-#include <QLineEdit>
-void PartSet_OperationSketch::mouseDoubleClick(QMouseEvent* theEvent, Handle_V3d_View theView,
-                                               const std::list<XGUI_ViewerPrs>& theSelected,
-                                               const std::list<XGUI_ViewerPrs>& theHighlighted)
-{
-  return;
-  if (!hasSketchPlane())
-    return;
-  if (!theSelected.empty()) {
-    XGUI_ViewerPrs aPrs = theSelected.front();
-    if (!aPrs.owner().IsNull()) {
-      Handle(AIS_DimensionOwner) anOwner = Handle(AIS_DimensionOwner)::DownCast(aPrs.owner());
-      if (!anOwner.IsNull() && anOwner->SelectionMode() == AIS_DSM_Text) {
-        Handle(SelectMgr_SelectableObject) anObject = anOwner->Selectable();
-        double aValue = 0;
-        if (!anObject.IsNull()) {
-          Handle(AIS_LengthDimension) aLenDim = Handle(AIS_LengthDimension)::DownCast(anObject);
-          if (!aLenDim.IsNull())
-            aValue = aLenDim->GetValue();
-        }
-
-        QLineEdit* aLine = new QLineEdit();
-        QPoint aViewPos = theEvent->globalPos();
-        QPoint aLinePos(aViewPos.x(), aViewPos.y());
-        aLine->move(aLinePos);
-        aLine->setText(QString::number(aValue));
-        aLine->show();
-      }
+    if (theSelected.size() == 1) {
+      FeaturePtr aFeature = theSelected.front().feature();
+      if (aFeature)
+        restartOperation(getOperationType(aFeature), aFeature);
     }
   }
 }
@@ -171,7 +124,7 @@ void PartSet_OperationSketch::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View)
     FeaturePtr aFeature = PartSet_Tools::nearestFeature(theEvent->pos(), theView, feature(),
                                                         myFeatures);
     if (aFeature)
-      restartOperation(PartSet_OperationEditFeature::Type(), aFeature);
+      restartOperation(getOperationType(aFeature), aFeature);
   }
 }
 
@@ -284,3 +237,13 @@ void PartSet_OperationSketch::setSketchPlane(const TopoDS_Shape& theShape)
   emit closeLocalContext();
   emit planeSelected(aDir->x(), aDir->y(), aDir->z());
 }
+
+std::string PartSet_OperationSketch::getOperationType(FeaturePtr theFeature)
+{
+  std::string aType = PartSet_OperationEditFeature::Type();
+
+  if (theFeature->getKind() == SKETCH_CONSTRAINT_LENGTH_KIND)
+    aType = PartSet_OperationEditConstraint::Type();
+
+  return aType;
+}
index 161c76a879aa74761810be090c3450aec7693cc3..7c078bf6399a02d2c4705bed866d2e2d89a17740 100644 (file)
@@ -72,15 +72,6 @@ public:
   /// \param theEvent the mouse event
   virtual void mouseMoved(QMouseEvent* theEvent, Handle_V3d_View theView);
 
-  /// Processes the mouse double click 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 mouseDoubleClick(QMouseEvent* theEvent, Handle_V3d_View theView,
-                                const std::list<XGUI_ViewerPrs>& theSelected,
-                                const std::list<XGUI_ViewerPrs>& theHighlighted);
-
   /// Returns the map of the operation previews including the nested feature previews
   /// \return the map of feature to the feature preview
   virtual std::map<FeaturePtr, boost::shared_ptr<GeomAPI_Shape> >
@@ -118,6 +109,10 @@ protected:
   /// \param theShape the shape
   void setSketchPlane(const TopoDS_Shape& theShape);
 
+  /// Returns the operation type, which is feature or constraint edit opeation
+  /// \param theFeature a feature instance
+  std::string getOperationType(FeaturePtr theFeature);
+
 private:
   std::list<XGUI_ViewerPrs> myFeatures; ///< the features to apply the edit operation
 };
index 767d7bf71b353727a94d37dc660b7560e5737330..840a64df6f031a5bc90e4f8ccb2399b11ee8bb4d 100644 (file)
@@ -5,9 +5,11 @@
 #include <PartSet_OperationSketchBase.h>
 
 #include <SketchPlugin_Feature.h>
+#include <SketchPlugin_ConstraintLength.h>
 
 #include <V3d_View.hxx>
 #include <AIS_Shape.hxx>
+#include <AIS_DimensionSelectionMode.hxx>
 
 #include <QKeyEvent>
 
@@ -43,8 +45,6 @@ std::map<FeaturePtr, boost::shared_ptr<GeomAPI_Shape> >
   return std::map<FeaturePtr, boost::shared_ptr<GeomAPI_Shape> >();
 }
 
-#include <AIS_DimensionSelectionMode.hxx>
-#include <SketchPlugin_ConstraintLength.h>
 std::list<int> PartSet_OperationSketchBase::getSelectionModes(FeaturePtr theFeature) const
 {
   std::list<int> aModes;