From 530ea288f21fbb2be1f9d9c8e3d5e0dcea876b4e Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 9 Nov 2013 10:56:40 +0100 Subject: [PATCH] + Make sure that number of Points and Normals is the same --- src/Mod/Fem/Gui/ViewProviderFemConstraintFixed.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintFixed.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintFixed.cpp index c20733522..10093317a 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintFixed.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintFixed.cpp @@ -127,12 +127,15 @@ void ViewProviderFemConstraintFixed::updateData(const App::Property* prop) */ if (strcmp(prop->getName(),"Points") == 0) { + const std::vector& points = pcConstraint->Points.getValues(); + const std::vector& normals = pcConstraint->Normals.getValues(); + if (points.size() != normals.size()) + return; + std::vector::const_iterator n = normals.begin(); + // Note: Points and Normals are always updated together pShapeSep->removeAllChildren(); - const std::vector& points = pcConstraint->Points.getValues(); - const std::vector& normals = pcConstraint->Normals.getValues(); - std::vector::const_iterator n = normals.begin(); /* SoMultipleCopy* cp = static_cast(pShapeSep->getChild(0)); cp->matrix.setNum(points.size());