]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom.git into Dev_1.1.0
authorsbh <sergey.belash@opencascade.com>
Thu, 26 Feb 2015 18:46:18 +0000 (21:46 +0300)
committersbh <sergey.belash@opencascade.com>
Thu, 26 Feb 2015 18:46:18 +0000 (21:46 +0300)
Conflicts:
src/ModuleBase/ModuleBase_WidgetBoolValue.cpp

21 files changed:
1  2 
src/ModuleBase/ModuleBase_ModelWidget.cpp
src/ModuleBase/ModuleBase_ModelWidget.h
src/ModuleBase/ModuleBase_WidgetBoolValue.cpp
src/ModuleBase/ModuleBase_WidgetBoolValue.h
src/ModuleBase/ModuleBase_WidgetChoice.cpp
src/ModuleBase/ModuleBase_WidgetChoice.h
src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp
src/ModuleBase/ModuleBase_WidgetDoubleValue.h
src/ModuleBase/ModuleBase_WidgetFileSelector.cpp
src/ModuleBase/ModuleBase_WidgetFileSelector.h
src/ModuleBase/ModuleBase_WidgetLabel.h
src/ModuleBase/ModuleBase_WidgetLineEdit.cpp
src/ModuleBase/ModuleBase_WidgetLineEdit.h
src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp
src/ModuleBase/ModuleBase_WidgetMultiSelector.h
src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp
src/ModuleBase/ModuleBase_WidgetShapeSelector.h
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_WidgetPoint2d.cpp
src/PartSet/PartSet_WidgetPoint2d.h
src/PartSet/PartSet_WidgetSketchLabel.h

index 122f4b41ce058fcf61806b614c9d7a82d1728d0a,af2e7ee0ef3b79879863c3f61a17f8470133a47d..f1d5f2ba08a1443c15d63d9da31ea051d9bfaae9
@@@ -39,7 -39,12 +39,7 @@@ ModuleBase_WidgetBoolValue::~ModuleBase
  {
  }
  
- bool ModuleBase_WidgetBoolValue::storeValue() const
 -QWidget* ModuleBase_WidgetBoolValue::getControl() const
 -{
 -  return myCheckBox;
 -}
 -
+ bool ModuleBase_WidgetBoolValue::storeValueCustom() const
  {
    DataPtr aData = myFeature->data();
    std::shared_ptr<ModelAPI_AttributeBoolean> aBool = aData->boolean(attributeID());
index a5a666f05a7eb579eeb1ed7b6448a32489746f0a,fd447a78050f26c525c4e3029855b383df288e7c..a83292914eda6145fcb24f9927d021705793a708
@@@ -56,9 -63,12 +56,9 @@@ Q_OBJEC
  protected:
    /// Saves the internal parameters to the given feature
    /// \return True in success
-   virtual bool storeValue() const;
+   virtual bool storeValueCustom() const;
  
  protected:
 -   /// Container for thw widget controls
 -  QWidget* myContainer;
 -
    /// Label of the widget
    QLabel* myLabel;
  
index 26f3ef2530c641c4e26aa574e83b3446d0e3af3a,2e6b2cc9a8cabe809b2f6063e7c678f76dc7d2f3..98a1e4c34c02c35e8e5aee81ef10e0feb989a7d7
@@@ -142,8 -150,18 +143,14 @@@ Q_OBJEC
    /// Clear attribute
    void clearAttribute();
  
+   /// Fills the given list with all widget filters. It can be used by activation widget for the viewer
+   /// or by checking the selection parameter in addition to check validity of the selection argument
+   /// It creates an object type filter if it has not been created yet and save it in the class field
+   /// \param theFilters a list of filter
+   void selectionFilters(SelectMgr_ListOfFilter& theFilters);
    //----------- Class members -------------
   protected:
 -
 -   /// Container of the widget's control
 -  QWidget* myContainer;
 -
    /// Label of the widget
    QLabel* myLabel;
  
index b873d384662f0073e65b887c6bcc2a3c5a1bdac8,a73034a9562d3e25f8e77eb3bba70ca100e8a7cf..129273faddaffda402b9af50f2806fb81d9ef71e
@@@ -430,53 -432,52 +432,40 @@@ QWidget* PartSet_Module::createWidgetBy
  {
    XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
    XGUI_Workshop* aWorkshop = aConnector->workshop();
 +  ModuleBase_ModelWidget* aWgt = NULL;
    if (theType == "sketch-start-label") {
 -    PartSet_WidgetSketchLabel* aWgt = new PartSet_WidgetSketchLabel(theParent, theWidgetApi, theParentId);
 -    aWgt->setWorkshop(aWorkshop);
 -    connect(aWgt, SIGNAL(planeSelected(const std::shared_ptr<GeomAPI_Pln>&)), 
 +    PartSet_WidgetSketchLabel* aLabelWgt = new PartSet_WidgetSketchLabel(theParent, theWidgetApi, theParentId);
 +    aLabelWgt->setWorkshop(aWorkshop);
 +    connect(aLabelWgt, SIGNAL(planeSelected(const std::shared_ptr<GeomAPI_Pln>&)),
        mySketchMgr, SLOT(onPlaneSelected(const std::shared_ptr<GeomAPI_Pln>&)));
 -    theModelWidgets.append(aWgt);
 -    return aWgt->getControl();
 -
 +    aWgt = aLabelWgt;
    } else if (theType == "sketch-2dpoint_selector") {
 -    PartSet_WidgetPoint2D* aWgt = new PartSet_WidgetPoint2D(theParent, theWidgetApi, theParentId);
 -    aWgt->setWorkshop(aWorkshop);
 -    aWgt->setSketch(mySketchMgr->activeSketch());
 -
 -    connect(aWgt, SIGNAL(vertexSelected()), this, SLOT(onVertexSelected()));
 -
 -    theModelWidgets.append(aWgt);
 -    return aWgt->getControl();
 -
 +    PartSet_WidgetPoint2D* aPointWgt = new PartSet_WidgetPoint2D(theParent, theWidgetApi, theParentId);
 +    aPointWgt->setWorkshop(aWorkshop);
 +    aPointWgt->setSketch(mySketchMgr->activeSketch());
 +    connect(aPointWgt, SIGNAL(vertexSelected()), this, SLOT(onVertexSelected()));
 +    aWgt = aPointWgt;
    } if (theType == "point2ddistance") {
 -    PartSet_WidgetPoint2dDistance* aWgt = new PartSet_WidgetPoint2dDistance(theParent, theWidgetApi, theParentId);
 -    aWgt->setWorkshop(aWorkshop);
 -    aWgt->setSketch(mySketchMgr->activeSketch());
 -
 -    theModelWidgets.append(aWgt);
 -    return aWgt->getControl();
 -
 +    PartSet_WidgetPoint2dDistance* aDistanceWgt = new PartSet_WidgetPoint2dDistance(theParent, theWidgetApi, theParentId);
 +    aDistanceWgt->setWorkshop(aWorkshop);
 +    aDistanceWgt->setSketch(mySketchMgr->activeSketch());
 +    aWgt = aDistanceWgt;
    } if (theType == "sketch_shape_selector") {
 -    PartSet_WidgetShapeSelector* aWgt = 
 +    PartSet_WidgetShapeSelector* aShapeSelectorWgt =
        new PartSet_WidgetShapeSelector(theParent, workshop(), theWidgetApi, theParentId);
 -    aWgt->setSketcher(mySketchMgr->activeSketch());
 -
 -    theModelWidgets.append(aWgt);
 -    return aWgt->getControl();
 -
 +    aShapeSelectorWgt->setSketcher(mySketchMgr->activeSketch());
 +    aWgt = aShapeSelectorWgt;
    } if (theType == "sketch_constraint_shape_selector") {
 -    PartSet_WidgetConstraintShapeSelector* aWgt = 
 +    PartSet_WidgetConstraintShapeSelector* aConstraintShapeSelectorWgt =
        new PartSet_WidgetConstraintShapeSelector(theParent, workshop(), theWidgetApi, theParentId);
 -    aWgt->setSketcher(mySketchMgr->activeSketch());
 -
 +    aConstraintShapeSelectorWgt->setSketcher(mySketchMgr->activeSketch());
 +    aWgt = aConstraintShapeSelectorWgt;
 +  }
 +  if(aWgt)
      theModelWidgets.append(aWgt);
 -    return aWgt->getControl();
 -
 -  } else
 -    return 0;
 +  return aWgt;
  }
  
- bool PartSet_Module::isSketchFeatureOperationActive() const
- {
-   bool isCurrentSketchOp = false;
-   ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
-   if (aOperation) {
-     FeaturePtr aFeature = aOperation->feature();
-     std::shared_ptr<SketchPlugin_Feature> aSPFeature = 
-               std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
-     isCurrentSketchOp = aSPFeature.get() != NULL;
-   }
-   return isCurrentSketchOp;
- }
  void PartSet_Module::createActions()
  {
    QAction* aAction = new QAction(QIcon(":pictures/delete.png"), tr("Delete"), this);
Simple merge
Simple merge