From f944ab3846a52e8f19bb2d4f6ec66e392669cdf5 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 22 Sep 2016 13:01:20 +0200 Subject: [PATCH] replace deprecated auto_ptr with unique_ptr --- src/App/Application.cpp | 4 ++-- src/App/Expression.cpp | 14 ++++++------ src/App/ObjectIdentifier.cpp | 2 +- src/App/PropertyExpressionEngine.cpp | 2 +- src/Base/Sequencer.h | 2 +- src/Base/XMLTools.cpp | 4 ++-- src/Base/XMLTools.h | 4 ++-- src/Gui/Application.cpp | 4 ++-- src/Gui/DlgExpressionInput.cpp | 2 +- src/Gui/DlgSettings3DViewImp.cpp | 2 +- src/Gui/DlgUnitsCalculatorImp.h | 2 +- src/Gui/InputField.cpp | 2 +- src/Gui/NavigationStyle.cpp | 2 +- src/Gui/QuantitySpinBox.cpp | 4 ++-- src/Gui/SpinBox.cpp | 12 +++++----- src/Gui/View3DInventorViewer.cpp | 6 ++--- src/Gui/View3DPy.cpp | 10 ++++----- src/Mod/Fem/App/AppFemPy.cpp | 6 ++--- src/Mod/Mesh/App/AppMeshPy.cpp | 8 +++---- src/Mod/Mesh/App/FeatureMeshDefects.cpp | 20 ++++++++--------- src/Mod/Mesh/App/FeatureMeshImport.cpp | 2 +- src/Mod/Mesh/App/FeatureMeshSegmentByMesh.cpp | 2 +- src/Mod/Mesh/App/FeatureMeshSetOperations.cpp | 2 +- src/Mod/Mesh/App/FeatureMeshSolid.cpp | 12 +++++----- src/Mod/Mesh/App/Mesh.cpp | 2 +- src/Mod/Mesh/App/MeshPyImp.cpp | 8 +++---- src/Mod/MeshPart/Gui/Tessellation.h | 2 +- src/Mod/Part/App/BSplineCurvePyImp.cpp | 2 +- src/Mod/Part/App/FeaturePartBoolean.cpp | 2 +- src/Mod/Part/App/ProgressIndicator.h | 2 +- src/Mod/Part/App/TopoShapePyImp.cpp | 12 +++++----- src/Mod/Part/Gui/DlgFilletEdges.h | 14 ++++++------ src/Mod/Part/Gui/DlgSettings3DViewPartImp.h | 2 +- src/Mod/Points/App/AppPointsPy.cpp | 6 ++--- src/Mod/Points/App/PointsPyImp.cpp | 22 +++++++++---------- src/Mod/Robot/App/kdl_cp/path.cpp | 14 ++++++------ src/Mod/Robot/App/kdl_cp/path_composite.cpp | 2 +- .../App/kdl_cp/path_roundedcomposite.cpp | 4 ++-- .../App/kdl_cp/rotational_interpolation.cpp | 2 +- src/Mod/Robot/App/kdl_cp/trajectory.cpp | 6 ++--- src/Mod/Sandbox/App/DocumentProtectorPy.cpp | 14 ++++++------ src/Mod/Sandbox/Gui/GLGraphicsView.cpp | 2 +- src/Mod/Sketcher/Gui/TaskSketcherValidation.h | 2 +- src/Mod/Spreadsheet/Gui/Command.cpp | 2 +- src/Mod/Spreadsheet/Gui/PropertiesDialog.cpp | 2 +- src/Mod/Spreadsheet/Gui/SheetTableView.cpp | 2 +- src/Mod/Spreadsheet/Gui/Workbench.h | 2 +- 47 files changed, 129 insertions(+), 129 deletions(-) diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 372f189025..7b76d3543f 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -297,7 +297,7 @@ Document* Application::newDocument(const char * Name, const char * UserName) } // create the FreeCAD document - auto_ptr newDoc(new Document() ); + std::unique_ptr newDoc(new Document() ); // add the document to the internal list DocMap[name] = newDoc.release(); // now owned by the Application @@ -341,7 +341,7 @@ bool Application::closeDocument(const char* name) // For exception-safety use a smart pointer if (_pActiveDoc == pos->second) setActiveDocument((Document*)0); - auto_ptr delDoc (pos->second); + std::unique_ptr delDoc (pos->second); DocMap.erase( pos ); // Trigger observers after removing the document from the internal map. diff --git a/src/App/Expression.cpp b/src/App/Expression.cpp index 96fcd74c72..0954d3b1b8 100644 --- a/src/App/Expression.cpp +++ b/src/App/Expression.cpp @@ -340,9 +340,9 @@ static bool definitelyLessThan(double a, double b, double epsilon) Expression * OperatorExpression::eval() const { - std::auto_ptr e1(left->eval()); + std::unique_ptr e1(left->eval()); NumberExpression * v1; - std::auto_ptr e2(right->eval()); + std::unique_ptr e2(right->eval()); NumberExpression * v2; Expression * output; const double epsilon = std::numeric_limits::epsilon(); @@ -892,7 +892,7 @@ Expression * FunctionExpression::evalAggregate() const } while (range.next()); } else if (args[i]->isDerivedFrom(App::VariableExpression::getClassTypeId())) { - std::auto_ptr e(args[i]->eval()); + std::unique_ptr e(args[i]->eval()); NumberExpression * n(freecad_dynamic_cast(e.get())); if (n) @@ -919,8 +919,8 @@ Expression * FunctionExpression::eval() const if (f > AGGREGATES) return evalAggregate(); - std::auto_ptr e1(args[0]->eval()); - std::auto_ptr e2(args.size() > 1 ? args[1]->eval() : 0); + std::unique_ptr e1(args[0]->eval()); + std::unique_ptr e2(args.size() > 1 ? args[1]->eval() : 0); NumberExpression * v1 = freecad_dynamic_cast(e1.get()); NumberExpression * v2 = freecad_dynamic_cast(e2.get()); double output; @@ -1537,7 +1537,7 @@ bool ConditionalExpression::isTouched() const Expression *ConditionalExpression::eval() const { - std::auto_ptr e(condition->eval()); + std::unique_ptr e(condition->eval()); NumberExpression * v = freecad_dynamic_cast(e.get()); if (v == 0) @@ -1551,7 +1551,7 @@ Expression *ConditionalExpression::eval() const Expression *ConditionalExpression::simplify() const { - std::auto_ptr e(condition->simplify()); + std::unique_ptr e(condition->simplify()); NumberExpression * v = freecad_dynamic_cast(e.get()); if (v == 0) diff --git a/src/App/ObjectIdentifier.cpp b/src/App/ObjectIdentifier.cpp index 635fc1980b..4522d6de6c 100644 --- a/src/App/ObjectIdentifier.cpp +++ b/src/App/ObjectIdentifier.cpp @@ -857,7 +857,7 @@ ObjectIdentifier ObjectIdentifier::relativeTo(const ObjectIdentifier &other) con ObjectIdentifier ObjectIdentifier::parse(const DocumentObject *docObj, const std::string &str) { - std::auto_ptr expr(ExpressionParser::parse(docObj, str.c_str())); + std::unique_ptr expr(ExpressionParser::parse(docObj, str.c_str())); VariableExpression * v = freecad_dynamic_cast(expr.get()); if (v) diff --git a/src/App/PropertyExpressionEngine.cpp b/src/App/PropertyExpressionEngine.cpp index 824ef9d320..2b71312c20 100644 --- a/src/App/PropertyExpressionEngine.cpp +++ b/src/App/PropertyExpressionEngine.cpp @@ -509,7 +509,7 @@ DocumentObjectExecReturn *App::PropertyExpressionEngine::execute() throw Base::Exception("Invalid property owner."); // Evaluate expression - std::auto_ptr e(expressions[*it].expression->eval()); + std::unique_ptr e(expressions[*it].expression->eval()); #ifdef FC_PROPERTYEXPRESSIONENGINE_LOG { diff --git a/src/Base/Sequencer.h b/src/Base/Sequencer.h index d446eca87d..9ff58fb544 100644 --- a/src/Base/Sequencer.h +++ b/src/Base/Sequencer.h @@ -397,7 +397,7 @@ private: static PyObject *PyMake(struct _typeobject *, PyObject *, PyObject *); private: - std::auto_ptr _seq; + std::unique_ptr _seq; }; } // namespace Base diff --git a/src/Base/XMLTools.cpp b/src/Base/XMLTools.cpp index 9f46238622..6b8270938d 100644 --- a/src/Base/XMLTools.cpp +++ b/src/Base/XMLTools.cpp @@ -32,8 +32,8 @@ using namespace Base; -std::auto_ptr StrXUTF8::transcoder; -std::auto_ptr XUTF8Str::transcoder; +std::unique_ptr StrXUTF8::transcoder; +std::unique_ptr XUTF8Str::transcoder; void StrXUTF8::terminate() { diff --git a/src/Base/XMLTools.h b/src/Base/XMLTools.h index 250a7059a9..62fd2b00a0 100644 --- a/src/Base/XMLTools.h +++ b/src/Base/XMLTools.h @@ -117,7 +117,7 @@ public : static void terminate(); private : - static std::auto_ptr transcoder; + static std::unique_ptr transcoder; // This is the local code page form of the string. }; @@ -237,7 +237,7 @@ public : private : std::basic_string str; - static std::auto_ptr transcoder; + static std::unique_ptr transcoder; }; inline XUTF8Str::XUTF8Str(const char* const fromTranscode) diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index c7d84ac2e3..66a159d606 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -276,7 +276,7 @@ FreeCADGui_subgraphFromObject(PyObject * /*self*/, PyObject *args) try { Base::BaseClass* base = static_cast(Base::Type::createInstanceByName(vp.c_str(), true)); if (base && base->getTypeId().isDerivedFrom(Gui::ViewProviderDocumentObject::getClassTypeId())) { - std::auto_ptr vp(static_cast(base)); + std::unique_ptr vp(static_cast(base)); std::map Map; obj->getPropertyMap(Map); vp->attach(obj); @@ -697,7 +697,7 @@ void Application::slotDeleteDocument(const App::Document& Doc) setActiveDocument(0); // For exception-safety use a smart pointer - auto_ptr delDoc (doc->second); + unique_ptr delDoc (doc->second); d->documents.erase(doc); } diff --git a/src/Gui/DlgExpressionInput.cpp b/src/Gui/DlgExpressionInput.cpp index d87689ecca..1d9bc0bb3c 100644 --- a/src/Gui/DlgExpressionInput.cpp +++ b/src/Gui/DlgExpressionInput.cpp @@ -128,7 +128,7 @@ void DlgExpressionInput::textChanged(const QString &text) if (error.size() > 0) throw Base::Exception(error.c_str()); - std::auto_ptr result(expr->eval()); + std::unique_ptr result(expr->eval()); expression = expr; ui->okBtn->setEnabled(true); diff --git a/src/Gui/DlgSettings3DViewImp.cpp b/src/Gui/DlgSettings3DViewImp.cpp index 4592930060..dc04047f28 100644 --- a/src/Gui/DlgSettings3DViewImp.cpp +++ b/src/Gui/DlgSettings3DViewImp.cpp @@ -135,7 +135,7 @@ void DlgSettings3DViewImp::on_mouseButton_clicked() QVariant data = comboNavigationStyle->itemData(comboNavigationStyle->currentIndex(), Qt::UserRole); void* instance = Base::Type::createInstanceByName((const char*)data.toByteArray()); - std::auto_ptr ns(static_cast(instance)); + std::unique_ptr ns(static_cast(instance)); ui.groupBox->setTitle(ui.groupBox->title()+QString::fromLatin1(" ")+comboNavigationStyle->currentText()); QString descr; descr = qApp->translate((const char*)data.toByteArray(),ns->mouseButtons(NavigationStyle::SELECTION)); diff --git a/src/Gui/DlgUnitsCalculatorImp.h b/src/Gui/DlgUnitsCalculatorImp.h index 4cb86a811c..9d7ef6aa11 100644 --- a/src/Gui/DlgUnitsCalculatorImp.h +++ b/src/Gui/DlgUnitsCalculatorImp.h @@ -63,7 +63,7 @@ protected Q_SLOTS: private: Base::Quantity actValue; Base::Quantity actUnit; - std::auto_ptr ui; + std::unique_ptr ui; QList units; }; diff --git a/src/Gui/InputField.cpp b/src/Gui/InputField.cpp index 388acdc840..1c07539f5b 100644 --- a/src/Gui/InputField.cpp +++ b/src/Gui/InputField.cpp @@ -241,7 +241,7 @@ void InputField::newInput(const QString & text) setExpression(e); - std::auto_ptr evalRes(getExpression()->eval()); + std::unique_ptr evalRes(getExpression()->eval()); NumberExpression * value = freecad_dynamic_cast(evalRes.get()); if (value) { diff --git a/src/Gui/NavigationStyle.cpp b/src/Gui/NavigationStyle.cpp index 8642e59fed..6b9d564bd0 100644 --- a/src/Gui/NavigationStyle.cpp +++ b/src/Gui/NavigationStyle.cpp @@ -1568,7 +1568,7 @@ std::map UserNavigationStyle::getUserFriendlyNames() for (std::vector::iterator it = types.begin(); it != types.end(); ++it) { if (*it != UserNavigationStyle::getClassTypeId()) { - std::auto_ptr inst(static_cast(it->createInstance())); + std::unique_ptr inst(static_cast(it->createInstance())); if (inst.get()) { names[*it] = inst->userFriendlyName(); } diff --git a/src/Gui/QuantitySpinBox.cpp b/src/Gui/QuantitySpinBox.cpp index e69fe525ac..646efe9290 100644 --- a/src/Gui/QuantitySpinBox.cpp +++ b/src/Gui/QuantitySpinBox.cpp @@ -292,7 +292,7 @@ void Gui::QuantitySpinBox::onChange() { Q_ASSERT(isBound()); if (getExpression()) { - std::auto_ptr result(getExpression()->eval()); + std::unique_ptr result(getExpression()->eval()); NumberExpression * value = freecad_dynamic_cast(result.get()); if (value) { @@ -345,7 +345,7 @@ void QuantitySpinBox::resizeEvent(QResizeEvent * event) try { if (isBound() && getExpression()) { - std::auto_ptr result(getExpression()->eval()); + std::unique_ptr result(getExpression()->eval()); NumberExpression * value = freecad_dynamic_cast(result.get()); if (value) { diff --git a/src/Gui/SpinBox.cpp b/src/Gui/SpinBox.cpp index 775066e2a6..8bb1ab2ad9 100644 --- a/src/Gui/SpinBox.cpp +++ b/src/Gui/SpinBox.cpp @@ -279,7 +279,7 @@ void UIntSpinBox::setExpression(boost::shared_ptr expr) void UIntSpinBox::onChange() { if (getExpression()) { - std::auto_ptr result(getExpression()->eval()); + std::unique_ptr result(getExpression()->eval()); NumberExpression * value = freecad_dynamic_cast(result.get()); if (value) { @@ -331,7 +331,7 @@ void UIntSpinBox::resizeEvent(QResizeEvent * event) try { if (isBound() && getExpression()) { - std::auto_ptr result(getExpression()->eval()); + std::unique_ptr result(getExpression()->eval()); NumberExpression * value = freecad_dynamic_cast(result.get()); if (value) { @@ -470,7 +470,7 @@ void IntSpinBox::setExpression(boost::shared_ptr expr) void IntSpinBox::onChange() { if (getExpression()) { - std::auto_ptr result(getExpression()->eval()); + std::unique_ptr result(getExpression()->eval()); NumberExpression * value = freecad_dynamic_cast(result.get()); if (value) { @@ -506,7 +506,7 @@ void IntSpinBox::resizeEvent(QResizeEvent * event) try { if (isBound() && getExpression()) { - std::auto_ptr result(getExpression()->eval()); + std::unique_ptr result(getExpression()->eval()); NumberExpression * value = freecad_dynamic_cast(result.get()); if (value) { @@ -645,7 +645,7 @@ void DoubleSpinBox::setExpression(boost::shared_ptr expr) void DoubleSpinBox::onChange() { if (getExpression()) { - std::auto_ptr result(getExpression()->eval()); + std::unique_ptr result(getExpression()->eval()); NumberExpression * value = freecad_dynamic_cast(result.get()); if (value) { @@ -681,7 +681,7 @@ void DoubleSpinBox::resizeEvent(QResizeEvent * event) try { if (isBound() && getExpression()) { - std::auto_ptr result(getExpression()->eval()); + std::unique_ptr result(getExpression()->eval()); NumberExpression * value = freecad_dynamic_cast(result.get()); if (value) { diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index a920ec656f..427d9f3c68 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -1156,13 +1156,13 @@ bool View3DInventorViewer::dumpToFile(SoNode* node, const char* filename, bool b if (fi.hasExtension("idtf") || fi.hasExtension("svg")) { int ps=4; QColor c = Qt::white; - std::auto_ptr vo; + std::unique_ptr vo; if (fi.hasExtension("svg")) { - vo = std::auto_ptr(new SoFCVectorizeSVGAction()); + vo = std::unique_ptr(new SoFCVectorizeSVGAction()); } else if (fi.hasExtension("idtf")) { - vo = std::auto_ptr(new SoFCVectorizeU3DAction()); + vo = std::unique_ptr(new SoFCVectorizeU3DAction()); } else { throw Base::Exception("Not supported vector graphic"); diff --git a/src/Gui/View3DPy.cpp b/src/Gui/View3DPy.cpp index 84ce78b62c..0ac20e8a39 100644 --- a/src/Gui/View3DPy.cpp +++ b/src/Gui/View3DPy.cpp @@ -759,17 +759,17 @@ Py::Object View3DInventorPy::saveVectorGraphic(const Py::Tuple& args) if (!PyArg_ParseTuple(args.ptr(), "s|is",&filename,&ps,&name)) throw Py::Exception(); - std::auto_ptr vo; + std::unique_ptr vo; Base::FileInfo fi(filename); if (fi.hasExtension("ps") || fi.hasExtension("eps")) { - vo = std::auto_ptr(new SoVectorizePSAction()); + vo = std::unique_ptr(new SoVectorizePSAction()); //vo->setGouraudThreshold(0.0f); } else if (fi.hasExtension("svg")) { - vo = std::auto_ptr(new SoFCVectorizeSVGAction()); + vo = std::unique_ptr(new SoFCVectorizeSVGAction()); } else if (fi.hasExtension("idtf")) { - vo = std::auto_ptr(new SoFCVectorizeU3DAction()); + vo = std::unique_ptr(new SoFCVectorizeU3DAction()); } else { throw Py::Exception("Not supported vector graphic"); @@ -2208,4 +2208,4 @@ Py::Object View3DInventorPy::getActiveObject(const Py::Tuple& args) return Py::None(); return Py::Object(obj->getPyObject()); -} \ No newline at end of file +} diff --git a/src/Mod/Fem/App/AppFemPy.cpp b/src/Mod/Fem/App/AppFemPy.cpp index b70accc039..1764428cf4 100644 --- a/src/Mod/Fem/App/AppFemPy.cpp +++ b/src/Mod/Fem/App/AppFemPy.cpp @@ -132,7 +132,7 @@ private: std::string EncodedName = std::string(Name); PyMem_Free(Name); - std::auto_ptr mesh(new FemMesh); + std::unique_ptr mesh(new FemMesh); mesh->read(EncodedName.c_str()); Base::FileInfo file(EncodedName.c_str()); // create new document and add Import feature @@ -168,7 +168,7 @@ private: Base::FileInfo file(EncodedName.c_str()); try { - std::auto_ptr mesh(new FemMesh); + std::unique_ptr mesh(new FemMesh); mesh->read(EncodedName.c_str()); FemMeshObject *pcFeature = static_cast @@ -232,7 +232,7 @@ private: std::string EncodedName = std::string(Name); PyMem_Free(Name); - std::auto_ptr mesh(new FemMesh); + std::unique_ptr mesh(new FemMesh); mesh->read(EncodedName.c_str()); return Py::asObject(new FemMeshPy(mesh.release())); } diff --git a/src/Mod/Mesh/App/AppMeshPy.cpp b/src/Mod/Mesh/App/AppMeshPy.cpp index 12ef3b1886..47c62c4116 100644 --- a/src/Mod/Mesh/App/AppMeshPy.cpp +++ b/src/Mod/Mesh/App/AppMeshPy.cpp @@ -156,7 +156,7 @@ private: std::string EncodedName = std::string(Name); PyMem_Free(Name); - std::auto_ptr mesh(new MeshObject); + std::unique_ptr mesh(new MeshObject); mesh->load(EncodedName.c_str()); return Py::asObject(new MeshPy(mesh.release())); } @@ -183,7 +183,7 @@ private: if (groupName.empty()) groupName = file.fileNamePure(); - std::auto_ptr segm(mesh.meshFromSegment(group.getIndices())); + std::unique_ptr segm(mesh.meshFromSegment(group.getIndices())); Mesh::Feature *pcFeature = static_cast (pcDoc->addObject("Mesh::Feature", groupName.c_str())); pcFeature->Label.setValue(groupName.c_str()); @@ -248,7 +248,7 @@ private: if (groupName.empty()) groupName = file.fileNamePure(); - std::auto_ptr segm(mesh.meshFromSegment(group.getIndices())); + std::unique_ptr segm(mesh.meshFromSegment(group.getIndices())); Mesh::Feature *pcFeature = static_cast (pcDoc->addObject("Mesh::Feature", groupName.c_str())); pcFeature->Label.setValue(groupName.c_str()); @@ -448,7 +448,7 @@ private: TriaList.push_back(MeshCore::MeshGeomFacet(Base::Vector3f(-hx, -hy, 0.0),Base::Vector3f(hx, hy, 0.0),Base::Vector3f(-hx, hy, 0.0))); TriaList.push_back(MeshCore::MeshGeomFacet(Base::Vector3f(-hx, -hy, 0.0),Base::Vector3f(hx, -hy, 0.0),Base::Vector3f(hx, hy, 0.0))); - std::auto_ptr mesh(new MeshObject); + std::unique_ptr mesh(new MeshObject); mesh->addFacets(TriaList); return Py::asObject(new MeshPy(mesh.release())); } diff --git a/src/Mod/Mesh/App/FeatureMeshDefects.cpp b/src/Mod/Mesh/App/FeatureMeshDefects.cpp index 3cea2f0316..f4d8e8e421 100644 --- a/src/Mod/Mesh/App/FeatureMeshDefects.cpp +++ b/src/Mod/Mesh/App/FeatureMeshDefects.cpp @@ -82,7 +82,7 @@ App::DocumentObjectExecReturn *HarmonizeNormals::execute(void) App::Property* prop = link->getPropertyByName("Mesh"); if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) { Mesh::PropertyMeshKernel* kernel = static_cast(prop); - std::auto_ptr mesh(new MeshObject); + std::unique_ptr mesh(new MeshObject); *mesh = kernel->getValue(); mesh->harmonizeNormals(); this->Mesh.setValuePtr(mesh.release()); @@ -110,7 +110,7 @@ App::DocumentObjectExecReturn *FlipNormals::execute(void) App::Property* prop = link->getPropertyByName("Mesh"); if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) { Mesh::PropertyMeshKernel* kernel = static_cast(prop); - std::auto_ptr mesh(new MeshObject); + std::unique_ptr mesh(new MeshObject); *mesh = kernel->getValue(); mesh->flipNormals(); this->Mesh.setValuePtr(mesh.release()); @@ -138,7 +138,7 @@ App::DocumentObjectExecReturn *FixNonManifolds::execute(void) App::Property* prop = link->getPropertyByName("Mesh"); if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) { Mesh::PropertyMeshKernel* kernel = static_cast(prop); - std::auto_ptr mesh(new MeshObject); + std::unique_ptr mesh(new MeshObject); *mesh = kernel->getValue(); mesh->removeNonManifolds(); this->Mesh.setValuePtr(mesh.release()); @@ -166,7 +166,7 @@ App::DocumentObjectExecReturn *FixDuplicatedFaces::execute(void) App::Property* prop = link->getPropertyByName("Mesh"); if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) { Mesh::PropertyMeshKernel* kernel = static_cast(prop); - std::auto_ptr mesh(new MeshObject); + std::unique_ptr mesh(new MeshObject); *mesh = kernel->getValue(); mesh->removeDuplicatedFacets(); this->Mesh.setValuePtr(mesh.release()); @@ -194,7 +194,7 @@ App::DocumentObjectExecReturn *FixDuplicatedPoints::execute(void) App::Property* prop = link->getPropertyByName("Mesh"); if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) { Mesh::PropertyMeshKernel* kernel = static_cast(prop); - std::auto_ptr mesh(new MeshObject); + std::unique_ptr mesh(new MeshObject); *mesh = kernel->getValue(); mesh->removeDuplicatedPoints(); this->Mesh.setValuePtr(mesh.release()); @@ -222,7 +222,7 @@ App::DocumentObjectExecReturn *FixDegenerations::execute(void) App::Property* prop = link->getPropertyByName("Mesh"); if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) { Mesh::PropertyMeshKernel* kernel = static_cast(prop); - std::auto_ptr mesh(new MeshObject); + std::unique_ptr mesh(new MeshObject); *mesh = kernel->getValue(); mesh->validateDegenerations(static_cast(Epsilon.getValue())); this->Mesh.setValuePtr(mesh.release()); @@ -251,7 +251,7 @@ App::DocumentObjectExecReturn *FixDeformations::execute(void) App::Property* prop = link->getPropertyByName("Mesh"); if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) { Mesh::PropertyMeshKernel* kernel = static_cast(prop); - std::auto_ptr mesh(new MeshObject); + std::unique_ptr mesh(new MeshObject); *mesh = kernel->getValue(); mesh->validateDeformations(static_cast(MaxAngle.getValue()), static_cast(Epsilon.getValue())); @@ -280,7 +280,7 @@ App::DocumentObjectExecReturn *FixIndices::execute(void) App::Property* prop = link->getPropertyByName("Mesh"); if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) { Mesh::PropertyMeshKernel* kernel = static_cast(prop); - std::auto_ptr mesh(new MeshObject); + std::unique_ptr mesh(new MeshObject); *mesh = kernel->getValue(); mesh->validateIndices(); this->Mesh.setValuePtr(mesh.release()); @@ -310,7 +310,7 @@ App::DocumentObjectExecReturn *FillHoles::execute(void) App::Property* prop = link->getPropertyByName("Mesh"); if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) { Mesh::PropertyMeshKernel* kernel = static_cast(prop); - std::auto_ptr mesh(new MeshObject); + std::unique_ptr mesh(new MeshObject); *mesh = kernel->getValue(); MeshCore::ConstraintDelaunayTriangulator cTria((float)MaxArea.getValue()); //MeshCore::Triangulator cTria(mesh->getKernel()); @@ -341,7 +341,7 @@ App::DocumentObjectExecReturn *RemoveComponents::execute(void) App::Property* prop = link->getPropertyByName("Mesh"); if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) { Mesh::PropertyMeshKernel* kernel = static_cast(prop); - std::auto_ptr mesh(new MeshObject); + std::unique_ptr mesh(new MeshObject); *mesh = kernel->getValue(); mesh->removeComponents(RemoveCompOfSize.getValue()); this->Mesh.setValuePtr(mesh.release()); diff --git a/src/Mod/Mesh/App/FeatureMeshImport.cpp b/src/Mod/Mesh/App/FeatureMeshImport.cpp index eccd59ec8b..a2c0b8e20e 100644 --- a/src/Mod/Mesh/App/FeatureMeshImport.cpp +++ b/src/Mod/Mesh/App/FeatureMeshImport.cpp @@ -53,7 +53,7 @@ short Mesh::Import::mustExecute(void) const App::DocumentObjectExecReturn *Mesh::Import::execute(void) { - std::auto_ptr apcKernel(new MeshObject()); + std::unique_ptr apcKernel(new MeshObject()); apcKernel->load(FileName.getValue()); Mesh.setValuePtr(apcKernel.release()); diff --git a/src/Mod/Mesh/App/FeatureMeshSegmentByMesh.cpp b/src/Mod/Mesh/App/FeatureMeshSegmentByMesh.cpp index 8e6912c294..81c6bf41ed 100644 --- a/src/Mod/Mesh/App/FeatureMeshSegmentByMesh.cpp +++ b/src/Mod/Mesh/App/FeatureMeshSegmentByMesh.cpp @@ -151,7 +151,7 @@ App::DocumentObjectExecReturn *SegmentByMesh::execute(void) for ( std::vector::iterator it = faces.begin(); it != faces.end(); ++it ) aFaces.push_back( rMeshKernel.GetFacet(*it) ); - std::auto_ptr pcKernel(new MeshObject); + std::unique_ptr pcKernel(new MeshObject); pcKernel->addFacets(aFaces); Mesh.setValuePtr(pcKernel.release()); diff --git a/src/Mod/Mesh/App/FeatureMeshSetOperations.cpp b/src/Mod/Mesh/App/FeatureMeshSetOperations.cpp index 4a5dac2f96..736d35d29c 100644 --- a/src/Mod/Mesh/App/FeatureMeshSetOperations.cpp +++ b/src/Mod/Mesh/App/FeatureMeshSetOperations.cpp @@ -76,7 +76,7 @@ App::DocumentObjectExecReturn *SetOperations::execute(void) const MeshObject& meshKernel1 = mesh1->Mesh.getValue(); const MeshObject& meshKernel2 = mesh2->Mesh.getValue(); - std::auto_ptr pcKernel(new MeshObject()); // Result Meshkernel + std::unique_ptr pcKernel(new MeshObject()); // Result Meshkernel MeshCore::SetOperations::OperationType type; string ot(OperationType.getValue()); diff --git a/src/Mod/Mesh/App/FeatureMeshSolid.cpp b/src/Mod/Mesh/App/FeatureMeshSolid.cpp index 0b409e01fe..3d320c3992 100644 --- a/src/Mod/Mesh/App/FeatureMeshSolid.cpp +++ b/src/Mod/Mesh/App/FeatureMeshSolid.cpp @@ -61,7 +61,7 @@ short Sphere::mustExecute() const App::DocumentObjectExecReturn *Sphere::execute(void) { - std::auto_ptr mesh(MeshObject::createSphere((float)Radius.getValue(),Sampling.getValue())); + std::unique_ptr mesh(MeshObject::createSphere((float)Radius.getValue(),Sampling.getValue())); if (mesh.get()) { mesh->setPlacement(this->Placement.getValue()); Mesh.setValue(mesh->getKernel()); @@ -97,7 +97,7 @@ short Ellipsoid::mustExecute() const App::DocumentObjectExecReturn *Ellipsoid::execute(void) { - std::auto_ptr mesh(MeshObject::createEllipsoid((float)Radius1.getValue(),(float)Radius2.getValue(),Sampling.getValue())); + std::unique_ptr mesh(MeshObject::createEllipsoid((float)Radius1.getValue(),(float)Radius2.getValue(),Sampling.getValue())); if (mesh.get()) { mesh->setPlacement(this->Placement.getValue()); Mesh.setValue(mesh->getKernel()); @@ -138,7 +138,7 @@ short Cylinder::mustExecute() const App::DocumentObjectExecReturn *Cylinder::execute(void) { - std::auto_ptr mesh(MeshObject::createCylinder((float)Radius.getValue(),(float)Length.getValue(), + std::unique_ptr mesh(MeshObject::createCylinder((float)Radius.getValue(),(float)Length.getValue(), Closed.getValue(),(float)EdgeLength.getValue(),Sampling.getValue())); if (mesh.get()) { mesh->setPlacement(this->Placement.getValue()); @@ -183,7 +183,7 @@ short Cone::mustExecute() const App::DocumentObjectExecReturn *Cone::execute(void) { - std::auto_ptr mesh(MeshObject::createCone((float)Radius1.getValue(),(float)Radius2.getValue(),(float)Length.getValue(), + std::unique_ptr mesh(MeshObject::createCone((float)Radius1.getValue(),(float)Radius2.getValue(),(float)Length.getValue(), Closed.getValue(),(float)EdgeLength.getValue(),Sampling.getValue())); if (mesh.get()) { mesh->setPlacement(this->Placement.getValue()); @@ -220,7 +220,7 @@ short Torus::mustExecute() const App::DocumentObjectExecReturn *Torus::execute(void) { - std::auto_ptr mesh(MeshObject::createTorus((float)Radius1.getValue(),(float)Radius2.getValue(),Sampling.getValue())); + std::unique_ptr mesh(MeshObject::createTorus((float)Radius1.getValue(),(float)Radius2.getValue(),Sampling.getValue())); if (mesh.get()) { mesh->setPlacement(this->Placement.getValue()); Mesh.setValue(mesh->getKernel()); @@ -256,7 +256,7 @@ short Cube::mustExecute() const App::DocumentObjectExecReturn *Cube::execute(void) { - std::auto_ptr mesh(MeshObject::createCube((float)Length.getValue(),(float)Width.getValue(),(float)Height.getValue())); + std::unique_ptr mesh(MeshObject::createCube((float)Length.getValue(),(float)Width.getValue(),(float)Height.getValue())); if (mesh.get()) { mesh->setPlacement(this->Placement.getValue()); Mesh.setValue(mesh->getKernel()); diff --git a/src/Mod/Mesh/App/Mesh.cpp b/src/Mod/Mesh/App/Mesh.cpp index 96cd5469e6..7b90bff419 100644 --- a/src/Mod/Mesh/App/Mesh.cpp +++ b/src/Mod/Mesh/App/Mesh.cpp @@ -1449,7 +1449,7 @@ MeshObject* MeshObject::createMeshFromList(Py::List& list) } Base::EmptySequencer seq; - std::auto_ptr mesh(new MeshObject); + std::unique_ptr mesh(new MeshObject); //mesh->addFacets(facets); mesh->getKernel() = facets; return mesh.release(); diff --git a/src/Mod/Mesh/App/MeshPyImp.cpp b/src/Mod/Mesh/App/MeshPyImp.cpp index af963e3dd9..8777c15538 100644 --- a/src/Mod/Mesh/App/MeshPyImp.cpp +++ b/src/Mod/Mesh/App/MeshPyImp.cpp @@ -245,7 +245,7 @@ PyObject* MeshPy::write(PyObject *args) format = ext[Ext]; } - std::auto_ptr mat; + std::unique_ptr mat; if (List) { mat.reset(new MeshCore::Material); Py::List list(List); @@ -1095,13 +1095,13 @@ PyObject* MeshPy::fillupHoles(PyObject *args) if (!PyArg_ParseTuple(args, "k|if", &len,&level,&max_area)) return NULL; try { - std::auto_ptr tria; + std::unique_ptr tria; if (max_area > 0.0f) { - tria = std::auto_ptr + tria = std::unique_ptr (new MeshCore::ConstraintDelaunayTriangulator(max_area)); } else { - tria = std::auto_ptr + tria = std::unique_ptr (new MeshCore::FlatTriangulator()); } diff --git a/src/Mod/MeshPart/Gui/Tessellation.h b/src/Mod/MeshPart/Gui/Tessellation.h index e28ae08cd4..c394fc3d31 100644 --- a/src/Mod/MeshPart/Gui/Tessellation.h +++ b/src/Mod/MeshPart/Gui/Tessellation.h @@ -58,7 +58,7 @@ private Q_SLOTS: private: QString document; QButtonGroup* buttonGroup; - std::auto_ptr ui; + std::unique_ptr ui; }; class TaskTessellation : public Gui::TaskView::TaskDialog diff --git a/src/Mod/Part/App/BSplineCurvePyImp.cpp b/src/Mod/Part/App/BSplineCurvePyImp.cpp index e578594eab..7bbde729b5 100644 --- a/src/Mod/Part/App/BSplineCurvePyImp.cpp +++ b/src/Mod/Part/App/BSplineCurvePyImp.cpp @@ -910,7 +910,7 @@ PyObject* BSplineCurvePy::interpolate(PyObject *args, PyObject *kwds) } } - std::auto_ptr aBSplineInterpolation; + std::unique_ptr aBSplineInterpolation; if (parameters.IsNull()) { aBSplineInterpolation.reset(new GeomAPI_Interpolate(interpolationPoints, PyObject_IsTrue(periodic) ? Standard_True : Standard_False, tol3d)); diff --git a/src/Mod/Part/App/FeaturePartBoolean.cpp b/src/Mod/Part/App/FeaturePartBoolean.cpp index cab2d1b32f..70cd415d0f 100644 --- a/src/Mod/Part/App/FeaturePartBoolean.cpp +++ b/src/Mod/Part/App/FeaturePartBoolean.cpp @@ -79,7 +79,7 @@ App::DocumentObjectExecReturn *Boolean::execute(void) if (ToolShape.IsNull()) throw Base::Exception("Tool shape is null"); - std::auto_ptr mkBool(makeOperation(BaseShape, ToolShape)); + std::unique_ptr mkBool(makeOperation(BaseShape, ToolShape)); if (!mkBool->IsDone()) { return new App::DocumentObjectExecReturn("Boolean operation failed"); } diff --git a/src/Mod/Part/App/ProgressIndicator.h b/src/Mod/Part/App/ProgressIndicator.h index 3486de3749..73214c0716 100644 --- a/src/Mod/Part/App/ProgressIndicator.h +++ b/src/Mod/Part/App/ProgressIndicator.h @@ -40,7 +40,7 @@ public: virtual Standard_Boolean UserBreak(); private: - std::auto_ptr myProgress; + std::unique_ptr myProgress; }; } diff --git a/src/Mod/Part/App/TopoShapePyImp.cpp b/src/Mod/Part/App/TopoShapePyImp.cpp index e6d0c7f9d0..0237ffd878 100644 --- a/src/Mod/Part/App/TopoShapePyImp.cpp +++ b/src/Mod/Part/App/TopoShapePyImp.cpp @@ -1825,19 +1825,19 @@ PyObject* TopoShapePy::getElement(PyObject *args) try { if (name.size() > 4 && name.substr(0,4) == "Face" && name[4]>=48 && name[4]<=57) { - std::auto_ptr s(static_cast + std::unique_ptr s(static_cast (getTopoShapePtr()->getSubElementByName(input))); TopoDS_Shape Shape = s->Shape; return new TopoShapeFacePy(new TopoShape(Shape)); } else if (name.size() > 4 && name.substr(0,4) == "Edge" && name[4]>=48 && name[4]<=57) { - std::auto_ptr s(static_cast + std::unique_ptr s(static_cast (getTopoShapePtr()->getSubElementByName(input))); TopoDS_Shape Shape = s->Shape; return new TopoShapeEdgePy(new TopoShape(Shape)); } else if (name.size() > 6 && name.substr(0,6) == "Vertex" && name[6]>=48 && name[6]<=57) { - std::auto_ptr s(static_cast + std::unique_ptr s(static_cast (getTopoShapePtr()->getSubElementByName(input))); TopoDS_Shape Shape = s->Shape; return new TopoShapeVertexPy(new TopoShape(Shape)); @@ -2388,19 +2388,19 @@ PyObject *TopoShapePy::getCustomAttributes(const char* attr) const std::string name(attr); try { if (name.size() > 4 && name.substr(0,4) == "Face" && name[4]>=48 && name[4]<=57) { - std::auto_ptr s(static_cast + std::unique_ptr s(static_cast (getTopoShapePtr()->getSubElementByName(attr))); TopoDS_Shape Shape = s->Shape; return new TopoShapeFacePy(new TopoShape(Shape)); } else if (name.size() > 4 && name.substr(0,4) == "Edge" && name[4]>=48 && name[4]<=57) { - std::auto_ptr s(static_cast + std::unique_ptr s(static_cast (getTopoShapePtr()->getSubElementByName(attr))); TopoDS_Shape Shape = s->Shape; return new TopoShapeEdgePy(new TopoShape(Shape)); } else if (name.size() > 6 && name.substr(0,6) == "Vertex" && name[6]>=48 && name[6]<=57) { - std::auto_ptr s(static_cast + std::unique_ptr s(static_cast (getTopoShapePtr()->getSubElementByName(attr))); TopoDS_Shape Shape = s->Shape; return new TopoShapeVertexPy(new TopoShape(Shape)); diff --git a/src/Mod/Part/Gui/DlgFilletEdges.h b/src/Mod/Part/Gui/DlgFilletEdges.h index f3afa03b24..65e25d3ff9 100644 --- a/src/Mod/Part/Gui/DlgFilletEdges.h +++ b/src/Mod/Part/Gui/DlgFilletEdges.h @@ -92,11 +92,11 @@ protected: virtual const char* getFilletType() const; private: - void onSelectionChanged(const Gui::SelectionChanges& msg); - void onDeleteObject(const App::DocumentObject&); - void onDeleteDocument(const App::Document&); - void onSelectEdge(const QString& subelement, int type); - void onSelectEdgesOfFace(const QString& subelement, int type); + void onSelectionChanged(const Gui::SelectionChanges& msg); + void onDeleteObject(const App::DocumentObject&); + void onDeleteDocument(const App::Document&); + void onSelectEdge(const QString& subelement, int type); + void onSelectEdgesOfFace(const QString& subelement, int type); private Q_SLOTS: void on_shapeObject_activated(int); @@ -111,9 +111,9 @@ private Q_SLOTS: void onHighlightEdges(); private: - std::auto_ptr ui; + std::unique_ptr ui; class Private; - std::auto_ptr d; + std::unique_ptr d; }; class FilletEdgesDialog : public QDialog diff --git a/src/Mod/Part/Gui/DlgSettings3DViewPartImp.h b/src/Mod/Part/Gui/DlgSettings3DViewPartImp.h index 3fc13c26d1..09b9896de1 100644 --- a/src/Mod/Part/Gui/DlgSettings3DViewPartImp.h +++ b/src/Mod/Part/Gui/DlgSettings3DViewPartImp.h @@ -51,7 +51,7 @@ private Q_SLOTS: void on_maxDeviation_valueChanged(double); private: - std::auto_ptr ui; + std::unique_ptr ui; bool checkValue; }; diff --git a/src/Mod/Points/App/AppPointsPy.cpp b/src/Mod/Points/App/AppPointsPy.cpp index af70468eb0..28ccdd89a2 100644 --- a/src/Mod/Points/App/AppPointsPy.cpp +++ b/src/Mod/Points/App/AppPointsPy.cpp @@ -88,7 +88,7 @@ private: if (file.extension().empty()) throw Py::RuntimeError("No file extension"); - std::auto_ptr reader; + std::unique_ptr reader; if (file.hasExtension("asc")) { reader.reset(new AscReader); } @@ -192,7 +192,7 @@ private: if (file.extension().empty()) throw Py::RuntimeError("No file extension"); - std::auto_ptr reader; + std::unique_ptr reader; if (file.hasExtension("asc")) { reader.reset(new AscReader); } @@ -309,7 +309,7 @@ private: Points::Feature* fea = static_cast(obj); const PointKernel& kernel = fea->Points.getValue(); - std::auto_ptr writer; + std::unique_ptr writer; if (file.hasExtension("asc")) { writer.reset(new AscWriter(kernel)); } diff --git a/src/Mod/Points/App/PointsPyImp.cpp b/src/Mod/Points/App/PointsPyImp.cpp index ca8857177e..4b22b6ffa1 100644 --- a/src/Mod/Points/App/PointsPyImp.cpp +++ b/src/Mod/Points/App/PointsPyImp.cpp @@ -52,12 +52,12 @@ int PointsPy::PyInit(PyObject* args, PyObject* /*kwd*/) { PyObject *pcObj=0; if (!PyArg_ParseTuple(args, "|O", &pcObj)) // convert args: Python->C - return -1; // NULL triggers exception - - // if no mesh is given + return -1; // NULL triggers exception + + // if no mesh is given if (!pcObj) return 0; if (PyObject_TypeCheck(pcObj, &(PointsPy::Type))) { - *getPointKernelPtr() = *(static_cast(pcObj)->getPointKernelPtr()); + *getPointKernelPtr() = *(static_cast(pcObj)->getPointKernelPtr()); } else if (PyList_Check(pcObj)) { if (!addPoints(args)) @@ -82,11 +82,11 @@ PyObject* PointsPy::copy(PyObject *args) { if (!PyArg_ParseTuple(args, "")) return NULL; - - PointKernel* kernel = new PointKernel(); - // assign data - *kernel = *getPointKernelPtr(); - return new PointsPy(kernel); + + PointKernel* kernel = new PointKernel(); + // assign data + *kernel = *getPointKernelPtr(); + return new PointsPy(kernel); } PyObject* PointsPy::read(PyObject * args) @@ -178,7 +178,7 @@ PyObject* PointsPy::fromSegment(PyObject * args) try { const PointKernel* points = getPointKernelPtr(); Py::Sequence list(obj); - std::auto_ptr pts(new PointKernel()); + std::unique_ptr pts(new PointKernel()); pts->reserve(list.size()); int numPoints = static_cast(points->size()); for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { @@ -202,7 +202,7 @@ PyObject* PointsPy::fromValid(PyObject * args) try { const PointKernel* points = getPointKernelPtr(); - std::auto_ptr pts(new PointKernel()); + std::unique_ptr pts(new PointKernel()); pts->reserve(points->size()); for (PointKernel::const_iterator it = points->begin(); it != points->end(); ++it) { if (!boost::math::isnan(it->x) && !boost::math::isnan(it->y) && !boost::math::isnan(it->z)) diff --git a/src/Mod/Robot/App/kdl_cp/path.cpp b/src/Mod/Robot/App/kdl_cp/path.cpp index 9b14b08139..78757b0df3 100644 --- a/src/Mod/Robot/App/kdl_cp/path.cpp +++ b/src/Mod/Robot/App/kdl_cp/path.cpp @@ -59,7 +59,7 @@ using namespace std; Path* Path::Read(istream& is) { - // auto_ptr because exception can be thrown ! + // unique_ptr because exception can be thrown ! IOTrace("Path::Read"); char storage[64]; EatWord(is,"[",storage,sizeof(storage)); @@ -78,7 +78,7 @@ Path* Path::Read(istream& is) { Frame endpos; is >> startpos; is >> endpos; - auto_ptr orient( RotationalInterpolation::Read(is) ); + unique_ptr orient( RotationalInterpolation::Read(is) ); double eqradius; is >> eqradius; EatEnd(is,']'); @@ -99,7 +99,7 @@ Path* Path::Read(istream& is) { is >> R_base_end; is >> alpha; alpha *= deg2rad; - auto_ptr orient( RotationalInterpolation::Read(is) ); + unique_ptr orient( RotationalInterpolation::Read(is) ); is >> eqradius; EatEnd(is,']'); IOTracePop(); @@ -119,8 +119,8 @@ Path* Path::Read(istream& is) { is >> radius; double eqradius; is >> eqradius; - auto_ptr orient( RotationalInterpolation::Read(is) ); - auto_ptr tr( + unique_ptr orient( RotationalInterpolation::Read(is) ); + unique_ptr tr( new Path_RoundedComposite(radius,eqradius,orient.release()) ); int size; @@ -139,7 +139,7 @@ Path* Path::Read(istream& is) { } else if (strcmp(storage,"COMPOSITE")==0) { IOTrace("COMPOSITE"); int size; - auto_ptr tr( new Path_Composite() ); + unique_ptr tr( new Path_Composite() ); is >> size; int i; for (i=0;i tr( Path::Read(is) ); + unique_ptr tr( Path::Read(is) ); is >> times; EatEnd(is,']'); IOTracePop(); diff --git a/src/Mod/Robot/App/kdl_cp/path_composite.cpp b/src/Mod/Robot/App/kdl_cp/path_composite.cpp index 6bae1de3e7..5435d88484 100644 --- a/src/Mod/Robot/App/kdl_cp/path_composite.cpp +++ b/src/Mod/Robot/App/kdl_cp/path_composite.cpp @@ -110,7 +110,7 @@ Twist Path_Composite::Acc(double s,double sd,double sdd) const { } Path* Path_Composite::Clone() { - std::auto_ptr comp( new Path_Composite() ); + std::unique_ptr comp( new Path_Composite() ); for (unsigned int i = 0; i < dv.size(); ++i) { comp->Add(gv[i].first->Clone(), gv[i].second); } diff --git a/src/Mod/Robot/App/kdl_cp/path_roundedcomposite.cpp b/src/Mod/Robot/App/kdl_cp/path_roundedcomposite.cpp index b79e1f9fd8..8f2bd04260 100644 --- a/src/Mod/Robot/App/kdl_cp/path_roundedcomposite.cpp +++ b/src/Mod/Robot/App/kdl_cp/path_roundedcomposite.cpp @@ -104,11 +104,11 @@ void Path_RoundedComposite::Add(const Frame& F_base_point) { if (d >= bcdist) throw Error_MotionPlanning_Not_Feasible(6); - std::auto_ptr < Path + std::unique_ptr < Path > line1( new Path_Line(F_base_start, F_base_via, orient->Clone(), eqradius)); - std::auto_ptr < Path + std::unique_ptr < Path > line2( new Path_Line(F_base_via, F_base_point, orient->Clone(), eqradius)); diff --git a/src/Mod/Robot/App/kdl_cp/rotational_interpolation.cpp b/src/Mod/Robot/App/kdl_cp/rotational_interpolation.cpp index f8186e67af..b046d6f0ce 100644 --- a/src/Mod/Robot/App/kdl_cp/rotational_interpolation.cpp +++ b/src/Mod/Robot/App/kdl_cp/rotational_interpolation.cpp @@ -51,7 +51,7 @@ namespace KDL { using namespace std; RotationalInterpolation* RotationalInterpolation::Read(istream& is) { - // auto_ptr because exception can be thrown ! + // unique_ptr because exception can be thrown ! IOTrace("RotationalInterpolation::Read"); char storage[64]; EatWord(is,"[",storage,sizeof(storage)); diff --git a/src/Mod/Robot/App/kdl_cp/trajectory.cpp b/src/Mod/Robot/App/kdl_cp/trajectory.cpp index 6a3e78639b..f78066f2ac 100644 --- a/src/Mod/Robot/App/kdl_cp/trajectory.cpp +++ b/src/Mod/Robot/App/kdl_cp/trajectory.cpp @@ -55,15 +55,15 @@ namespace KDL { using namespace std; Trajectory* Trajectory::Read(std::istream& is) { - // auto_ptr because exception can be thrown ! + // unique_ptr because exception can be thrown ! IOTrace("Trajectory::Read"); char storage[64]; EatWord(is,"[",storage,sizeof(storage)); Eat(is,'['); if (strcmp(storage,"SEGMENT")==0) { IOTrace("SEGMENT"); - auto_ptr geom( Path::Read(is) ); - auto_ptr motprof( VelocityProfile::Read(is) ); + unique_ptr geom( Path::Read(is) ); + unique_ptr motprof( VelocityProfile::Read(is) ); EatEnd(is,']'); IOTracePop(); IOTracePop(); diff --git a/src/Mod/Sandbox/App/DocumentProtectorPy.cpp b/src/Mod/Sandbox/App/DocumentProtectorPy.cpp index 319849fb31..a02b803a06 100644 --- a/src/Mod/Sandbox/App/DocumentProtectorPy.cpp +++ b/src/Mod/Sandbox/App/DocumentProtectorPy.cpp @@ -99,12 +99,12 @@ Py::Object DocumentProtectorPy::getattr(const char * attr) } else { Py::Object obj = Py::PythonExtension::getattr(attr); - if (PyCFunction_Check(obj.ptr())) { - PyCFunctionObject* op = reinterpret_cast(obj.ptr()); - if (!pycxx_handler) - pycxx_handler = op->m_ml->ml_meth; - op->m_ml->ml_meth = method_varargs_ext_handler; - } + if (PyCFunction_Check(obj.ptr())) { + PyCFunctionObject* op = reinterpret_cast(obj.ptr()); + if (!pycxx_handler) + pycxx_handler = op->m_ml->ml_meth; + op->m_ml->ml_meth = method_varargs_ext_handler; + } return obj; } } @@ -239,7 +239,7 @@ int DocumentObjectProtectorPy::setattr(const char * attr, const Py::Object & val throw Py::AttributeError(s_out.str()); } Base::PyGILStateRelease unlock; - std::auto_ptr copy(static_cast + std::unique_ptr copy(static_cast (prop->getTypeId().createInstance())); if (PyObject_TypeCheck(value.ptr(), DocumentObjectProtectorPy::type_object())) { copy->setPyObject(static_cast(value.ptr())->getObject().ptr()); diff --git a/src/Mod/Sandbox/Gui/GLGraphicsView.cpp b/src/Mod/Sandbox/Gui/GLGraphicsView.cpp index 3dd3a2efce..eeef4244af 100644 --- a/src/Mod/Sandbox/Gui/GLGraphicsView.cpp +++ b/src/Mod/Sandbox/Gui/GLGraphicsView.cpp @@ -216,7 +216,7 @@ bool SceneEventFilter::eventFilter(QObject * obj, QEvent * qevent) { // Convert the scene event back to a standard event - std::auto_ptr sceneev; + std::unique_ptr sceneev; switch (qevent->type()) { //GraphicsSceneContextMenu = 159, //GraphicsSceneHoverEnter = 160, diff --git a/src/Mod/Sketcher/Gui/TaskSketcherValidation.h b/src/Mod/Sketcher/Gui/TaskSketcherValidation.h index 887e7b39e1..1fbd1f0cd0 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherValidation.h +++ b/src/Mod/Sketcher/Gui/TaskSketcherValidation.h @@ -63,7 +63,7 @@ private: void hidePoints(); private: - std::auto_ptr ui; + std::unique_ptr ui; Sketcher::SketchObject* sketch; SoGroup* coincidenceRoot; diff --git a/src/Mod/Spreadsheet/Gui/Command.cpp b/src/Mod/Spreadsheet/Gui/Command.cpp index 14cc3c9bcf..655c1a46ed 100644 --- a/src/Mod/Spreadsheet/Gui/Command.cpp +++ b/src/Mod/Spreadsheet/Gui/Command.cpp @@ -801,7 +801,7 @@ void CmdSpreadsheetSetAlias::activated(int iMsg) range.push_back(Range(selection[0].row(), selection[0].column(), selection[0].row(), selection[0].column())); - std::auto_ptr dialog(new PropertiesDialog(sheet, range, sheetView)); + std::unique_ptr dialog(new PropertiesDialog(sheet, range, sheetView)); dialog->selectAlias(); diff --git a/src/Mod/Spreadsheet/Gui/PropertiesDialog.cpp b/src/Mod/Spreadsheet/Gui/PropertiesDialog.cpp index 24146a7e7c..f14812bef6 100644 --- a/src/Mod/Spreadsheet/Gui/PropertiesDialog.cpp +++ b/src/Mod/Spreadsheet/Gui/PropertiesDialog.cpp @@ -184,7 +184,7 @@ void PropertiesDialog::displayUnitChanged(const QString & text) QPalette palette = ui->displayUnit->palette(); try { - std::auto_ptr e(App::ExpressionParser::parseUnit(sheet, text.toUtf8().constData())); + std::unique_ptr e(App::ExpressionParser::parseUnit(sheet, text.toUtf8().constData())); displayUnit = DisplayUnit(text.toUtf8().constData(), e->getUnit(), e->getScaler()); palette.setColor(QPalette::Text, Qt::black); diff --git a/src/Mod/Spreadsheet/Gui/SheetTableView.cpp b/src/Mod/Spreadsheet/Gui/SheetTableView.cpp index 9361a212e3..ef80ca1970 100644 --- a/src/Mod/Spreadsheet/Gui/SheetTableView.cpp +++ b/src/Mod/Spreadsheet/Gui/SheetTableView.cpp @@ -80,7 +80,7 @@ SheetTableView::SheetTableView(QWidget *parent) void SheetTableView::cellProperties() { - std::auto_ptr dialog(new PropertiesDialog(sheet, selectedRanges(), this)); + std::unique_ptr dialog(new PropertiesDialog(sheet, selectedRanges(), this)); if (dialog->exec() == QDialog::Accepted) { dialog->apply(); diff --git a/src/Mod/Spreadsheet/Gui/Workbench.h b/src/Mod/Spreadsheet/Gui/Workbench.h index 53c03a8fe0..25c00d9443 100644 --- a/src/Mod/Spreadsheet/Gui/Workbench.h +++ b/src/Mod/Spreadsheet/Gui/Workbench.h @@ -55,7 +55,7 @@ public: private: bool initialized; - std::auto_ptr workbenchHelper; + std::unique_ptr workbenchHelper; protected: Gui::MenuItem *setupMenuBar() const;