From 47b40af6a06da3d05f09b573805546dedf6606ae Mon Sep 17 00:00:00 2001 From: nge Date: Mon, 19 Oct 2009 15:48:10 +0000 Subject: [PATCH] Correct bug for size map defined on vertex and group of vertices --- src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx index 401cb48..7b32a33 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx @@ -361,7 +361,7 @@ projectionPoint getProjectionPoint(const TopoDS_Face& face, const gp_XYZ& point) Handle(Geom_Surface) surface = BRep_Tool::Surface(face); GeomAPI_ProjectPointOnSurf projector( point, surface ); if ( !projector.IsDone() || projector.NbPoints()==0 ) - throw "Can't project"; + throw "getProjectionPoint: Can't project"; Quantity_Parameter u,v; projector.LowerDistanceParameters(u,v); @@ -387,7 +387,7 @@ double getT(const TopoDS_Edge& edge, const gp_XYZ& point) ///////////////////////////////////////////////////////// TopoDS_Shape BLSURFPlugin_BLSURF::entryToShape(std::string entry) { - MESSAGE("BLSURFPlugin_BLSURF::entryToShape"<FindObjectID( entry.c_str() ); @@ -673,8 +673,9 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp, blsu } else { key = VerticesWithSizeMap.FindIndex(TopoDS::Vertex(it.Value())); -// MESSAGE("Vertex with key " << key << " already in map"); + MESSAGE("Group of vertices with key " << key << " already in map"); } + MESSAGE("Group of vertices with key " << key << " has a size map: " << smIt->second); VertexId2SizeMap[key] = smIt->second; } } @@ -714,8 +715,9 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp, blsu } else { key = VerticesWithSizeMap.FindIndex(TopoDS::Vertex(GeomShape)); -// MESSAGE("Vertex with key " << key << " already in map"); + MESSAGE("Vertex with key " << key << " already in map"); } + MESSAGE("Vertex with key " << key << " has a size map: " << smIt->second); VertexId2SizeMap[key] = smIt->second; } } @@ -1074,11 +1076,12 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) if(*ip <= 0) *ip = pmap.Add(v); - vertexKey = VerticesWithSizeMap.FindIndex(v); + //vertexKey = VerticesWithSizeMap.FindIndex(v); if (HasSizeMapOnVertex){ vertexKey = VerticesWithSizeMap.FindIndex(v); if (VertexId2SizeMap.find(vertexKey)!=VertexId2SizeMap.end()){ - theSizeMapStr = VertexId2SizeMap[faceKey]; + theSizeMapStr = VertexId2SizeMap[vertexKey]; + //MESSAGE("VertexId2SizeMap[faceKey]: " << VertexId2SizeMap[vertexKey]); if (theSizeMapStr.find(bad_end) == (theSizeMapStr.size()-bad_end.size()-1)) continue; // Expr To Python function, verification is performed at validation in GUI @@ -1088,7 +1091,7 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) PyObject * func = NULL; func = PyObject_GetAttrString(main_mod, "f"); VertexId2PythonSmp[*ip]=func; -// VertexId2SizeMap.erase(vertexKey); // do not erase if using a vector + VertexId2SizeMap.erase(vertexKey); // do not erase if using a vector } } } -- 2.39.2