From 5190acbcac4d3e6c846bc8eee012365033b0ac09 Mon Sep 17 00:00:00 2001 From: Andrea Date: Sun, 1 Dec 2024 17:46:05 +0100 Subject: [PATCH] MOD: ImportOcaf2::getcolor getcolor() fucntion optimizzazion. removed duplicated check. Clean class ImportOCAF2 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci . [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci . Update ImportOCAF2.cpp . --- src/Mod/Import/App/ImportOCAF2.cpp | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/Mod/Import/App/ImportOCAF2.cpp b/src/Mod/Import/App/ImportOCAF2.cpp index 939de9acd0..19e8bb173d 100644 --- a/src/Mod/Import/App/ImportOCAF2.cpp +++ b/src/Mod/Import/App/ImportOCAF2.cpp @@ -133,8 +133,6 @@ void ImportOCAF2::setImportOptions(ImportOCAFOptions opts) void ImportOCAF2::setUseLinkGroup(bool enable) { options.useLinkGroup = enable; - - // Interface_Static::SetIVal("read.stepcaf.subshapes.name",1); aShapeTool->SetAutoNaming(!enable); } @@ -251,22 +249,6 @@ ImportOCAF2::expandShape(App::Document* doc, TDF_Label label, const TopoDS_Shape return nullptr; } - // When saved as compound, STEP file does not support instance sharing, - // meaning that even if the source compound may contain child shapes of - // shared instances, or multiple hierarchies, those information are lost - // when saved to STEP, everything become flat and duplicated. So the code - // below is not necessary. -#if 0 - auto baseShape = shape.Located(TopLoc_Location()); - auto it = myShapes.find(baseShape); - if(it!=myShapes.end()) { - auto link = static_cast(doc->addObject("App::Link","Link")); - link->Visibility.setValue(false); - link->setLink(-1,it->second.obj); - setPlacement(&link->Placement,shape); - return link; - } -#endif std::vector objs; if (shape.ShapeType() == TopAbs_COMPOUND) { @@ -290,7 +272,6 @@ ImportOCAF2::expandShape(App::Document* doc, TDF_Label label, const TopoDS_Shape auto compound = static_cast(doc->addObject("Part::Compound2", "Compound")); compound->Links.setValues(objs); - // compound->Visibility.setValue(false); setPlacement(&compound->Placement, shape); return compound; } @@ -407,7 +388,6 @@ bool ImportOCAF2::createObject(App::Document* doc, feature = static_cast( doc->addObject("Part::Feature", tshape.shapeName().c_str())); feature->Shape.setValue(shape); - // feature->Visibility.setValue(false); } applyFaceColors(feature, {info.faceColor}); applyEdgeColors(feature, {info.edgeColor}); @@ -724,7 +704,6 @@ App::DocumentObject* ImportOCAF2::loadShape(App::Document* doc, auto compound = static_cast(doc->addObject("Part::Compound2", "Compound")); compound->Links.setValue(info.obj); - // compound->Visibility.setValue(false); info.propPlacement = &compound->Placement; if (info.faceColor != it->second.faceColor) { applyFaceColors(compound, {info.faceColor});