X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_ResultField.cpp;h=52fbc664d9e628ec9c0ab7ef7948d3a585a9bbcb;hb=380f01e1fce1a012267d604a1190d04bf4659447;hp=20fd5c4542e0d782f2f1d3f55680cc4022313f84;hpb=266f5a5c2132719049c303265adee362d0e702b4;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_ResultField.cpp b/src/ModelAPI/ModelAPI_ResultField.cpp index 20fd5c454..52fbc664d 100644 --- a/src/ModelAPI/ModelAPI_ResultField.cpp +++ b/src/ModelAPI/ModelAPI_ResultField.cpp @@ -1,10 +1,25 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: ModelAPI_ResultField.cpp -// Created: 16 Nov 2016 -// Author: Mikhail PONIKAROV +// Copyright (C) 2014-2020 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 +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// 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 +// +// 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() { @@ -15,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