diff --git a/src/App/Expression.cpp b/src/App/Expression.cpp index 18f9aba6c0..de135ccf61 100644 --- a/src/App/Expression.cpp +++ b/src/App/Expression.cpp @@ -2051,7 +2051,6 @@ Py::Object FunctionExpression::evaluate(const Expression *expr, int f, const std if (f == MINVERT) { Py::Object pyobj = args[0]->getPyValue(); - Py::Tuple args; if (PyObject_TypeCheck(pyobj.ptr(),&Base::MatrixPy::Type)) { auto m = static_cast(pyobj.ptr())->value(); if (fabs(m.determinant()) <= DBL_EPSILON) diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index ece948599e..a59f668f3d 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -1354,9 +1354,9 @@ bool Application::activateWorkbench(const char* name) Workbench* newWb = WorkbenchManager::instance()->active(); if (newWb) { if (!Instance->d->startingUp) { - std::string name = newWb->name(); + std::string nameWb = newWb->name(); App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/General")-> - SetASCII("LastModule", name.c_str()); + SetASCII("LastModule", nameWb.c_str()); } newWb->activated(); } diff --git a/src/Gui/ApplicationPy.cpp b/src/Gui/ApplicationPy.cpp index 9d6494f78b..dd80a3ede9 100644 --- a/src/Gui/ApplicationPy.cpp +++ b/src/Gui/ApplicationPy.cpp @@ -920,9 +920,9 @@ PyObject* Application::sAddWorkbenchHandler(PyObject * /*self*/, PyObject *args) if (PyObject_IsSubclass(object.ptr(), baseclass.ptr()) == 1) { // create an instance of this class name = object.getAttr(std::string("__name__")); - Py::Tuple args; + Py::Tuple arg; Py::Callable creation(object); - object = creation.apply(args); + object = creation.apply(arg); } else if (PyObject_IsInstance(object.ptr(), baseclass.ptr()) == 1) { // extract the class name of the instance diff --git a/src/Gui/DlgCommandsImp.cpp b/src/Gui/DlgCommandsImp.cpp index d1657159a8..2b43fd235b 100644 --- a/src/Gui/DlgCommandsImp.cpp +++ b/src/Gui/DlgCommandsImp.cpp @@ -142,12 +142,12 @@ void DlgCustomCommandsImp::onDescription(QTreeWidgetItem *item) } /** Shows all commands of this category */ -void DlgCustomCommandsImp::onGroupActivated(QTreeWidgetItem* item) +void DlgCustomCommandsImp::onGroupActivated(QTreeWidgetItem* groupItem) { - if (!item) + if (!groupItem) return; - QVariant data = item->data(0, Qt::UserRole); + QVariant data = groupItem->data(0, Qt::UserRole); QString group = data.toString(); ui->commandTreeWidget->clear(); diff --git a/src/Gui/DlgParameterImp.cpp b/src/Gui/DlgParameterImp.cpp index 02deea24ac..6054c4f397 100644 --- a/src/Gui/DlgParameterImp.cpp +++ b/src/Gui/DlgParameterImp.cpp @@ -371,9 +371,9 @@ void DlgParameterImp::activateParameterSet(const char* config) } /** Switches the type of parameters either to user or system parameters. */ -void DlgParameterImp::onChangeParameterSet(int index) +void DlgParameterImp::onChangeParameterSet(int itemPos) { - ParameterManager* rcParMngr = App::GetApplication().GetParameterSet(ui->parameterSet->itemData(index).toByteArray()); + ParameterManager* rcParMngr = App::GetApplication().GetParameterSet(ui->parameterSet->itemData(itemPos).toByteArray()); if (!rcParMngr) return; diff --git a/src/Gui/Document.cpp b/src/Gui/Document.cpp index 2ba663249b..e53cae5d24 100644 --- a/src/Gui/Document.cpp +++ b/src/Gui/Document.cpp @@ -1475,15 +1475,15 @@ void Document::exportObjects(const std::vector& obj, Base: std::map::const_iterator jt; for (jt = views.begin(); jt != views.end(); ++jt) { const App::DocumentObject* doc = jt->first; - ViewProvider* obj = jt->second; + ViewProvider* vp = jt->second; writer.Stream() << writer.ind() << "getExportName() << "\" " << "expanded=\"" << (doc->testStatus(App::Expand) ? 1:0) << "\""; - if (obj->hasExtensions()) + if (vp->hasExtensions()) writer.Stream() << " Extensions=\"True\""; writer.Stream() << ">" << std::endl; - obj->Save(writer); + vp->Save(writer); writer.Stream() << writer.ind() << "" << std::endl; } writer.setForceXML(xml); diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index 9bcf44b1b5..3b71b43e3d 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -1802,10 +1802,10 @@ void MainWindow::unsetUrlHandler(const QString &scheme) d->urlHandler.remove(scheme); } -void MainWindow::loadUrls(App::Document* doc, const QList& url) +void MainWindow::loadUrls(App::Document* doc, const QList& urls) { QStringList files; - for (QList::ConstIterator it = url.begin(); it != url.end(); ++it) { + for (QList::ConstIterator it = urls.begin(); it != urls.end(); ++it) { QMap >::iterator jt = d->urlHandler.find(it->scheme()); if (jt != d->urlHandler.end() && !jt->isNull()) { // delegate the loading to the url handler diff --git a/src/Gui/Selection.cpp b/src/Gui/Selection.cpp index 39f28021b6..fc6ef0bc46 100644 --- a/src/Gui/Selection.cpp +++ b/src/Gui/Selection.cpp @@ -1444,27 +1444,30 @@ void SelectionSingleton::setVisible(VisibleState vis) { App::DocumentObject *parent = 0; std::string elementName; obj = obj->resolve(sel.SubName.c_str(),&parent,&elementName); - if(!obj || !obj->getNameInDocument() || (parent && !parent->getNameInDocument())) + if (!obj || !obj->getNameInDocument() || (parent && !parent->getNameInDocument())) continue; // try call parent object's setElementVisible - if(parent) { + if (parent) { // prevent setting the same object visibility more than once - if(!filter.insert(std::make_pair(obj,parent)).second) + if (!filter.insert(std::make_pair(obj,parent)).second) continue; - int vis = parent->isElementVisible(elementName.c_str()); - if(vis>=0) { - if(vis>0) vis = 1; - if(visible>=0) { - if(vis == visible) + int visElement = parent->isElementVisible(elementName.c_str()); + if (visElement >= 0) { + if (visElement > 0) + visElement = 1; + if (visible >= 0) { + if (visElement == visible) continue; - vis = visible; - }else - vis = !vis; + visElement = visible; + } + else { + visElement = !visElement; + } - if(!vis) + if (!visElement) updateSelection(false,sel.DocName.c_str(),sel.FeatName.c_str(), sel.SubName.c_str()); - parent->setElementVisible(elementName.c_str(),vis?true:false); - if(vis) + parent->setElementVisible(elementName.c_str(), visElement ? true : false); + if (visElement) updateSelection(true,sel.DocName.c_str(),sel.FeatName.c_str(), sel.SubName.c_str()); continue; } @@ -1478,17 +1481,17 @@ void SelectionSingleton::setVisible(VisibleState vis) { auto vp = Application::Instance->getViewProvider(obj); if(vp) { - int vis; + bool visObject; if(visible>=0) - vis = visible; + visObject = visible ? true : false; else - vis = !vp->isShow(); + visObject = !vp->isShow(); - if(vis) { + if(visObject) { vp->show(); - updateSelection(vis,sel.DocName.c_str(),sel.FeatName.c_str(), sel.SubName.c_str()); + updateSelection(visObject,sel.DocName.c_str(),sel.FeatName.c_str(), sel.SubName.c_str()); } else { - updateSelection(vis,sel.DocName.c_str(),sel.FeatName.c_str(), sel.SubName.c_str()); + updateSelection(visObject,sel.DocName.c_str(),sel.FeatName.c_str(), sel.SubName.c_str()); vp->hide(); } } diff --git a/src/Gui/SoFCColorBar.cpp b/src/Gui/SoFCColorBar.cpp index e367cdcb5e..eabe799bf9 100644 --- a/src/Gui/SoFCColorBar.cpp +++ b/src/Gui/SoFCColorBar.cpp @@ -280,15 +280,15 @@ void SoFCColorBar::handleEvent (SoHandleEventAction *action) menu.addSeparator(); QAction* option = menu.addAction(QObject::tr("Options...")); - QAction* action = menu.exec(QCursor::pos()); + QAction* select = menu.exec(QCursor::pos()); - if (action == option) { + if (select == option) { QApplication::postEvent( new SoFCColorBarProxyObject(this), new QEvent(QEvent::User)); } - else if (action) { - int id = action->data().toInt(); + else if (select) { + int id = select->data().toInt(); pColorMode->whichChild = id; } } diff --git a/src/Gui/SoFCUnifiedSelection.cpp b/src/Gui/SoFCUnifiedSelection.cpp index 86edb0a44b..dce9ac1fac 100644 --- a/src/Gui/SoFCUnifiedSelection.cpp +++ b/src/Gui/SoFCUnifiedSelection.cpp @@ -345,36 +345,41 @@ void SoFCUnifiedSelection::doAction(SoAction *action) // Do not clear currently highlighted object when setting new pre-selection if (!setPreSelection && hilaction->SelChange.Type == SelectionChanges::RmvPreselect) { if (currenthighlight) { - SoHighlightElementAction action; - action.apply(currenthighlight); + SoHighlightElementAction hlAction; + hlAction.apply(currenthighlight); currenthighlight->unref(); currenthighlight = 0; } - } else if (highlightMode.getValue() != OFF + } + else if (highlightMode.getValue() != OFF && hilaction->SelChange.Type == SelectionChanges::SetPreselect) { if (currenthighlight) { - SoHighlightElementAction action; - action.apply(currenthighlight); + SoHighlightElementAction hlAction; + hlAction.apply(currenthighlight); currenthighlight->unref(); currenthighlight = 0; } + App::Document* doc = App::GetApplication().getDocument(hilaction->SelChange.pDocName); App::DocumentObject* obj = doc->getObject(hilaction->SelChange.pObjectName); ViewProvider*vp = Application::Instance->getViewProvider(obj); SoDetail* detail = vp->getDetail(hilaction->SelChange.pSubName); - SoHighlightElementAction action; - action.setHighlighted(true); - action.setColor(this->colorHighlight.getValue()); - action.setElement(detail); - action.apply(vp->getRoot()); + + SoHighlightElementAction hlAction; + hlAction.setHighlighted(true); + hlAction.setColor(this->colorHighlight.getValue()); + hlAction.setElement(detail); + hlAction.apply(vp->getRoot()); delete detail; + SoSearchAction sa; sa.setNode(vp->getRoot()); sa.apply(vp->getRoot()); currenthighlight = static_cast(sa.getPath()->copy()); currenthighlight->ref(); } - if(useNewSelection.getValue()) + + if (useNewSelection.getValue()) return; } @@ -408,22 +413,24 @@ void SoFCUnifiedSelection::doAction(SoAction *action) type = SoSelectionElementAction::None; } - SoSelectionElementAction action(type); - action.setColor(this->colorSelection.getValue()); - action.setElement(detail); + SoSelectionElementAction selectionAction(type); + selectionAction.setColor(this->colorSelection.getValue()); + selectionAction.setElement(detail); if(detailPath->getLength()) - action.apply(detailPath); + selectionAction.apply(detailPath); else - action.apply(vp->getRoot()); + selectionAction.apply(vp->getRoot()); } detailPath->truncate(0); delete detail; } - }else if (selaction->SelChange.Type == SelectionChanges::ClrSelection) { - SoSelectionElementAction action(SoSelectionElementAction::None); + } + else if (selaction->SelChange.Type == SelectionChanges::ClrSelection) { + SoSelectionElementAction selectionAction(SoSelectionElementAction::None); for(int i=0;igetNumChildren();++i) - action.apply(this->getChild(i)); - }else if(selectionMode.getValue() == ON + selectionAction.apply(this->getChild(i)); + } + else if(selectionMode.getValue() == ON && selaction->SelChange.Type == SelectionChanges::SetSelection) { std::vector vps; if (this->pcDocument) @@ -436,12 +443,14 @@ void SoFCUnifiedSelection::doAction(SoAction *action) type = SoSelectionElementAction::All; else type = SoSelectionElementAction::None; - SoSelectionElementAction action(type); - action.setColor(this->colorSelection.getValue()); - action.apply(vpd->getRoot()); + + SoSelectionElementAction selectionAction(type); + selectionAction.setColor(this->colorSelection.getValue()); + selectionAction.apply(vpd->getRoot()); } } - } else if (selaction->SelChange.Type == SelectionChanges::SetPreselectSignal) { + } + else if (selaction->SelChange.Type == SelectionChanges::SetPreselectSignal) { // selection changes inside the 3d view are handled in handleEvent() App::Document* doc = App::GetApplication().getDocument(selaction->SelChange.pDocName); App::DocumentObject* obj = doc->getObject(selaction->SelChange.pObjectName); @@ -461,7 +470,8 @@ void SoFCUnifiedSelection::doAction(SoAction *action) delete det; } } - if(useNewSelection.getValue()) + + if (useNewSelection.getValue()) return; } diff --git a/src/Gui/propertyeditor/PropertyItem.cpp b/src/Gui/propertyeditor/PropertyItem.cpp index 8c793c1e21..2fb5be2061 100644 --- a/src/Gui/propertyeditor/PropertyItem.cpp +++ b/src/Gui/propertyeditor/PropertyItem.cpp @@ -2094,8 +2094,8 @@ void PlacementEditor::updateValue(const QVariant& v, bool incr, bool data) QVariant u = value(); const Base::Placement& plm = u.value(); const Base::Placement& rel = v.value(); - Base::Placement data = rel * plm; - setValue(QVariant::fromValue(data)); + Base::Placement newp = rel * plm; + setValue(QVariant::fromValue(newp)); } else { setValue(v); diff --git a/src/Mod/Drawing/App/DrawingExport.cpp b/src/Mod/Drawing/App/DrawingExport.cpp index 550b12c25b..b87891ed50 100644 --- a/src/Mod/Drawing/App/DrawingExport.cpp +++ b/src/Mod/Drawing/App/DrawingExport.cpp @@ -423,10 +423,10 @@ void SVGOutput::printBSpline(const BRepAdaptor_Curve& c, int id, std::ostream& o } } -void SVGOutput::printGeneric(const BRepAdaptor_Curve& c, int id, std::ostream& out) +void SVGOutput::printGeneric(const BRepAdaptor_Curve& bac, int id, std::ostream& out) { TopLoc_Location location; - Handle(Poly_Polygon3D) polygon = BRep_Tool::Polygon3D(c.Edge(), location); + Handle(Poly_Polygon3D) polygon = BRep_Tool::Polygon3D(bac.Edge(), location); if (!polygon.IsNull()) { const TColgp_Array1OfPnt& nodes = polygon->Nodes(); char c = 'M'; @@ -436,13 +436,13 @@ void SVGOutput::printGeneric(const BRepAdaptor_Curve& c, int id, std::ostream& o c = 'L'; } out << "\" />" << endl; - } else if (c.GetType() == GeomAbs_Line) { + } else if (bac.GetType() == GeomAbs_Line) { //BRep_Tool::Polygon3D assumes the edge has polygon representation - ie already been "tessellated" //this is not true for all edges, especially "floating edges" - double f = c.FirstParameter(); - double l = c.LastParameter(); - gp_Pnt s = c.Value(f); - gp_Pnt e = c.Value(l); + double f = bac.FirstParameter(); + double l = bac.LastParameter(); + gp_Pnt s = bac.Value(f); + gp_Pnt e = bac.Value(l); char c = 'M'; out << "Get(); char* str = new char[extstr.LengthOfCString()+1]; extstr.ToUTF8CString(str); - std::string label(str); - if (!label.empty()) - myNameMap[aShape.HashCode(INT_MAX)] = label; + std::string labelName(str); + if (!labelName.empty()) + myNameMap[aShape.HashCode(INT_MAX)] = labelName; delete [] str; } diff --git a/src/Mod/Import/App/ImportOCAF2.cpp b/src/Mod/Import/App/ImportOCAF2.cpp index f5428ad38b..4de3b10adb 100644 --- a/src/Mod/Import/App/ImportOCAF2.cpp +++ b/src/Mod/Import/App/ImportOCAF2.cpp @@ -772,18 +772,19 @@ bool ImportOCAF2::createAssembly(App::Document *_doc, continue; } - auto &info = childrenMap[obj]; - if(info.plas.empty()) { + auto &childInfo = childrenMap[obj]; + if (childInfo.plas.empty()) { children.push_back(obj); visibilities.push_back(vis); - info.shape = childShape; + childInfo.shape = childShape; } - info.vis.push_back(vis); - info.labels.push_back(childLabel); - info.plas.emplace_back(Part::TopoShape::convert(childShape.Location().Transformation())); + + childInfo.vis.push_back(vis); + childInfo.labels.push_back(childLabel); + childInfo.plas.emplace_back(Part::TopoShape::convert(childShape.Location().Transformation())); Quantity_Color aColor; if (aColorTool->GetColor(childShape, XCAFDoc_ColorSurf, aColor)) { - auto &color = info.colors[info.plas.size()-1]; + auto &color = childInfo.colors[childInfo.plas.size()-1]; color.r = (float)aColor.Red(); color.g = (float)aColor.Green(); color.b = (float)aColor.Blue(); @@ -801,10 +802,10 @@ bool ImportOCAF2::createAssembly(App::Document *_doc, int i=-1; for(auto &child : children) { ++i; - auto &info = childrenMap[child]; - if(info.plas.size()==1) { - child = loadShape(doc,info.labels.front(),info.shape); - getSHUOColors(info.labels.front(),shuoColors,true); + auto &childInfo = childrenMap[child]; + if (childInfo.plas.size() == 1) { + child = loadShape(doc, childInfo.labels.front(), childInfo.shape); + getSHUOColors(childInfo.labels.front(), shuoColors, true); continue; } @@ -815,24 +816,24 @@ bool ImportOCAF2::createAssembly(App::Document *_doc, // link->Visibility.setValue(false); link->setLink(-1,child); link->ShowElement.setValue(false); - link->ElementCount.setValue(info.plas.size()); + link->ElementCount.setValue(childInfo.plas.size()); auto it = myCollapsedObjects.find(child); if(it!=myCollapsedObjects.end()) { // child is a single component assembly that has been // collapsed, so we have to honour its placement - for(auto &pla : info.plas) + for(auto &pla : childInfo.plas) pla *= it->second->getValue(); } - link->PlacementList.setValue(info.plas); - link->VisibilityList.setValue(info.vis); + link->PlacementList.setValue(childInfo.plas); + link->VisibilityList.setValue(childInfo.vis); - for(auto &v : info.colors) + for(auto &v : childInfo.colors) applyLinkColor(link,v.first,v.second); int i=0; std::string name = link->getNameInDocument(); name += '.'; - for(auto childLabel : info.labels) { + for(auto childLabel : childInfo.labels) { myNames.emplace(childLabel,name + std::to_string(i++)); getSHUOColors(childLabel,shuoColors,true); } @@ -840,7 +841,7 @@ bool ImportOCAF2::createAssembly(App::Document *_doc, child = link; Info objInfo; objInfo.obj = child; - setObjectName(objInfo,info.labels.front()); + setObjectName(objInfo, childInfo.labels.front()); } } @@ -1244,22 +1245,22 @@ TDF_Label ExportOCAF2::exportObject(App::DocumentObject* parentObj, auto linkArray = obj->getLinkedObject(true)->getExtensionByType(true); if(linkArray && (linkArray->getShowElementValue() || !linkArray->getElementCountValue())) linkArray = 0; - for(auto &sub : subs) { - App::DocumentObject *parent = 0; + for(auto &subobj : subs) { + App::DocumentObject *parentGrp = 0; std::string childName; - auto sobj = obj->resolve(sub.c_str(),&parent,&childName); + auto sobj = obj->resolve(subobj.c_str(),&parentGrp,&childName); if(!sobj) { - FC_WARN("Cannot find object " << obj->getFullName() << '.' << sub); + FC_WARN("Cannot find object " << obj->getFullName() << '.' << subobj); continue; } int vis = -1; - if(parent) { + if(parentGrp) { if(groupLinks.size() - && parent->getExtensionByType(true,false)) + && parentGrp->getExtensionByType(true,false)) { vis = groupLinks.back()->isElementVisible(childName.c_str()); }else - vis = parent->isElementVisible(childName.c_str()); + vis = parentGrp->isElementVisible(childName.c_str()); } if(vis < 0) @@ -1268,7 +1269,7 @@ TDF_Label ExportOCAF2::exportObject(App::DocumentObject* parentObj, if(!vis && !exportHidden) continue; - TDF_Label childLabel = exportObject(obj,sub.c_str(),label,linkArray?childName.c_str():0); + TDF_Label childLabel = exportObject(obj,subobj.c_str(),label,linkArray?childName.c_str():0); if(childLabel.IsNull()) continue; @@ -1299,7 +1300,7 @@ TDF_Label ExportOCAF2::exportObject(App::DocumentObject* parentObj, } } - if(groupLinks.size() && groupLinks.back()==obj) + if (groupLinks.size() && groupLinks.back()==obj) groupLinks.pop_back(); // Finished adding components. Now retrieve the computed non-located shape diff --git a/src/Mod/Inspection/Gui/ViewProviderInspection.cpp b/src/Mod/Inspection/Gui/ViewProviderInspection.cpp index e7cd7dd3dd..f04cc0c6fe 100644 --- a/src/Mod/Inspection/Gui/ViewProviderInspection.cpp +++ b/src/Mod/Inspection/Gui/ViewProviderInspection.cpp @@ -202,16 +202,16 @@ void ViewProviderInspection::updateData(const App::Property* prop) // set the Distance property to the correct size to sync size of material node with number // of vertices/points of the referenced geometry if (object->getTypeId().isDerivedFrom(meshId)) { - App::Property* prop = object->getPropertyByName("Mesh"); - if (prop && prop->getTypeId().isDerivedFrom(propId)) { - const Data::ComplexGeoData* data = static_cast(prop)->getComplexData(); + App::Property* propM = object->getPropertyByName("Mesh"); + if (propM && propM->getTypeId().isDerivedFrom(propId)) { + const Data::ComplexGeoData* data = static_cast(propM)->getComplexData(); data->getFaces(points, faces, accuracy); } } else if (object->getTypeId().isDerivedFrom(shapeId)) { - App::Property* prop = object->getPropertyByName("Shape"); - if (prop && prop->getTypeId().isDerivedFrom(propId)) { - const Data::ComplexGeoData* data = static_cast(prop)->getComplexData(); + App::Property* propS = object->getPropertyByName("Shape"); + if (propS && propS->getTypeId().isDerivedFrom(propId)) { + const Data::ComplexGeoData* data = static_cast(propS)->getComplexData(); ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath ("User parameter:BaseApp/Preferences/Mod/Part"); float deviation = hGrp->GetFloat("MeshDeviation",0.2); @@ -222,9 +222,9 @@ void ViewProviderInspection::updateData(const App::Property* prop) } } else if (object->getTypeId().isDerivedFrom(pointId)) { - App::Property* prop = object->getPropertyByName("Points"); - if (prop && prop->getTypeId().isDerivedFrom(propId)) { - const Data::ComplexGeoData* data = static_cast(prop)->getComplexData(); + App::Property* propP = object->getPropertyByName("Points"); + if (propP && propP->getTypeId().isDerivedFrom(propId)) { + const Data::ComplexGeoData* data = static_cast(propP)->getComplexData(); std::vector normals; data->getPoints(points, normals, accuracy); } diff --git a/src/Mod/Mesh/App/Core/Approximation.cpp b/src/Mod/Mesh/App/Core/Approximation.cpp index a115792c2d..19fe054100 100644 --- a/src/Mod/Mesh/App/Core/Approximation.cpp +++ b/src/Mod/Mesh/App/Core/Approximation.cpp @@ -938,20 +938,20 @@ struct LMCylinderFunctor Eigen::MatrixXd measuredValues; // Compute 'm' errors, one for each data point, for the given parameter values in 'x' - int operator()(const Eigen::VectorXd &x, Eigen::VectorXd &fvec) const + int operator()(const Eigen::VectorXd &xvec, Eigen::VectorXd &fvec) const { - // 'x' has dimensions n x 1 + // 'xvec' has dimensions n x 1 // It contains the current estimates for the parameters. // 'fvec' has dimensions m x 1 // It will contain the error for each data point. - double aParam = x(0); // dir_x - double bParam = x(1); // dir_y - double cParam = x(2); // dir_z - double dParam = x(3); // cnt_x - double eParam = x(4); // cnt_y - double fParam = x(5); // cnt_z - double gParam = x(6); // radius + double aParam = xvec(0); // dir_x + double bParam = xvec(1); // dir_y + double cParam = xvec(2); // dir_z + double dParam = xvec(3); // cnt_x + double eParam = xvec(4); // cnt_y + double fParam = xvec(5); // cnt_z + double gParam = xvec(6); // radius // use distance functions (fvec(i)) for cylinders as defined in the paper: // Least-Squares Fitting Algorithms of the NIST Algorithm Testing System diff --git a/src/Mod/MeshPart/Gui/CurveOnMesh.cpp b/src/Mod/MeshPart/Gui/CurveOnMesh.cpp index 6ab95007ae..833f8fd06f 100644 --- a/src/Mod/MeshPart/Gui/CurveOnMesh.cpp +++ b/src/Mod/MeshPart/Gui/CurveOnMesh.cpp @@ -586,17 +586,17 @@ void CurveOnMeshHandler::closeWire() } } -void CurveOnMeshHandler::Private::vertexCallback(void * ud, SoEventCallback * n) +void CurveOnMeshHandler::Private::vertexCallback(void * ud, SoEventCallback * cb) { - Gui::View3DInventorViewer* view = reinterpret_cast(n->getUserData()); - const SoEvent* ev = n->getEvent(); + Gui::View3DInventorViewer* view = reinterpret_cast(cb->getUserData()); + const SoEvent* ev = cb->getEvent(); if (ev->getTypeId() == SoMouseButtonEvent::getClassTypeId()) { // set as handled - n->setHandled(); + cb->setHandled(); const SoMouseButtonEvent * mbe = static_cast(ev); if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN) { - const SoPickedPoint * pp = n->getPickedPoint(); + const SoPickedPoint * pp = cb->getPickedPoint(); if (pp) { CurveOnMeshHandler* self = static_cast(ud); if (!self->d_ptr->wireClosed) { diff --git a/src/Mod/Part/App/GeometryPyImp.cpp b/src/Mod/Part/App/GeometryPyImp.cpp index c17aa0d2e6..a5dc0347cd 100644 --- a/src/Mod/Part/App/GeometryPyImp.cpp +++ b/src/Mod/Part/App/GeometryPyImp.cpp @@ -438,7 +438,6 @@ PyObject* GeometryPy::getExtensions(PyObject *args) if(p) { // we create a python copy and add it to the list - Py::Tuple args(size_t(0)); PyObject* cpy = static_cast(p->getPyObject())->copy(Py::new_reference_to(Py::Tuple(size_t(0)))); PyList_SetItem( list, i, cpy); diff --git a/src/Mod/Part/Gui/DlgFilletEdges.cpp b/src/Mod/Part/Gui/DlgFilletEdges.cpp index a4ad74ab78..cc6a072975 100644 --- a/src/Mod/Part/Gui/DlgFilletEdges.cpp +++ b/src/Mod/Part/Gui/DlgFilletEdges.cpp @@ -698,13 +698,13 @@ void DlgFilletEdges::changeEvent(QEvent *e) } } -void DlgFilletEdges::on_shapeObject_activated(int index) +void DlgFilletEdges::on_shapeObject_activated(int itemPos) { d->object = 0; QStandardItemModel *model = qobject_cast(ui->treeView->model()); model->removeRows(0, model->rowCount()); - QByteArray name = ui->shapeObject->itemData(index).toByteArray(); + QByteArray name = ui->shapeObject->itemData(itemPos).toByteArray(); App::Document* doc = App::GetApplication().getActiveDocument(); if (!doc) return; diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index 2e97259795..d6f34c516f 100644 --- a/src/Mod/PartDesign/Gui/Command.cpp +++ b/src/Mod/PartDesign/Gui/Command.cpp @@ -1960,8 +1960,8 @@ void prepareTransformed(PartDesign::Body *pcActiveBody, Gui::Command* cmd, const return; } else { - PartDesign::Body *pcActiveBody = PartDesignGui::getBody(true); - if (pcActiveBody != PartDesignGui::getBodyFor(features[0], false)) { + PartDesign::Body *activeBody = PartDesignGui::getBody(true); + if (activeBody != PartDesignGui::getBodyFor(features[0], false)) { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Selection is not in Active Body"), QObject::tr("Please select only one feature in an active body.")); return; diff --git a/src/Mod/Path/App/FeaturePathCompoundPyImp.cpp b/src/Mod/Path/App/FeaturePathCompoundPyImp.cpp index 33a410a155..e7caae1d19 100644 --- a/src/Mod/Path/App/FeaturePathCompoundPyImp.cpp +++ b/src/Mod/Path/App/FeaturePathCompoundPyImp.cpp @@ -71,9 +71,9 @@ PyObject* FeaturePathCompoundPy::addObject(PyObject *args) Py::Callable method(vp.getAttr(std::string("addObject"))); // check to which method this belongs to avoid an infinite recursion if (method.getAttr(std::string("__self__")) != Py::Object(this)) { - Py::Tuple args(1); - args[0] = Py::Object(object); - method.apply(args); + Py::Tuple arg(1); + arg[0] = Py::Object(object); + method.apply(arg); Py_Return; } } @@ -112,9 +112,9 @@ PyObject* FeaturePathCompoundPy::removeObject(PyObject *args) Py::Callable method(vp.getAttr(std::string("removeObject"))); // check to which method this belongs to avoid an infinite recursion if (method.getAttr(std::string("__self__")) != Py::Object(this)) { - Py::Tuple args(1); - args[0] = Py::Object(object); - method.apply(args); + Py::Tuple arg(1); + arg[0] = Py::Object(object); + method.apply(arg); Py_Return; } } diff --git a/src/Mod/Surface/Gui/TaskFilling.cpp b/src/Mod/Surface/Gui/TaskFilling.cpp index d8895b362d..1441b87b4c 100644 --- a/src/Mod/Surface/Gui/TaskFilling.cpp +++ b/src/Mod/Surface/Gui/TaskFilling.cpp @@ -287,9 +287,9 @@ FillingPanel::~FillingPanel() } // stores object pointer, its old fill type and adjusts radio buttons according to it. -void FillingPanel::setEditedObject(Surface::Filling* obj) +void FillingPanel::setEditedObject(Surface::Filling* fea) { - editedObject = obj; + editedObject = fea; // get the link to the initial surface if set App::DocumentObject* initFace = editedObject->InitialFace.getValue(); diff --git a/src/Mod/Surface/Gui/TaskFillingUnbound.cpp b/src/Mod/Surface/Gui/TaskFillingUnbound.cpp index 161dc602df..633e943435 100644 --- a/src/Mod/Surface/Gui/TaskFillingUnbound.cpp +++ b/src/Mod/Surface/Gui/TaskFillingUnbound.cpp @@ -144,9 +144,9 @@ FillingUnboundPanel::~FillingUnboundPanel() } // stores object pointer, its old fill type and adjusts radio buttons according to it. -void FillingUnboundPanel::setEditedObject(Surface::Filling* obj) +void FillingUnboundPanel::setEditedObject(Surface::Filling* fea) { - editedObject = obj; + editedObject = fea; // get the unbound edges, if set their adjacent faces and continuities auto objects = editedObject->UnboundEdges.getValues();