X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FPlaneGCSSolver%2FPlaneGCSSolver_AttributeBuilder.cpp;h=d129baeffacc0040eb13ddd86f3fbf4b3797f6a0;hb=06e7f5859095193fc7f498bd89a7d28009794f53;hp=a446abc6693cae4d85b920ffa00d8632c13014ef;hpb=e05cf89c2b21303c51d9102315a82ac095eed3df;p=modules%2Fshaper.git diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_AttributeBuilder.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_AttributeBuilder.cpp index a446abc66..d129baeff 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_AttributeBuilder.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_AttributeBuilder.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2019 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 @@ -216,9 +216,9 @@ bool PlaneGCSSolver_AttributeBuilder::updateAttribute( std::shared_ptr anAttribute = std::dynamic_pointer_cast(theAttribute); + std::vector aPointsArray = aWrapper->array(); + std::vector::iterator aPos = aPointsArray.begin(); if (aWrapper->size() != anAttribute->size()) { - std::vector aPointsArray = aWrapper->array(); - std::vector::iterator aPos = aPointsArray.begin(); while (anAttribute->size() > (int)aPointsArray.size()) { // add points to the middle of array GeomPnt2dPtr aValue; @@ -242,6 +242,15 @@ bool PlaneGCSSolver_AttributeBuilder::updateAttribute( aWrapper->setArray(aPointsArray); } + else { + // update coordinates of points + for (int anIndex = 0; aPos != aPointsArray.end(); ++aPos, ++anIndex) { + const GCSPointPtr& aGCSPoint = (*aPos)->point(); + GeomPnt2dPtr aCoord = anAttribute->pnt(anIndex); + *aGCSPoint->x = aCoord->x(); + *aGCSPoint->y = aCoord->y(); + } + } } else if (theEntity->type() == ENTITY_SCALAR_ARRAY) { std::shared_ptr aWrapper =