From b2e414c40792ba899b33369e8e9e7c338c5b8fd4 Mon Sep 17 00:00:00 2001 From: Ajinkya Dahale Date: Sun, 5 Jan 2025 11:43:54 +0530 Subject: [PATCH] [Sketcher] Make `replaceGeometries` protected This should be a `protected` or `private` operation since it doesn't handle constraints. However, this is intended to be used by external classes that modify a `SketchObject` (instead of these modifications like `split`, `trim`, `join` etc. being methods of `SketchObject`). In that case, it may be best to use the `friend` keyword. --- src/Mod/Sketcher/App/SketchObject.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Mod/Sketcher/App/SketchObject.h b/src/Mod/Sketcher/App/SketchObject.h index 7eaf8b0ba69d..e586837318c8 100644 --- a/src/Mod/Sketcher/App/SketchObject.h +++ b/src/Mod/Sketcher/App/SketchObject.h @@ -173,10 +173,6 @@ class SketcherExport SketchObject: public Part::Part2DObject int addConstraint(std::unique_ptr constraint); /// delete constraint int delConstraint(int ConstrId); - /// Replaces geometries at `oldGeoIds` with `newGeos`, lower Ids first. - /// If `oldGeoIds` is bigger, deletes the remaining. - /// If `newGeos` is bigger, adds the remaining geometries at the end. - void replaceGeometries(std::vector oldGeoIds, std::vector& newGeos); /** deletes a group of constraints at once, if norecomputes is active, the default behaviour is * that it will solve the sketch. * @@ -905,6 +901,12 @@ class SketcherExport SketchObject: public Part::Part2DObject /// get called by the container when a property has changed void onChanged(const App::Property* /*prop*/) override; + /// Replaces geometries at `oldGeoIds` with `newGeos`, lower Ids first. + /// If `oldGeoIds` is bigger, deletes the remaining. + /// If `newGeos` is bigger, adds the remaining geometries at the end. + /// NOTE: Does NOT move any constraints + void replaceGeometries(std::vector oldGeoIds, std::vector& newGeos); + /// Helper functions for `deleteUnusedInternalGeometry` by cases /// two foci for ellipses and arcs of ellipses and hyperbolas int deleteUnusedInternalGeometryWhenTwoFoci(int GeoId, bool delgeoid = false);