diff --git a/src/Mod/Sketcher/App/Sketch.cpp b/src/Mod/Sketcher/App/Sketch.cpp index 5d3032de47..490cdf7040 100644 --- a/src/Mod/Sketcher/App/Sketch.cpp +++ b/src/Mod/Sketcher/App/Sketch.cpp @@ -1925,7 +1925,7 @@ int Sketch::addConstraints(const std::vector &ConstraintList, int cid = 0; for (std::vector::const_iterator it = ConstraintList.begin();it!=ConstraintList.end();++it,++cid) { - if (!unenforceableConstraints[cid] && (*it)->Type != Block && (*it)->isActive == true) { + if (!unenforceableConstraints[cid] && (*it)->Type != Block && (*it)->isActive) { rtn = addConstraint (*it); if(rtn == -1) { diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 9fb7f8094f..2d6f596348 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -429,15 +429,15 @@ int SketchObject::toggleDriving(int ConstrId) bool extorconstructionpoint1 = (vals[ConstrId]->First == GeoEnum::GeoUndef) || (vals[ConstrId]->First < 0) || - (geof1 && geof1->isGeoType(Part::GeomPoint::getClassTypeId()) && geof1->getConstruction() == true); + (geof1 && geof1->isGeoType(Part::GeomPoint::getClassTypeId()) && geof1->getConstruction()); bool extorconstructionpoint2 = (vals[ConstrId]->Second == GeoEnum::GeoUndef)|| (vals[ConstrId]->Second < 0) || - (geof2 && geof2->isGeoType(Part::GeomPoint::getClassTypeId()) && geof2->getConstruction() == true); + (geof2 && geof2->isGeoType(Part::GeomPoint::getClassTypeId()) && geof2->getConstruction()); bool extorconstructionpoint3 = (vals[ConstrId]->Third == GeoEnum::GeoUndef) || (vals[ConstrId]->Third < 0) || - (geof3 && geof3->isGeoType(Part::GeomPoint::getClassTypeId()) && geof3->getConstruction() == true); + (geof3 && geof3->isGeoType(Part::GeomPoint::getClassTypeId()) && geof3->getConstruction()); - if (extorconstructionpoint1 && extorconstructionpoint2 && extorconstructionpoint3 && vals[ConstrId]->isDriving==false) + if (extorconstructionpoint1 && extorconstructionpoint2 && extorconstructionpoint3 && !vals[ConstrId]->isDriving) return -4; // copy the list @@ -467,7 +467,7 @@ int SketchObject::testDrivingChange(int ConstrId, bool isdriving) if (!vals[ConstrId]->isDimensional()) return -2; - if (!(vals[ConstrId]->First>=0 || vals[ConstrId]->Second>=0 || vals[ConstrId]->Third>=0) && isdriving==true) + if (!(vals[ConstrId]->First>=0 || vals[ConstrId]->Second>=0 || vals[ConstrId]->Third>=0) && isdriving) return -3; // a constraint that does not have at least one element as not-external-geometry can never be driving. return 0; diff --git a/src/Mod/Sketcher/App/SketchObjectPyImp.cpp b/src/Mod/Sketcher/App/SketchObjectPyImp.cpp index 239245edf1..eb598f56af 100644 --- a/src/Mod/Sketcher/App/SketchObjectPyImp.cpp +++ b/src/Mod/Sketcher/App/SketchObjectPyImp.cpp @@ -1492,7 +1492,7 @@ PyObject* SketchObjectPy::convertToNURBS(PyObject *args) if (!PyArg_ParseTuple(args, "i", &GeoId)) return nullptr; - if (this->getSketchObjectPtr()->convertToNURBS(GeoId)==false) { + if (!this->getSketchObjectPtr()->convertToNURBS(GeoId)) { std::stringstream str; str << "Object does not support NURBS conversion: " << GeoId; PyErr_SetString(PyExc_ValueError, str.str().c_str()); @@ -1510,7 +1510,7 @@ PyObject* SketchObjectPy::increaseBSplineDegree(PyObject *args) if (!PyArg_ParseTuple(args, "i|i", &GeoId, &incr)) return nullptr; - if (this->getSketchObjectPtr()->increaseBSplineDegree(GeoId, incr)==false) { + if (!this->getSketchObjectPtr()->increaseBSplineDegree(GeoId, incr)) { std::stringstream str; str << "Degree increase failed for: " << GeoId; PyErr_SetString(PyExc_ValueError, str.str().c_str()); @@ -1541,7 +1541,7 @@ PyObject* SketchObjectPy::modifyBSplineKnotMultiplicity(PyObject *args) if (!PyArg_ParseTuple(args, "ii|i", &GeoId, &knotIndex, &multiplicity)) return nullptr; - if (this->getSketchObjectPtr()->modifyBSplineKnotMultiplicity(GeoId, knotIndex, multiplicity)==false) { + if (!this->getSketchObjectPtr()->modifyBSplineKnotMultiplicity(GeoId, knotIndex, multiplicity)) { std::stringstream str; str << "Multiplicity modification failed for: " << GeoId; PyErr_SetString(PyExc_ValueError, str.str().c_str()); @@ -1560,7 +1560,7 @@ PyObject* SketchObjectPy::insertBSplineKnot(PyObject *args) if (!PyArg_ParseTuple(args, "id|i", &GeoId, &knotParam, &multiplicity)) return nullptr; - if (this->getSketchObjectPtr()->insertBSplineKnot(GeoId, knotParam, multiplicity)==false) { + if (!this->getSketchObjectPtr()->insertBSplineKnot(GeoId, knotParam, multiplicity)) { std::stringstream str; str << "Knot insertion failed for: " << GeoId; PyErr_SetString(PyExc_ValueError, str.str().c_str()); diff --git a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp index b894a5eac1..0d794b4404 100644 --- a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp +++ b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp @@ -141,7 +141,7 @@ void removeRedundantHorizontalVertical(Sketcher::SketchObject* psketch, axis = false; for(std::vector::const_iterator it = sug.begin(); it!=sug.end(); ++it) { - if( (*it).Type == Sketcher::Coincident && ext == false) { + if( (*it).Type == Sketcher::Coincident && !ext) { const std::map coincidents = psketch->getAllCoincidentPoints((*it).GeoId, (*it).PosId); if(!coincidents.empty()) { @@ -162,7 +162,7 @@ void removeRedundantHorizontalVertical(Sketcher::SketchObject* psketch, orig = ((*it).GeoId == -1 && (*it).PosId == Sketcher::PointPos::start); } } - else if( (*it).Type == Sketcher::PointOnObject && axis == false) { + else if( (*it).Type == Sketcher::PointOnObject && !axis) { axis = (((*it).GeoId == -1 && (*it).PosId == Sketcher::PointPos::none) || ((*it).GeoId == -2 && (*it).PosId == Sketcher::PointPos::none)); } diff --git a/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp b/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp index 9be4d5a6f0..0261a9f825 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp +++ b/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp @@ -519,7 +519,7 @@ void TaskSketcherElements::on_listWidgetElements_itemSelectionChanged(void) for (int i=0;ilistWidgetElements->count(); i++) { ElementItem * ite=static_cast(ui->listWidgetElements->item(i)); - if(multipleselection==false && multipleconsecutiveselection==false && ite!=itf) { + if(!multipleselection && !multipleconsecutiveselection && ite != itf) { ite->isLineSelected=false; ite->isStartingPointSelected=false; ite->isEndPointSelected=false; diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 9d0808f186..dd39d9cae1 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -416,7 +416,7 @@ bool ViewProviderSketch::keyPressed(bool pressed, int key) sketchHandler->quit(); return true; } - if (isInEditMode() && (drag.DragConstraintSet.empty() == false)) { + if (isInEditMode() && !drag.DragConstraintSet.empty()) { if (!pressed) { drag.DragConstraintSet.clear(); } @@ -827,7 +827,7 @@ bool ViewProviderSketch::mouseButtonPressed(int Button, bool pressed, const SbVe Mode = STATUS_NONE; return true; case STATUS_SKETCH_DragConstraint: - if (drag.DragConstraintSet.empty() == false) { + if (!drag.DragConstraintSet.empty()) { getDocument()->openCommand(QT_TRANSLATE_NOOP("Command", "Drag Constraint")); auto idset = drag.DragConstraintSet; for(int id : idset) { @@ -1249,7 +1249,7 @@ bool ViewProviderSketch::mouseMove(const SbVec2s &cursorPos, Gui::View3DInventor } return true; case STATUS_SKETCH_DragConstraint: - if (drag.DragConstraintSet.empty() == false) { + if (!drag.DragConstraintSet.empty()) { auto idset = drag.DragConstraintSet; for(int id : idset) moveConstraint(id, Base::Vector2d(x,y)); @@ -1728,7 +1728,7 @@ bool ViewProviderSketch::detectAndShowPreselection(SoPickedPoint * Point, const sketchHandler->applyCursor(); return true; } - } else if (result.ConstrIndices.empty() == false && result.ConstrIndices != preselection.PreselectConstraintSet) { // if a constraint is hit + } else if (!result.ConstrIndices.empty() && result.ConstrIndices != preselection.PreselectConstraintSet) { // if a constraint is hit bool accepted = true; for(std::set::iterator it = result.ConstrIndices.begin(); it != result.ConstrIndices.end(); ++it) { std::stringstream ss;