[Sketcher] Use std::shared_ptr instead of boost::shared_ptr

There's no need to use boost version when stl has support for shared_ptr
This commit is contained in:
Benjamin Nauck
2021-03-06 01:05:58 +01:00
committed by wwmayer
parent b6a5716b6a
commit 7422a64c84
4 changed files with 15 additions and 15 deletions

View File

@@ -48,6 +48,7 @@
#include <assert.h>
#include <string>
#include <map>
#include <memory>
#include <vector>
#include <set>
#include <bitset>
@@ -60,7 +61,6 @@
// Boost
#include <boost/bind/bind.hpp>
#include <boost/shared_ptr.hpp>
// Opencascade
#include <Mod/Part/App/OpenCascadeAll.h>

View File

@@ -393,7 +393,7 @@ int SketchObject::setDriving(int ConstrId, bool isdriving)
this->Constraints.setValues(std::move(newVals));
if (!isdriving)
setExpression(Constraints.createPath(ConstrId), boost::shared_ptr<App::Expression>());
setExpression(Constraints.createPath(ConstrId), std::shared_ptr<App::Expression>());
if(noRecomputes) // if we do not have a recompute, the sketch must be solved to update the DoF of the solver
solve();
@@ -451,7 +451,7 @@ int SketchObject::toggleDriving(int ConstrId)
newVals[ConstrId] = constNew;
this->Constraints.setValues(std::move(newVals));
if (!constNew->isDriving)
setExpression(Constraints.createPath(ConstrId), boost::shared_ptr<App::Expression>());
setExpression(Constraints.createPath(ConstrId), std::shared_ptr<App::Expression>());
if(noRecomputes) // if we do not have a recompute, the sketch must be solved to update the DoF of the solver
@@ -556,7 +556,7 @@ int SketchObject::setDatumsDriving(bool isdriving)
for (size_t i = 0; i < uvals.size(); i++) {
if (!isdriving && uvals[i]->isDimensional())
setExpression(Constraints.createPath(i), boost::shared_ptr<App::Expression>());
setExpression(Constraints.createPath(i), std::shared_ptr<App::Expression>());
}
if (noRecomputes) // if we do not have a recompute, the sketch must be solved to update the DoF of the solver
@@ -1265,7 +1265,7 @@ int SketchObject::addCopyOfConstraints(const SketchObject &orig)
if (expr_info.expression) { // if there is an expression on the source dimensional
App::ObjectIdentifier dpath = this->Constraints.createPath(i);
setExpression(dpath, boost::shared_ptr<App::Expression>(expr_info.expression->copy()));
setExpression(dpath, std::shared_ptr<App::Expression>(expr_info.expression->copy()));
}
}
}
@@ -5915,7 +5915,7 @@ int SketchObject::carbonCopy(App::DocumentObject * pObj, bool construction)
* if (expr_info.expression)*/
//App::Expression * expr = parse(this, const std::string& buffer);
boost::shared_ptr<App::Expression> expr(App::Expression::parse(this, spath.getDocumentObjectName().getString() +std::string(1,'.') + spath.toString()));
std::shared_ptr<App::Expression> expr(App::Expression::parse(this, spath.getDocumentObjectName().getString() +std::string(1,'.') + spath.toString()));
setExpression(Constraints.createPath(nextcid), expr);
}
}
@@ -7330,7 +7330,7 @@ void SketchObject::validateConstraints()
}
}
std::string SketchObject::validateExpression(const App::ObjectIdentifier &path, boost::shared_ptr<const App::Expression> expr)
std::string SketchObject::validateExpression(const App::ObjectIdentifier &path, std::shared_ptr<const App::Expression> expr)
{
const App::Property * prop = path.getProperty();
@@ -7422,7 +7422,7 @@ void SketchObject::constraintsRemoved(const std::set<App::ObjectIdentifier> &rem
std::set<App::ObjectIdentifier>::const_iterator i = removed.begin();
while (i != removed.end()) {
ExpressionEngine.setValue(*i, boost::shared_ptr<App::Expression>());
ExpressionEngine.setValue(*i, std::shared_ptr<App::Expression>());
++i;
}
}
@@ -8010,7 +8010,7 @@ bool SketchObject::AutoLockTangencyAndPerpty(Constraint *cstr, bool bForce, bool
return true;
}
void SketchObject::setExpression(const App::ObjectIdentifier &path, boost::shared_ptr<App::Expression> expr)
void SketchObject::setExpression(const App::ObjectIdentifier &path, std::shared_ptr<App::Expression> expr)
{
DocumentObject::setExpression(path, expr);

View File

@@ -500,9 +500,9 @@ protected:
virtual void onDocumentRestored() override;
virtual void restoreFinished() override;
virtual void setExpression(const App::ObjectIdentifier &path, boost::shared_ptr<App::Expression> expr) override;
virtual void setExpression(const App::ObjectIdentifier &path, std::shared_ptr<App::Expression> expr) override;
std::string validateExpression(const App::ObjectIdentifier &path, boost::shared_ptr<const App::Expression> expr);
std::string validateExpression(const App::ObjectIdentifier &path, std::shared_ptr<const App::Expression> expr);
void constraintsRenamed(const std::map<App::ObjectIdentifier, App::ObjectIdentifier> &renamed);
void constraintsRemoved(const std::set<App::ObjectIdentifier> &removed);

View File

@@ -24,7 +24,7 @@
#ifndef _PreComp_
# include <sstream>
# include <Geom_TrimmedCurve.hxx>
# include <boost/shared_ptr.hpp>
# include <memory>
#endif
#include <Base/StdStlTools.h>
@@ -132,7 +132,7 @@ PyObject* SketchObjectPy::addGeometry(PyObject *args)
else if (PyObject_TypeCheck(pcObj, &(PyList_Type)) ||
PyObject_TypeCheck(pcObj, &(PyTuple_Type))) {
std::vector<Part::Geometry *> geoList;
std::vector<boost::shared_ptr <Part::Geometry> > tmpList;
std::vector<std::shared_ptr <Part::Geometry> > tmpList;
Py::Sequence list(pcObj);
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
if (PyObject_TypeCheck((*it).ptr(), &(Part::GeometryPy::Type))) {
@@ -145,14 +145,14 @@ PyObject* SketchObjectPy::addGeometry(PyObject *args)
Handle(Geom_Ellipse) ellipse = Handle(Geom_Ellipse)::DownCast(trim->BasisCurve());
if (!circle.IsNull()) {
// create the definition struct for that geom
boost::shared_ptr<Part::GeomArcOfCircle> aoc(new Part::GeomArcOfCircle());
std::shared_ptr<Part::GeomArcOfCircle> aoc(new Part::GeomArcOfCircle());
aoc->setHandle(trim);
geoList.push_back(aoc.get());
tmpList.push_back(aoc);
}
else if (!ellipse.IsNull()) {
// create the definition struct for that geom
boost::shared_ptr<Part::GeomArcOfEllipse> aoe(new Part::GeomArcOfEllipse());
std::shared_ptr<Part::GeomArcOfEllipse> aoe(new Part::GeomArcOfEllipse());
aoe->setHandle(trim);
geoList.push_back(aoe.get());
tmpList.push_back(aoe);