From 1e59cc24260c9edad00aad82bd909f2d358fe0c1 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 18 Jan 2005 07:08:14 +0000 Subject: [PATCH] Solve problems: 1. Trying to apply the same 2d pattern subsequently to two adjacent mesh faces leads to segmentation violation 2. Attempt to apply a 3D pattern to two adjacent volumes hangs up SALOME. 3. Passing 0 or 1 as node index argument to SMESH_Pattern::ApplyToMeshFaces() gives identical results. --- src/SMESH/SMESH_Pattern.cxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/SMESH/SMESH_Pattern.cxx b/src/SMESH/SMESH_Pattern.cxx index 5d9b8cb13..86f1d52ab 100644 --- a/src/SMESH/SMESH_Pattern.cxx +++ b/src/SMESH/SMESH_Pattern.cxx @@ -2495,7 +2495,7 @@ bool SMESH_Pattern::Apply (const SMDS_MeshFace* theFace, nodes.reverse(); } else if ( n != nodes.begin() ) - nodes.splice( nodes.end(), nodes, nodes.begin(), --n ); + nodes.splice( nodes.end(), nodes, nodes.begin(), n ); } list< gp_XYZ > xyzList; myOrderedNodes.resize( theFace->NbNodes() ); @@ -2708,9 +2708,13 @@ bool SMESH_Pattern::Apply (std::set theFaces, return setErrorCode( ERR_APPL_BAD_NB_VERTICES ); } + myXYZ.clear(); + myElemXYZIDs.clear(); + myXYZIdToNodeMap.clear(); + myElements.clear(); + myXYZ.resize( myPoints.size() * theFaces.size(), undefinedXYZ() ); myElements.reserve( theFaces.size() ); - myElemXYZIDs.clear(); // to find point index map< TPoint*, int > pointIndex; @@ -2807,9 +2811,13 @@ bool SMESH_Pattern::Apply (std::set theVolumes, return setErrorCode( ERR_APPL_BAD_NB_VERTICES ); } + myXYZ.clear(); + myElemXYZIDs.clear(); + myXYZIdToNodeMap.clear(); + myElements.clear(); + myXYZ.resize( myPoints.size() * theVolumes.size(), undefinedXYZ() ); myElements.reserve( theVolumes.size() ); - myElemXYZIDs.clear(); // to find point index map< TPoint*, int > pointIndex; -- 2.39.2