From 2c68580381f59bf8dab28466fc7fee101ba8e5be Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 18 Nov 2013 13:45:53 +0000 Subject: [PATCH] Regression with enforced vertices --- src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx | 51 +++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx index 48c0314..58c36ac 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx @@ -3401,6 +3401,57 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh& theMesh, // TIDSortedElemSet enforcedQuadrangles = GHS3DPlugin_Hypothesis::GetEnforcedQuadrangles(_hyp); GHS3DPlugin_Hypothesis::TID2SizeMap nodeIDToSizeMap = GHS3DPlugin_Hypothesis::GetNodeIDToSizeMap(_hyp); + GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertexList enfVertices = GHS3DPlugin_Hypothesis::GetEnforcedVertices(_hyp); + GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertexList::const_iterator enfVerIt = enfVertices.begin(); + std::vector coords; + + for ( ; enfVerIt != enfVertices.end() ; ++enfVerIt) + { + GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertex* enfVertex = (*enfVerIt); +// if (enfVertex->geomEntry.empty() && enfVertex->coords.size()) { + if (enfVertex->coords.size()) { + coordsSizeMap.insert(make_pair(enfVertex->coords,enfVertex->size)); + enfVerticesWithGroup.insert(make_pair(enfVertex->coords,enfVertex->groupName)); +// MESSAGE("enfVerticesWithGroup.insert(make_pair(("<coords[0]<<","<coords[1]<<","<coords[2]<<"),\""<groupName<<"\"))"); + } + else { +// if (!enfVertex->geomEntry.empty()) { + TopoDS_Shape GeomShape = entryToShape(enfVertex->geomEntry); +// GeomType = GeomShape.ShapeType(); + +// if (!enfVertex->isCompound) { +// // if (GeomType == TopAbs_VERTEX) { +// coords.clear(); +// aPnt = BRep_Tool::Pnt(TopoDS::Vertex(GeomShape)); +// coords.push_back(aPnt.X()); +// coords.push_back(aPnt.Y()); +// coords.push_back(aPnt.Z()); +// if (coordsSizeMap.find(coords) == coordsSizeMap.end()) { +// coordsSizeMap.insert(make_pair(coords,enfVertex->size)); +// enfVerticesWithGroup.insert(make_pair(coords,enfVertex->groupName)); +// } +// } +// +// // Group Management +// else { +// if (GeomType == TopAbs_COMPOUND){ + for (TopoDS_Iterator it (GeomShape); it.More(); it.Next()){ + coords.clear(); + if (it.Value().ShapeType() == TopAbs_VERTEX){ + gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(it.Value())); + coords.push_back(aPnt.X()); + coords.push_back(aPnt.Y()); + coords.push_back(aPnt.Z()); + if (coordsSizeMap.find(coords) == coordsSizeMap.end()) { + coordsSizeMap.insert(make_pair(coords,enfVertex->size)); + enfVerticesWithGroup.insert(make_pair(coords,enfVertex->groupName)); +// MESSAGE("enfVerticesWithGroup.insert(make_pair(("<groupName<<"\"))"); + } + } + } +// } + } + } int nbEnforcedVertices = coordsSizeMap.size(); int nbEnforcedNodes = enforcedNodes.size(); -- 2.39.2