X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomValidators%2FGeomValidators_Tools.cpp;h=80864331d10394b33bd82448b933e433da5ac5a2;hb=97c06c5cd9fc736f9b5a1dacde369a9d7b5be703;hp=f98088ed3b17f4059b46cbfc430d9838032497ae;hpb=9bea53a5d0fc5c6aec52f4732ec45a9dcbe7354d;p=modules%2Fshaper.git diff --git a/src/GeomValidators/GeomValidators_Tools.cpp b/src/GeomValidators/GeomValidators_Tools.cpp index f98088ed3..80864331d 100644 --- a/src/GeomValidators/GeomValidators_Tools.cpp +++ b/src/GeomValidators/GeomValidators_Tools.cpp @@ -1,8 +1,21 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: GeomValidators_Tools.cpp -// Created: 06 Aug 2014 -// Author: Vitaly Smetannikov +// 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 +// #include "GeomValidators_Tools.h" @@ -10,27 +23,33 @@ #include "ModelAPI_AttributeSelection.h" #include "ModelAPI_AttributeReference.h" +#include + namespace GeomValidators_Tools { ObjectPtr getObject(const AttributePtr& theAttribute) { ObjectPtr anObject; std::string anAttrType = theAttribute->attributeType(); - if (anAttrType == ModelAPI_AttributeRefAttr::type()) { - AttributeRefAttrPtr anAttr = std::dynamic_pointer_cast(theAttribute); + if (anAttrType == ModelAPI_AttributeRefAttr::typeId()) { + AttributeRefAttrPtr anAttr = + std::dynamic_pointer_cast(theAttribute); if (anAttr != NULL && anAttr->isObject()) anObject = anAttr->object(); } - if (anAttrType == ModelAPI_AttributeSelection::type()) { - AttributeSelectionPtr anAttr = std::dynamic_pointer_cast(theAttribute); - if (anAttr != NULL && anAttr->isInitialized()) + if (anAttrType == ModelAPI_AttributeSelection::typeId()) { + AttributeSelectionPtr anAttr = + std::dynamic_pointer_cast(theAttribute); + if (anAttr != NULL) anObject = anAttr->context(); } - if (anAttrType == ModelAPI_AttributeReference::type()) { - AttributeReferencePtr anAttr = std::dynamic_pointer_cast(theAttribute); - if (anAttr.get() != NULL && anAttr->isInitialized()) + if (anAttrType == ModelAPI_AttributeReference::typeId()) { + AttributeReferencePtr anAttr = + std::dynamic_pointer_cast(theAttribute); + if (anAttr.get() != NULL) anObject = anAttr->value(); } return anObject; } + }