X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_Result.cpp;h=c0b1716313a016d61fdf41bb97cf369bdcbc5ec9;hb=06e7f5859095193fc7f498bd89a7d28009794f53;hp=588d138bf17cb447927b3273fed0f6fdfbeb1988;hpb=2714903267d23cd0c81166c506fb3edd1e069d40;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_Result.cpp b/src/ModelAPI/ModelAPI_Result.cpp index 588d138bf..c0b171631 100644 --- a/src/ModelAPI/ModelAPI_Result.cpp +++ b/src/ModelAPI/ModelAPI_Result.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2023 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,9 @@ // // 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_Result.h" @@ -24,6 +23,7 @@ #include #include #include +#include #include @@ -35,9 +35,15 @@ void ModelAPI_Result::initAttributes() { // append the color attribute. It is empty, the attribute will be filled by a request DataPtr aData = data(); - aData->addAttribute(COLOR_ID(), ModelAPI_AttributeIntArray::typeId()); - aData->addAttribute(DEFLECTION_ID(), ModelAPI_AttributeDouble::typeId()); - aData->addAttribute(TRANSPARENCY_ID(), ModelAPI_AttributeDouble::typeId()); + aData->addAttribute(COLOR_ID(), ModelAPI_AttributeIntArray::typeId())->setIsArgument(false); + aData->addAttribute(DEFLECTION_ID(), ModelAPI_AttributeDouble::typeId())->setIsArgument(false); + aData->addAttribute(TRANSPARENCY_ID(), ModelAPI_AttributeDouble::typeId())->setIsArgument(false); + aData->addAttribute(ISO_LINES_ID(), ModelAPI_AttributeIntArray::typeId())->setIsArgument(false); + aData->addAttribute(SHOW_ISO_LINES_ID(), ModelAPI_AttributeBoolean::typeId())->setIsArgument(false); + aData->addAttribute(SHOW_EDGES_DIRECTION_ID(), ModelAPI_AttributeBoolean::typeId())->setIsArgument(false); + // Add the "Bring To Front" attribute to the Result base class, as we may support it in the future + // for all type of results. Actually, only ResultGroups are supported. + aData->addAttribute(BRING_TO_FRONT_ID(), ModelAPI_AttributeBoolean::typeId())->setIsArgument(false); } bool ModelAPI_Result::setDisabled(std::shared_ptr theThis, const bool theFlag) @@ -66,7 +72,7 @@ bool ModelAPI_Result::setDisabled(std::shared_ptr theThis, cons bool ModelAPI_Result::isDisabled() { - if (myIsDisabled != data()->isDeleted()) + if (data()->isValid() && myIsDisabled != data()->isDeleted()) setDisabled(std::dynamic_pointer_cast( data()->owner()), data()->isDeleted()); // restore from the data model the correct value return myIsDisabled; @@ -77,7 +83,7 @@ bool ModelAPI_Result::isConcealed() return myIsConcealed; } -void ModelAPI_Result::setIsConcealed(const bool theValue) +void ModelAPI_Result::setIsConcealed(const bool theValue, const bool /*theForced*/) { if (myIsConcealed != theValue) { myIsConcealed = theValue;