Part: use of ShapeMapHasher for code simplification

This commit is contained in:
wmayer
2024-02-10 19:47:37 +01:00
committed by Chris Hennes
parent b45fcead7a
commit cc8452a545
7 changed files with 30 additions and 111 deletions

View File

@@ -45,6 +45,7 @@
#include <App/Document.h>
#include <Base/Console.h>
#include <Mod/Part/App/PartFeature.h>
#include <Mod/Part/App/ShapeMapHasher.h>
#include "ImportOCAFAssembly.h"
@@ -109,7 +110,7 @@ void ImportOCAFAssembly::loadShapes(const TDF_Label& label,
int hash = 0;
TopoDS_Shape aShape;
if (aShapeTool->GetShape(label, aShape)) {
hash = aShape.HashCode(HashUpper);
hash = Part::ShapeMapHasher {}(aShape);
}
Handle(TDataStd_Name) name;
@@ -192,7 +193,7 @@ void ImportOCAFAssembly::loadShapes(const TDF_Label& label,
if (isRef || myRefShapes.find(hash) == myRefShapes.end()) {
TopoDS_Shape aShape;
if (isRef && aShapeTool->GetShape(label, aShape)) {
myRefShapes.insert(aShape.HashCode(HashUpper));
myRefShapes.insert(Part::ShapeMapHasher {}(aShape));
}
if (aShapeTool->IsSimpleShape(label) && (isRef || aShapeTool->IsFree(label))) {