X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_WidgetBSplinePoints.cpp;h=fe01d920f3e367f8e573ca158a407837f4a8c412;hb=77ce6d35ac8d2f0fdaecb4f23e0870bf74e36103;hp=5ccc381e167f70de6e12d902a48a210d82d42bce;hpb=91e256f2c81a2bb26bef21ad008d7d02f31d0e38;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_WidgetBSplinePoints.cpp b/src/PartSet/PartSet_WidgetBSplinePoints.cpp index 5ccc381e1..fe01d920f 100644 --- a/src/PartSet/PartSet_WidgetBSplinePoints.cpp +++ b/src/PartSet/PartSet_WidgetBSplinePoints.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2020 CEA/DEN, EDF R&D +// Copyright (C) 2019-2024 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -87,7 +87,10 @@ PartSet_WidgetBSplinePoints::PartSet_WidgetBSplinePoints(QWidget* theParent, myBox->setFlat(false); aMainLayout->addWidget(myBox); - bool aAcceptVariables = theData->getBooleanAttribute(DOUBLE_WDG_ACCEPT_EXPRESSIONS, true); +#ifdef _DEBUG + bool aAcceptVariables = +#endif + theData->getBooleanAttribute(DOUBLE_WDG_ACCEPT_EXPRESSIONS, true); // B-spline weights attribute myWeightsAttr = theData->getProperty("weights"); @@ -128,7 +131,7 @@ void PartSet_WidgetBSplinePoints::createNextPoint() QGridLayout* aGroupLay = dynamic_cast(myGroupBox->layout()); int row = (int)myXSpin.size(); - QString aPoleStr = tr("Pole %1"); + QString aPoleStr = translate("Pole %1"); aPoleStr = aPoleStr.arg(myXSpin.size() + 1); QGroupBox* aPoleGroupBox = new QGroupBox(aPoleStr, myGroupBox); @@ -167,8 +170,6 @@ void PartSet_WidgetBSplinePoints::removeLastPoint() bool PartSet_WidgetBSplinePoints::isValidSelectionCustom(const ModuleBase_ViewerPrsPtr& theValue) { - bool aValid = true; - PartSet_Module* aModule = dynamic_cast(myWorkshop->module()); if (aModule->sketchReentranceMgr()->isInternalEditActive()) return true; // when internal edit is started a new feature is created. I has not results, AIS @@ -359,7 +360,7 @@ bool PartSet_WidgetBSplinePoints::restoreValueCustom() AttributeDoubleArrayPtr aWeightsArray = aData->realArray(myWeightsAttr); if (aPointArray->isInitialized()) { - while (myXSpin.size() < aPointArray->size()) + while ((int)myXSpin.size() < aPointArray->size()) createNextPoint(); std::vector::iterator aXIt = myXSpin.begin(); @@ -533,11 +534,7 @@ void PartSet_WidgetBSplinePoints::mouseReleased(ModuleBase_IViewWindow* theWindo } GeomPnt2dPtr aSelectedPoint = PartSet_Tools::getPnt2d(aView, aSelectedShape, mySketch); - if (aSelectedPoint) { - // nullify selected object to add reference to attribute instead of its owner - aSelectedObject = ObjectPtr(); - } - else { + if (!aSelectedPoint) { aSelectedPoint = PartSet_Tools::getPnt2d(theEvent, theWindow, mySketch); setValueState(Stored); // in case of edge selection, Apply state should also be updated }