Skip to content

Commit

Permalink
[Sketcher] Make replaceGeometries protected
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AjinkyaDahale committed Jan 16, 2025
1 parent aa1122c commit b2e414c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Mod/Sketcher/App/SketchObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,6 @@ class SketcherExport SketchObject: public Part::Part2DObject
int addConstraint(std::unique_ptr<Constraint> 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<int> oldGeoIds, std::vector<Part::Geometry*>& newGeos);
/** deletes a group of constraints at once, if norecomputes is active, the default behaviour is
* that it will solve the sketch.
*
Expand Down Expand Up @@ -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<int> oldGeoIds, std::vector<Part::Geometry*>& newGeos);

/// Helper functions for `deleteUnusedInternalGeometry` by cases
/// two foci for ellipses and arcs of ellipses and hyperbolas
int deleteUnusedInternalGeometryWhenTwoFoci(int GeoId, bool delgeoid = false);
Expand Down

0 comments on commit b2e414c

Please sign in to comment.