X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_AttributeValidator.cpp;h=f6a9307e5bd566c9b1204711635a762decc7fd37;hb=b73fb7468bea81901dbeed8e229d742f788ec282;hp=09207089b798b30f3d4a0806771f71bc3161bb86;hpb=defb242def567f132ff30734ca156d92eadffe66;p=modules%2Fshaper.git diff --git a/src/Model/Model_AttributeValidator.cpp b/src/Model/Model_AttributeValidator.cpp index 09207089b..f6a9307e5 100644 --- a/src/Model/Model_AttributeValidator.cpp +++ b/src/Model/Model_AttributeValidator.cpp @@ -1,8 +1,22 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: Model_AttributeValidator.cpp -// Created: 29 July 2015 -// Author: Sergey POKHODENKO +// 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 +// #include "Model_AttributeValidator.h" @@ -14,8 +28,8 @@ #include #include -bool Model_AttributeValidator::isValid(const AttributePtr& theAttribute, - const std::list& theArguments, +bool Model_AttributeValidator::isValid(const AttributePtr& theAttribute, + const std::list& theArguments, Events_InfoMessage& theError) const { if (theAttribute->attributeType() == ModelAPI_AttributeInteger::typeId()) { @@ -28,7 +42,7 @@ bool Model_AttributeValidator::isValid(const AttributePtr& theAttribute, } } else if (theAttribute->attributeType() == ModelAPI_AttributeDouble::typeId()) { - AttributeDoublePtr anAttribue = + AttributeDoublePtr anAttribue = std::dynamic_pointer_cast(theAttribute); if (!anAttribue->expressionError().empty()) { theError = "Expression error: %1"; @@ -37,14 +51,15 @@ bool Model_AttributeValidator::isValid(const AttributePtr& theAttribute, } } else if (theAttribute->attributeType() == GeomDataAPI_Point::typeId()) { - AttributePointPtr anAttribue = + AttributePointPtr anAttribue = std::dynamic_pointer_cast(theAttribute); const char* aComponent[] = {"X", "Y", "Z"}; std::string anErrorMessage; for (int i = 0; i < 3; ++i) { if (!anAttribue->expressionError(i).empty()) - anErrorMessage.append("\n").append(aComponent[i]).append(": ").append(anAttribue->expressionError(i)); + anErrorMessage.append("\n").append(aComponent[i]) + .append(": ").append(anAttribue->expressionError(i)); } if (!anErrorMessage.empty()) { theError = "Expression error: %1"; @@ -53,14 +68,15 @@ bool Model_AttributeValidator::isValid(const AttributePtr& theAttribute, } } else if (theAttribute->attributeType() == GeomDataAPI_Point2D::typeId()) { - AttributePoint2DPtr anAttribue = + AttributePoint2DPtr anAttribue = std::dynamic_pointer_cast(theAttribute); const char* aComponent[] = {"X", "Y"}; std::string anErrorMessage; for (int i = 0; i < 2; ++i) { if (!anAttribue->expressionError(i).empty()) - anErrorMessage.append("\n").append(aComponent[i]).append(": ").append(anAttribue->expressionError(i)); + anErrorMessage.append("\n").append(aComponent[i]) + .append(": ").append(anAttribue->expressionError(i)); } if (!anErrorMessage.empty()) { theError = "Expression error: %1";