From: lucasjerome Date: Thu, 11 Mar 2021 13:05:59 +0000 (+0100) Subject: Fix to increase performance X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FCEA_2020%2FLot1_Import_STEP;p=modules%2Fshaper.git Fix to increase performance --- diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_STEPImportXCAF.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_STEPImportXCAF.cpp index b77defd14..1eef6fd73 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_STEPImportXCAF.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_STEPImportXCAF.cpp @@ -94,7 +94,7 @@ std::shared_ptr readAttributes(STEPCAFControl_Reader &theReader, STEPControl_Reader aReader = theReader.ChangeReader(); // BEGIN: reading materials of sub-shapes from file - if ( theIsMaterials ) + if (theIsMaterials) { TopTools_IndexedMapOfShape anIndices; TopExp::MapShapes(ageom->impl(), anIndices); @@ -254,8 +254,8 @@ void setShapeAttributes(const Handle(XCAFDoc_ShapeTool) &theShapeTool, std::vector aColRGB = {int(r*255),int(g*255),int(b*255)}; theResultBody->addShapeColor(aShapeName, aColRGB); } else if (theColorTool->GetColor(theLabel, XCAFDoc_ColorCurv, aCol)) { - double aR = aCol.Red(), aG = aCol.Green(), aB = aCol.Blue(); - std::vector aColRGB = {int(aR*255),int(aG*255),int(aB*255)}; + double aR = aCol.Red(), aG = aCol.Green(), aB = aCol.Blue(); + std::vector aColRGB = {int(aR*255),int(aG*255),int(aB*255)}; theResultBody->addShapeColor(aShapeName, aColRGB); } // check explicit coloring of boundary entities @@ -263,8 +263,8 @@ void setShapeAttributes(const Handle(XCAFDoc_ShapeTool) &theShapeTool, TopExp_Explorer aXp2(aShape, TopAbs_FACE); while(aXp2.More()) { if (theColorTool->GetColor(aXp2.Current(), XCAFDoc_ColorGen, aCol) || - theColorTool->GetColor(aXp2.Current(), XCAFDoc_ColorSurf, aCol) || - theColorTool->GetColor(aXp2.Current(), XCAFDoc_ColorCurv, aCol)) { + theColorTool->GetColor(aXp2.Current(), XCAFDoc_ColorSurf, aCol) || + theColorTool->GetColor(aXp2.Current(), XCAFDoc_ColorCurv, aCol)) { double aR = aCol.Red(), aG = aCol.Green(), aB = aCol.Blue(); TopoDS_Face aFace = TopoDS::Face(aXp2.Current()); std::vector aColRGB = {int(aR*255),int(aG*255),int(aB*255)}; @@ -280,23 +280,6 @@ void setShapeAttributes(const Handle(XCAFDoc_ShapeTool) &theShapeTool, aXp2.Next(); } } - if (aDim == 2) { - TopExp_Explorer aXp1(aShape, TopAbs_EDGE); - while(aXp1.More()) { - if (theColorTool->GetColor(aXp1.Current(), XCAFDoc_ColorGen, aCol) || - theColorTool->GetColor(aXp1.Current(), XCAFDoc_ColorSurf, aCol) || - theColorTool->GetColor(aXp1.Current(), XCAFDoc_ColorCurv, aCol)) { - double aR = aCol.Red(), aG = aCol.Green(), aB = aCol.Blue(); - std::vector aColRGB = {int(aR*255),int(aG*255),int(aB*255)}; - std::wstringstream aNameEdge; - aNameEdge << L"Edge_"<< aShapeName; - aShapeGeom->setImpl(new TopoDS_Shape(aXp1.Current() )); - theResultBody->addShapeColor( - theResultBody->addShapeName(aShapeGeom , aNameEdge.str()), aColRGB); - } - aXp1.Next(); - } - } } else { if (!theShapeTool->IsReference(theLabel) ){ TopoDS_Shape aShape = theShapeTool->GetShape(theLabel);