X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_STEPImportXCAF.cpp;h=6fa5b5b5b106a173f59998e5ba82cf454caef92d;hb=06e7f5859095193fc7f498bd89a7d28009794f53;hp=2d6f6ac602c1f36f1375549c0ef4726278ca1009;hpb=88ee9b2b81cf93a6324336b57e30cc8a3a487499;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_STEPImportXCAF.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_STEPImportXCAF.cpp index 2d6f6ac60..6fa5b5b5b 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_STEPImportXCAF.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_STEPImportXCAF.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2022 CEA/DEN, EDF R&D +// Copyright (C) 2014-2023 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -47,9 +48,34 @@ #include #include #include +#include +#include #include +// read geometry +std::shared_ptr setGeom(const Handle(XCAFDoc_ShapeTool) &shapeTool, + const TDF_Label &theLabel, + std::string& theError); + +/// read attributs for label +void setShapeAttributes(const Handle(XCAFDoc_ShapeTool) &theShapeTool, + const Handle(XCAFDoc_ColorTool) &theColorTool, + const Handle(XCAFDoc_MaterialTool) &TheMaterialTool, + const TDF_Label &theLabel, + const TopLoc_Location &theLoc, + std::shared_ptr theResultBody, + std::map< std::wstring, std::list> &theMaterialShape, + bool theIsRef); + +// store Materiel for theShapeLabel in the map theMaterialShape +void storeMaterial(std::shared_ptr theResultBody, + const Handle(Standard_Transient) &theEnti, + const TopTools_IndexedMapOfShape &theIndices, + const Handle(Transfer_TransientProcess) &theTP, + const TDF_Label &theShapeLabel, + std::map< std::wstring, std::list> &theMaterialShape); + //============================================================================= TopoDS_Shape getShape(const Handle(Standard_Transient) &theEnti, const Handle(Transfer_TransientProcess) &theTP) @@ -89,7 +115,7 @@ std::shared_ptr readAttributes(STEPCAFControl_Reader &theReader, setShapeAttributes(shapeTool, colorTool, materialTool, mainLabel, TopLoc_Location(),theResultBody,theMaterialShape,false); - std::shared_ptr ageom = setgeom(shapeTool,mainLabel,theError); + std::shared_ptr ageom = setGeom(shapeTool,mainLabel,theError); STEPControl_Reader aReader = theReader.ChangeReader(); @@ -119,7 +145,7 @@ std::shared_ptr readAttributes(STEPCAFControl_Reader &theReader, } //============================================================================= -std::shared_ptr setgeom(const Handle(XCAFDoc_ShapeTool) &theShapeTool, +std::shared_ptr setGeom(const Handle(XCAFDoc_ShapeTool) &theShapeTool, const TDF_Label& /*theLabel*/, std::string& theError) { @@ -140,7 +166,7 @@ std::shared_ptr setgeom(const Handle(XCAFDoc_ShapeTool) &theShape aGeomShape->setImpl(new TopoDS_Shape(shape)); return aGeomShape; } else { - for (Standard_Integer i=1; iGetShape(aFrshapes.Value(i)); TDF_Label aLabel = theShapeTool->FindShape(aS, Standard_False); if ( (!aLabel.IsNull()) && (theShapeTool->IsShape(aLabel)) ) { @@ -148,7 +174,7 @@ std::shared_ptr setgeom(const Handle(XCAFDoc_ShapeTool) &theShape if (aS.IsNull()) { continue; } else { - if (!theShapeTool->IsReference(aLabel) ){ + if (aS.ShapeType() != TopAbs_SOLID && !theShapeTool->IsReference(aLabel)){ for(TDF_ChildIterator anIt(aLabel); anIt.More(); anIt.Next()) { aB.Add(aCompound, theShapeTool->GetShape(anIt.Value()) ); } @@ -386,4 +412,3 @@ void storeMaterial( std::shared_ptr theResultBody, } } } -