All: Reformat according to new standard

This commit is contained in:
pre-commit-ci[bot]
2025-11-11 13:49:01 +01:00
committed by Kacper Donat
parent eafd18dac0
commit 25c3ba7338
2390 changed files with 154630 additions and 115818 deletions

View File

@@ -22,22 +22,22 @@
* *
***************************************************************************/
# include <fcntl.h>
# include <BRep_Builder.hxx>
# include <IGESBasic_Group.hxx>
# include <IGESBasic_SingularSubfigure.hxx>
# include <IGESControl_Controller.hxx>
# include <IGESControl_Reader.hxx>
# include <IGESSolid_ManifoldSolid.hxx>
# include <Message_MsgFile.hxx>
# include <Standard_Version.hxx>
# include <TColStd_HSequenceOfTransient.hxx>
# include <TopoDS.hxx>
# include <TopoDS_Compound.hxx>
# include <TopoDS_Shape.hxx>
# include <Transfer_TransientProcess.hxx>
# include <XSControl_TransferReader.hxx>
# include <XSControl_WorkSession.hxx>
#include <fcntl.h>
#include <BRep_Builder.hxx>
#include <IGESBasic_Group.hxx>
#include <IGESBasic_SingularSubfigure.hxx>
#include <IGESControl_Controller.hxx>
#include <IGESControl_Reader.hxx>
#include <IGESSolid_ManifoldSolid.hxx>
#include <Message_MsgFile.hxx>
#include <Standard_Version.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Shape.hxx>
#include <Transfer_TransientProcess.hxx>
#include <XSControl_TransferReader.hxx>
#include <XSControl_WorkSession.hxx>
#include <Base/Console.h>
@@ -51,7 +51,7 @@ FC_LOG_LEVEL_INIT("Part")
using namespace Part;
int Part::ImportIgesParts(App::Document *pcDoc, const char* FileName)
int Part::ImportIgesParts(App::Document* pcDoc, const char* FileName)
{
FC_WARN("Importing IGES via 'Part' is deprecated. Use 'ImportGui' instead.");
try {
@@ -60,27 +60,28 @@ int Part::ImportIgesParts(App::Document *pcDoc, const char* FileName)
IGESControl_Controller::Init();
// load data exchange message files
Message_MsgFile::LoadFromEnv("CSF_XSMessage","IGES");
Message_MsgFile::LoadFromEnv("CSF_XSMessage", "IGES");
// load shape healing message files
Message_MsgFile::LoadFromEnv("CSF_SHMessageStd","SHAPEStd");
Message_MsgFile::LoadFromEnv("CSF_SHMessageStd", "SHAPEStd");
IGESControl_Reader aReader;
if (aReader.ReadFile((Standard_CString)FileName) != IFSelect_RetDone)
if (aReader.ReadFile((Standard_CString)FileName) != IFSelect_RetDone) {
throw Base::FileException("Error in reading IGES");
}
// Ignore construction elements
// http://www.opencascade.org/org/forum/thread_20603/?forum=3
aReader.SetReadVisible(Standard_True);
// check file conformity and output stats
aReader.PrintCheckLoad(Standard_True,IFSelect_GeneralInfo);
aReader.PrintCheckLoad(Standard_True, IFSelect_GeneralInfo);
std::string aName = fi.fileNamePure();
// make model
aReader.ClearShapes();
//Standard_Integer nbRootsForTransfer = aReader.NbRootsForTransfer();
// Standard_Integer nbRootsForTransfer = aReader.NbRootsForTransfer();
aReader.TransferRoots();
// put all other free-flying shapes into a single compound
@@ -90,14 +91,13 @@ int Part::ImportIgesParts(App::Document *pcDoc, const char* FileName)
builder.MakeCompound(comp);
Standard_Integer nbShapes = aReader.NbShapes();
for (Standard_Integer i=1; i<=nbShapes; i++) {
for (Standard_Integer i = 1; i <= nbShapes; i++) {
TopoDS_Shape aShape = aReader.Shape(i);
if (!aShape.IsNull()) {
if (aShape.ShapeType() == TopAbs_SOLID ||
aShape.ShapeType() == TopAbs_COMPOUND ||
aShape.ShapeType() == TopAbs_SHELL) {
auto* obj = pcDoc->addObject<Part::Feature>(aName.c_str());
obj->Shape.setValue(aShape);
if (aShape.ShapeType() == TopAbs_SOLID || aShape.ShapeType() == TopAbs_COMPOUND
|| aShape.ShapeType() == TopAbs_SHELL) {
auto* obj = pcDoc->addObject<Part::Feature>(aName.c_str());
obj->Shape.setValue(aShape);
}
else {
builder.Add(comp, aShape);