From: sbh Date: Thu, 26 Feb 2015 18:46:18 +0000 (+0300) Subject: Merge branch 'Dev_1.1.0' of newgeom:newgeom.git into Dev_1.1.0 X-Git-Tag: V_1.1.0~158^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3c0b551f57002a6e5195ef959f8056aa9df72baf;p=modules%2Fshaper.git Merge branch 'Dev_1.1.0' of newgeom:newgeom.git into Dev_1.1.0 Conflicts: src/ModuleBase/ModuleBase_WidgetBoolValue.cpp --- 3c0b551f57002a6e5195ef959f8056aa9df72baf diff --cc src/ModuleBase/ModuleBase_WidgetBoolValue.cpp index 122f4b41c,af2e7ee0e..f1d5f2ba0 --- a/src/ModuleBase/ModuleBase_WidgetBoolValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetBoolValue.cpp @@@ -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 aBool = aData->boolean(attributeID()); diff --cc src/ModuleBase/ModuleBase_WidgetDoubleValue.h index a5a666f05,fd447a780..a83292914 --- a/src/ModuleBase/ModuleBase_WidgetDoubleValue.h +++ b/src/ModuleBase/ModuleBase_WidgetDoubleValue.h @@@ -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; diff --cc src/ModuleBase/ModuleBase_WidgetShapeSelector.h index 26f3ef253,2e6b2cc9a..98a1e4c34 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.h +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.h @@@ -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; diff --cc src/PartSet/PartSet_Module.cpp index b873d3846,a73034a95..129273fad --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@@ -430,53 -432,52 +432,40 @@@ QWidget* PartSet_Module::createWidgetBy { XGUI_ModuleConnector* aConnector = dynamic_cast(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&)), + PartSet_WidgetSketchLabel* aLabelWgt = new PartSet_WidgetSketchLabel(theParent, theWidgetApi, theParentId); + aLabelWgt->setWorkshop(aWorkshop); + connect(aLabelWgt, SIGNAL(planeSelected(const std::shared_ptr&)), mySketchMgr, SLOT(onPlaneSelected(const std::shared_ptr&))); - 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 aSPFeature = - std::dynamic_pointer_cast(aFeature); - isCurrentSketchOp = aSPFeature.get() != NULL; - } - return isCurrentSketchOp; - } - void PartSet_Module::createActions() { QAction* aAction = new QAction(QIcon(":pictures/delete.png"), tr("Delete"), this);