X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelHighAPI%2FModelHighAPI_Reference.cpp;h=5e95540a4786ad803ddc21d5e2be7ac1a0611df4;hb=8d04b5f4360b23cf376beff9c5e7c12d0e6a5f1e;hp=3e13a0b463d95f32fef462b83c9500c287d0d2d8;hpb=0cf033e3d2d9a6419aac40d77cd200187562a159;p=modules%2Fshaper.git diff --git a/src/ModelHighAPI/ModelHighAPI_Reference.cpp b/src/ModelHighAPI/ModelHighAPI_Reference.cpp index 3e13a0b46..5e95540a4 100644 --- a/src/ModelHighAPI/ModelHighAPI_Reference.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Reference.cpp @@ -1,10 +1,22 @@ -// Copyright (C) 2014-20xx 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 +// 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 +// -// File: FeaturesAPI_Reference.cpp -// Created: 04 August 2016 -// Author: Mikhail Ponikarov - -//-------------------------------------------------------------------------------------- #include "ModelHighAPI_Reference.h" #include @@ -25,6 +37,11 @@ ModelHighAPI_Reference::ModelHighAPI_Reference( const std::shared_ptr & theValue) : myObject(std::shared_ptr(theValue->defaultResult())) { + // the result is not constructed yet, forcibly do it + if (!myObject) { + theValue->execute(true); + myObject = std::shared_ptr(theValue->defaultResult()); + } } ModelHighAPI_Reference::~ModelHighAPI_Reference() @@ -44,3 +61,9 @@ void ModelHighAPI_Reference::appendToList( { theAttribute->append(myObject); } + +//-------------------------------------------------------------------------------------- +std::shared_ptr ModelHighAPI_Reference::feature() const +{ + return ModelAPI_Feature::feature(myObject); +}