Toponaming/Part: Remove makeElementShape and cleanup opcode code

This commit is contained in:
bgbsww
2024-02-18 16:37:09 -05:00
committed by Chris Hennes
parent 2d0ef0e659
commit 0065c9cce7
13 changed files with 97 additions and 269 deletions

View File

@@ -7,6 +7,7 @@
#include "src/App/InitApplication.h"
#include "PartTestHelpers.h"
#include <Mod/Part/App/TopoShape.h>
#include <Mod/Part/App/TopoShapeOpCode.h>
using namespace Data;
using namespace Part;
@@ -92,7 +93,8 @@ TEST_F(TopoShapeMakeShapeTests, thruSections)
thruMaker.AddWire(wire2);
TopoShape topoShape {};
// Act
TopoShape& result = topoShape.makeElementShape(thruMaker, {wire1ts, wire2ts});
TopoShape& result =
topoShape.makeElementShape(thruMaker, {wire1ts, wire2ts}, OpCodes::ThruSections);
auto elements = elementMap(result);
// Assert
EXPECT_EQ(elements.size(), 24);
@@ -116,7 +118,11 @@ TEST_F(TopoShapeMakeShapeTests, sewing)
std::vector<TopoShape> sources {{face1, 1L}, {face2, 2L}};
TopoShape topoShape {};
// Act
TopoShape& result = topoShape.makeElementShape(sewer, sources);
TopoShape& result = topoShape.makeShapeWithElementMap(sewer.SewedShape(),
MapperSewing(sewer),
sources,
OpCodes::Sewing);
auto elements = elementMap(result);
// Assert
EXPECT_EQ(&result, &topoShape);