mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-09-08 05:38:12 +08:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user