X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_ResultField.cpp;h=398a28e6178c37c91320f11e7048e225cefa8ea0;hb=d63aa3e66ea4f15430a40d80d9ecd0c87b557e7e;hp=7eda1aa47121cf9f295fa84cbc43a6a1ce08e080;hpb=7074394f8f08413d885f63be01df6bd5007b868c;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_ResultField.cpp b/src/ModelAPI/ModelAPI_ResultField.cpp index 7eda1aa47..398a28e61 100644 --- a/src/ModelAPI/ModelAPI_ResultField.cpp +++ b/src/ModelAPI/ModelAPI_ResultField.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2019 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,13 +12,14 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "ModelAPI_ResultField.h" +#include "ModelAPI_Events.h" +#include ModelAPI_ResultField::~ModelAPI_ResultField() { @@ -29,3 +30,35 @@ std::string ModelAPI_ResultField::groupName() { return group(); } + +// LCOV_EXCL_START +void ModelAPI_ResultField::ModelAPI_FieldStep::setDisplayed(const bool theDisplay) +{ + if (myIsDisplayed != theDisplay) { + myIsDisplayed = theDisplay; + static Events_Loop* aLoop = Events_Loop::loop(); + static Events_ID EVENT_DISP = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY); + static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get(); + ModelAPI_ResultField* aField = field(); + if (aField) { + aECreator->sendUpdated(aField->step(id()), EVENT_DISP); // updated pointer to this + if (myIsDisplayed) { + for (int i = 0; i < aField->stepsSize(); i++) + if (i != id()) + aField->step(i)->setDisplayed(false); + aField->setDisplayed(false); + } + } + } +} + + +void ModelAPI_ResultField::setDisplayed(const bool theDisplay) +{ + ModelAPI_Result::setDisplayed(theDisplay); + if (isDisplayed()) { + for (int i = 0; i < stepsSize(); i++) + step(i)->setDisplayed(false); + } +} +// LCOV_EXCL_STOP