Modeling - BRep Graph Builder and Editor clean up (#1237)

- Replace `BRepGraph_Builder::Perform()` with `BRepGraph_Builder::Add()` and introduce `BRepGraph::Clear()` as the rebuild boundary.
- Refactor product/occurrence editing APIs (e.g., `AddAssembly` → `CreateEmptyProduct`, `AddOccurrence` → `LinkProducts`, occurrence mutation via `Editor().Occurrences()`).
- Update a large set of GTests and inline docs to use the new lifecycle and API names.
This commit is contained in:
Pasukhin Dmitry
2026-04-26 15:02:00 +01:00
committed by GitHub
parent 0804c2b3f9
commit 048a2927fb
59 changed files with 2483 additions and 1224 deletions
@@ -29,7 +29,9 @@ protected:
{
BRepPrimAPI_MakeBox aBoxMaker(10.0, 20.0, 30.0);
const TopoDS_Shape& aBox = aBoxMaker.Shape();
BRepGraph_Builder::Perform(myGraph, aBox);
myGraph.Clear();
[[maybe_unused]] const BRepGraph_Builder::Result aBuildRes1 =
BRepGraph_Builder::Add(myGraph, aBox);
ASSERT_TRUE(myGraph.IsDone());
}
@@ -95,7 +97,9 @@ TEST_F(BRepGraph_VersionStampTest, IsStale_DifferentGeneration_ReturnsTrue)
// Rebuild the graph - generation changes.
BRepPrimAPI_MakeBox aBoxMaker(10.0, 20.0, 30.0);
BRepGraph_Builder::Perform(myGraph, aBoxMaker.Shape());
myGraph.Clear();
[[maybe_unused]] const BRepGraph_Builder::Result aBuildRes2 =
BRepGraph_Builder::Add(myGraph, aBoxMaker.Shape());
ASSERT_TRUE(myGraph.IsDone());
EXPECT_TRUE(myGraph.UIDs().IsStale(aStamp));
@@ -181,7 +185,9 @@ TEST_F(BRepGraph_VersionStampTest, GraphGUID_Rebuild_Changes)
const Standard_GUID aGUID1 = myGraph.UIDs().GraphGUID();
BRepPrimAPI_MakeBox aBoxMaker(10.0, 20.0, 30.0);
BRepGraph_Builder::Perform(myGraph, aBoxMaker.Shape());
myGraph.Clear();
[[maybe_unused]] const BRepGraph_Builder::Result aBuildRes3 =
BRepGraph_Builder::Add(myGraph, aBoxMaker.Shape());
ASSERT_TRUE(myGraph.IsDone());
const Standard_GUID aGUID2 = myGraph.UIDs().GraphGUID();