]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge branch 'Dev_1.5.0' into BR_REENTRANCE_OPERATION
authornds <nds@opencascade.com>
Tue, 3 Nov 2015 05:49:59 +0000 (08:49 +0300)
committernds <nds@opencascade.com>
Tue, 3 Nov 2015 05:49:59 +0000 (08:49 +0300)
Conflicts:
src/XGUI/XGUI_PropertyPanel.cpp

1  2 
src/ModuleBase/ModuleBase_IModule.h
src/ModuleBase/ModuleBase_OperationFeature.cpp
src/ModuleBase/ModuleBase_WidgetSelector.cpp
src/PartSet/CMakeLists.txt
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_Module.h
src/PartSet/PartSet_SketcherMgr.cpp
src/PartSet/PartSet_WidgetPoint2d.cpp
src/PartSet/PartSet_WidgetPoint2d.h
src/XGUI/XGUI_PropertyPanel.cpp
src/XGUI/XGUI_Workshop.cpp

index 7ed9c8f6a2ac8a82490f5d7554465c5c56e0610d,f4d547d43c92c91d7afbc527be8fa16ee6874849..41dbd684462e1261a6eab851b42cb66dc554199f
mode 100644,100755..100755
index d4ed903ec4b882de9328a8118efc852085ad1854,130079870bb186c835a1970033a42e5fa9af9d9d..6e1f9434926303756fe6faeebd26d828c125a415
@@@ -165,8 -166,9 +165,9 @@@ bool ModuleBase_WidgetSelector::setSele
  //********************************************************************
  void ModuleBase_WidgetSelector::deactivate()
  {
+   ModuleBase_ModelWidget::deactivate();
    disconnect(myWorkshop, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
 -  activateSelection(false);
 -  activateFilters(false);
 +  activateSelectionAndFilters(false);
 +  ModuleBase_ModelWidget::deactivate();
  }
  
index 35275b60f003e428ceb999addf6e0f82a07e418c,45ab6dc0196b7a7555138b29e944fbf86ecd439c..86ba3a3a7ea64b9cc52fc51fa1cf4475144ab494
@@@ -23,10 -23,8 +23,9 @@@ SET(PROJECT_HEADER
        PartSet_WidgetShapeSelector.h
        PartSet_WidgetFileSelector.h
        PartSet_Filters.h
-       PartSet_LockApplyMgr.h
        PartSet_FilterInfinite.h
        PartSet_SketcherMgr.h
 +      PartSet_SketcherReetntrantMgr.h
        PartSet_MenuMgr.h
        PartSet_WidgetSketchCreator.h
        PartSet_IconFactory.h
@@@ -49,10 -47,8 +48,9 @@@ SET(PROJECT_SOURCE
        PartSet_WidgetShapeSelector.cpp
        PartSet_WidgetFileSelector.cpp
        PartSet_Filters.cpp
-       PartSet_LockApplyMgr.cpp
        PartSet_FilterInfinite.cpp
        PartSet_SketcherMgr.cpp
 +      PartSet_SketcherReetntrantMgr.cpp
        PartSet_MenuMgr.cpp
        PartSet_WidgetSketchCreator.cpp
        PartSet_IconFactory.cpp
index fbde087ade0045543aaa232504dbbd2b770887d3,4dba405532d0d5c7bf0f1585eb2af4c75bc72517..5861932e70b5487364aed8b9a0a8a50a1a149365
@@@ -249,28 -257,44 +254,28 @@@ void PartSet_Module::operationCommitted
      mySketchMgr->commitNestedSketch(theOperation);
    }
  
 -  ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
 -  if (!aFOperation || aFOperation->isEditOperation())
 -    return;
 -  // the selection is cleared after commit the create operation
 -  // in order to do not use the same selected objects in the restarted operation
 -  // for common behaviour, the selection is cleared even if the operation is not restarted
 -  XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
 -  XGUI_Workshop* aWorkshop = aConnector->workshop();
 -  aWorkshop->selector()->clearSelection();
 -
    /// Restart sketcher operations automatically
 -  FeaturePtr aFeature = aFOperation->feature();
 -  std::shared_ptr<SketchPlugin_Feature> aSPFeature = 
 -            std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
 -  if (aSPFeature && (myRestartingMode == RM_LastFeatureUsed ||
 -                     myRestartingMode == RM_EmptyFeatureUsed)) {
 -    myLastOperationId = aFOperation->id();
 -    myLastFeature = myRestartingMode == RM_LastFeatureUsed ? aFOperation->feature() : FeaturePtr();
 -    if (!sketchMgr()->sketchSolverError())
 -      launchOperation(myLastOperationId);
 +  if (!mySketchReentrantMgr->operationCommitted(theOperation)) {
 +    // the selection is cleared after commit the create operation
 +    // in order to do not use the same selected objects in the restarted operation
 +    // for common behaviour, the selection is cleared even if the operation is not restarted
 +    XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
 +    XGUI_Workshop* aWorkshop = aConnector->workshop();
 +    aWorkshop->selector()->clearSelection();
    }
 -  breakOperationSequence();
 -}
 -
 -void PartSet_Module::breakOperationSequence()
 -{
 -  myLastOperationId = "";
 -  myLastFeature = FeaturePtr();
 -  myRestartingMode = RM_None;
  }
  
- void PartSet_Module::onOperationAborted(ModuleBase_Operation* theOperation)
+ void PartSet_Module::operationAborted(ModuleBase_Operation* theOperation)
  {
 -  breakOperationSequence();
 +  /// Restart sketcher operations automatically
 +  mySketchReentrantMgr->operationAborted(theOperation);
  }
  
- void PartSet_Module::onOperationStarted(ModuleBase_Operation* theOperation)
+ void PartSet_Module::operationStarted(ModuleBase_Operation* theOperation)
  {
 +  /// Restart sketcher operations automatically
 +  mySketchReentrantMgr->operationStarted(theOperation);
 +
    if (PartSet_SketcherMgr::isSketchOperation(theOperation)) {
      mySketchMgr->startSketch(theOperation);
    }
index bc97ed5ccfa6ab49a2d68342f63b74924168bf35,f879712a55d653a2141a60db0a8e6f4e53baf24f..a120f3be64bea3e9cd2ba99ef4729f827b2375d7
mode 100644,100755..100755
@@@ -211,7 -203,15 +211,11 @@@ public
    /// Returns list of granted operation indices
    virtual void grantedOperationIds(ModuleBase_Operation* theOperation, QStringList& theIds) const;
  
+   /// Validates the current operation and send the state change to sketch manager
+   /// \thePrevState the previous widget value state
+   virtual void widgetStateChanged(int thePreviousState);
  public slots:
 -  /// SLOT, that is called by no more widget signal emitted by property panel
 -  /// Set a specific flag to restart the sketcher operation
 -  void onNoMoreWidgets();
 -
    /// Redefines the parent method in order to customize the next case:
    /// If the sketch nested operation is active and the presentation is not visualized in the viewer,
    /// the operation should be always aborted.
@@@ -257,10 -261,22 +261,17 @@@ protected
    /// Register properties of this module
    virtual void registerProperties();
  
+   /// Connects or disconnects to the value changed signal of the property panel widgets
+   /// \param theWidget a property contol widget
+   /// \param isToConnect a boolean value whether connect or disconnect
+   virtual void connectToPropertyPanel(ModuleBase_ModelWidget* theWidget, const bool isToConnect);
   private slots:
 -   /// Processing of vertex selected
 -   void onVertexSelected();
 -
     void onTreeViewDoubleClick(const QModelIndex&);
  
+    void onActiveDocPopup(const QPoint&);
   private:
 -  /// Breaks sequense of automatically resterted operations
 -  void breakOperationSequence();
  
    //! Delete features
    virtual bool deleteObjects();
index 028ebd6509de5cbb38be1248c236855b338f9241,97a5ce43c6021061ca2056f1d946d84429254494..4f89da66cb53fda5314ab793e16152e74b9471ca
mode 100644,100755..100755
index cbd3c97340ae571113effbd1827455b1cc9d8c36,66a67efc418a917d2d4085aa1e9ad7452db47f02..020a9be68fcd5e1c1c2ef3c0bc3d5ffc4e068c11
@@@ -281,22 -248,11 +267,21 @@@ void PartSet_WidgetPoint2D::activateCus
    aModes << TopAbs_VERTEX;
    aModes << TopAbs_EDGE;
    myWorkshop->activateSubShapesSelection(aModes);
-   myLockApplyMgr->activate();
  }
  
 +bool PartSet_WidgetPoint2D::canBeActivatedByMove()
 +{
 +  bool aCanBeActivated = false;
 +  if (feature()->getKind() == SketchPlugin_Line::ID() &&
 +      attributeID() == SketchPlugin_Line::START_ID())
 +    aCanBeActivated = true;
 +
 +  return aCanBeActivated;
 +}
 +
  void PartSet_WidgetPoint2D::deactivate()
  {
+   ModuleBase_ModelWidget::deactivate();
    ModuleBase_IViewer* aViewer = myWorkshop->viewer();
    disconnect(aViewer, SIGNAL(mouseMove(ModuleBase_IViewWindow*, QMouseEvent*)),
               this, SLOT(onMouseMove(ModuleBase_IViewWindow*, QMouseEvent*)));
index 4481eb60db68fcff1e596c65503e710e9b63dbdb,d5f87eca0b97c05b41ddf95c0d0c3b201c314316..aac5640c0e8cd07bb50a93b025afc53b3b2347bc
mode 100644,100755..100755
index 73cdab5a25fd5729e1c275941e12b3ac2311a9af,f447f24a20aa9cbdf610048ed72e2b2541ce1d45..197f794424f226b9917b150e837027d3799d704d
mode 100644,100755..100755
@@@ -195,11 -248,9 +248,11 @@@ bool XGUI_PropertyPanel::setActiveWidge
  {
    // Avoid activation of already actve widget. It could happen on focusIn event many times
    if (theWidget == myActiveWidget) {
-     return;
+     return false;
    }
 +  std::string aPreviosAttributeID;
    if(myActiveWidget) {
 +    aPreviosAttributeID = myActiveWidget->attributeID();
      myActiveWidget->deactivate();
      myActiveWidget->setHighlighted(false);
    }
index 71af25fb300786460cd8a1c4ff9530fc02558a95,52212d11bff20202126610c9e6f0ffc706be39e7..d534f9d5dba53aa09ac4b8516f3b400315846a3f
mode 100644,100755..100755