Toponaming/Part: Cleanup and test makeElementDraft

This commit is contained in:
bgbsww
2024-02-14 12:20:10 -05:00
parent 2e772bab1f
commit c6ca3e41b6
4 changed files with 81 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
#include <BRepPrimAPI_MakeBox.hxx>
#include <TopExp_Explorer.hxx>
#include "PartTestHelpers.h"
@@ -155,6 +156,28 @@ std::pair<TopoDS_Shape, TopoDS_Shape> CreateTwoCubes()
return {box1, box2};
}
std::pair<TopoShape, TopoShape> CreateTwoTopoShapeCubes()
{
auto [box1, box2] = CreateTwoCubes();
std::vector<TopoShape> vec;
long tag = 1L;
for (TopExp_Explorer exp(box1, TopAbs_FACE); exp.More(); exp.Next()) {
vec.emplace_back(TopoShape(exp.Current(), tag++));
}
TopoShape box1ts;
box1ts.makeElementCompound(vec);
box1ts.Tag = tag++;
vec.clear();
for (TopExp_Explorer exp(box2, TopAbs_FACE); exp.More(); exp.Next()) {
vec.emplace_back(TopoShape(exp.Current(), tag++));
}
TopoShape box2ts;
box2ts.Tag = tag++;
box2ts.makeElementCompound(vec);
return {box1ts, box2ts};
}
} // namespace PartTestHelpers
// NOLINTEND(readability-magic-numbers,cppcoreguidelines-avoid-magic-numbers)