diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 082a402b3b..2b3577d336 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -1415,7 +1415,6 @@ int SketchObject::moveGeometries(const std::vector& geoEltIds, con if (lastSolverStatus == 0) { std::vector geomlist = solvedSketch.extractGeometry(); Geometry.setValues(geomlist); - // Constraints.acceptGeometry(getCompleteGeometry()); for (auto* geo : geomlist) { if (geo){ delete geo; @@ -1571,32 +1570,32 @@ Base::Vector3d SketchObject::getPointForGeometry<>(const Part::GeomBSplineCurve Base::Vector3d SketchObject::getPoint(const Part::Geometry *geo, PointPos PosId) { - if (auto asPoint = freecad_cast(geo)) { - return getPointForGeometry(asPoint, PosId); + if (auto point = freecad_cast(geo)) { + return getPointForGeometry(point, PosId); } - else if (auto asLineSegment = freecad_cast(geo)) { - return getPointForGeometry(asLineSegment, PosId); + else if (auto lineSegment = freecad_cast(geo)) { + return getPointForGeometry(lineSegment, PosId); } - else if (auto asCircle = freecad_cast(geo)) { - return getPointForGeometry(asCircle, PosId); + else if (auto circle = freecad_cast(geo)) { + return getPointForGeometry(circle, PosId); } - else if (auto asEllipse = freecad_cast(geo)) { - return getPointForGeometry(asEllipse, PosId); + else if (auto ellipse = freecad_cast(geo)) { + return getPointForGeometry(ellipse, PosId); } - else if (auto asArcOfCircle = freecad_cast(geo)) { - return getPointForGeometry(asArcOfCircle, PosId); + else if (auto arcOfCircle = freecad_cast(geo)) { + return getPointForGeometry(arcOfCircle, PosId); } - else if (auto asArcOfEllipse = freecad_cast(geo)) { - return getPointForGeometry(asArcOfEllipse, PosId); + else if (auto arcOfEllipse = freecad_cast(geo)) { + return getPointForGeometry(arcOfEllipse, PosId); } - else if (auto asArcOfHyperbola = freecad_cast(geo)) { - return getPointForGeometry(asArcOfHyperbola, PosId); + else if (auto arcOfHyperbola = freecad_cast(geo)) { + return getPointForGeometry(arcOfHyperbola, PosId); } - else if (auto asArcOfParabola = freecad_cast(geo)) { - return getPointForGeometry(asArcOfParabola, PosId); + else if (auto arcOfParabola = freecad_cast(geo)) { + return getPointForGeometry(arcOfParabola, PosId); } - else if (auto asBSplineCurve = freecad_cast(geo)) { - return getPointForGeometry(asBSplineCurve, PosId); + else if (auto bSplineCurve = freecad_cast(geo)) { + return getPointForGeometry(bSplineCurve, PosId); } return Base::Vector3d(); } @@ -5577,7 +5576,7 @@ int SketchObject::exposeInternalGeometryForType(const int Geo return incrgeo; } -void SketchObject::addAndCleanup(std::vector& igeo, std::vector& icon) +void SketchObject::addAndCleanup(std::vector igeo, std::vector icon) { this->addGeometry(igeo, true); this->addConstraints(icon); @@ -7041,14 +7040,6 @@ int SketchObject::carbonCopy(App::DocumentObject* pObj, bool construction) spath.getDocumentObjectName().getString() + std::string(1, '.') + spath.toString())); } - // (there is a plausible alternative for a slightly different use case to copy the - // expression of the parent if one is existing) - /* - * App::PropertyExpressionEngine::ExpressionInfo expr_info = - * psObj->getExpression(path); - * - * if (expr_info.expression)*/ - // App::Expression * expr = parse(this, const std::string& buffer); setExpression(Constraints.createPath(nextcid), std::move(expr)); } } @@ -8601,7 +8592,7 @@ void processFace (const Rotation& invRot, const Placement& invPlm, const gp_Trsf& mov, const gp_Pln& sketchPlane, - const opencascade::handle& gPlane, + const Handle(Geom_Plane)& gPlane, gp_Ax3& sketchAx3, TopoDS_Shape& aProjFace, std::vector>& geos, @@ -10811,7 +10802,6 @@ bool SketchObject::AutoLockTangencyAndPerpty(Constraint* cstr, bool bForce, bool using std::numbers::pi; try { - // assert ( cstr->Type == Tangent || cstr->Type == Perpendicular); /*tangency type already set. If not bForce - don't touch.*/ if (cstr->getValue() != 0.0 && !bForce) return true; diff --git a/src/Mod/Sketcher/App/SketchObject.h b/src/Mod/Sketcher/App/SketchObject.h index c43a6f8916..81e4252f77 100644 --- a/src/Mod/Sketcher/App/SketchObject.h +++ b/src/Mod/Sketcher/App/SketchObject.h @@ -1021,7 +1021,9 @@ public: private: /// Internal helper method for exposeInternalGeometryForType - void addAndCleanup(std::vector& igeo, std::vector& icon); + /// Add geometry and constraints to `this`, then delete the geometry and constraints in the + /// vectors Note that the contents of the two vectors are invalid after this call. + void addAndCleanup(std::vector igeo, std::vector icon); /// Flag to allow external geometry from other bodies than the one this sketch belongs to bool allowOtherBody;