X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelHighAPI%2FModelHighAPI_Interface.cpp;h=8e35b13be1b88f0fec6a144d58b11d7bcdf38f82;hb=d2034a988bc73596aab1bb256ddb02ce9ad2bd5a;hp=73c14aefc6a7d9c91678a7814b4013605ebc643f;hpb=ab55bcd64e3c21f7c5363168e52cf72c6953a765;p=modules%2Fshaper.git diff --git a/src/ModelHighAPI/ModelHighAPI_Interface.cpp b/src/ModelHighAPI/ModelHighAPI_Interface.cpp index 73c14aefc..8e35b13be 100644 --- a/src/ModelHighAPI/ModelHighAPI_Interface.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Interface.cpp @@ -1,11 +1,23 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -// Name : ModelHighAPI_Interface.cpp -// Purpose: +// Copyright (C) 2014-2017 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 // -// History: -// 17/05/16 - Sergey POKHODENKO - Creation of the file -//-------------------------------------------------------------------------------------- #include "ModelHighAPI_Interface.h" //-------------------------------------------------------------------------------------- #include @@ -15,6 +27,7 @@ #include #include #include +#include #include "ModelHighAPI_Selection.h" //-------------------------------------------------------------------------------------- @@ -79,11 +92,17 @@ void ModelHighAPI_Interface::setName(const std::string& theName) feature()->data()->setName(theName); } -ModelHighAPI_Selection ModelHighAPI_Interface::result() const +std::string ModelHighAPI_Interface::name() const { - const_cast(this)->execute(); + return feature()->data()->name(); +} - return ModelHighAPI_Selection(feature()->firstResult()); +ModelHighAPI_Selection ModelHighAPI_Interface::result() const +{ + std::list aResults = results(); + if (aResults.empty()) + return ModelHighAPI_Selection(std::shared_ptr()); + return aResults.front(); } std::list ModelHighAPI_Interface::results() const @@ -94,7 +113,8 @@ std::list ModelHighAPI_Interface::results() const std::list > aResults = feature()->results(); for (auto it = aResults.begin(), end = aResults.end(); it != end; ++it) { - aSelectionList.push_back(ModelHighAPI_Selection(*it)); + if (!(*it)->isDisabled()) + aSelectionList.push_back(ModelHighAPI_Selection(*it)); } return aSelectionList;