diff --git a/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp b/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp index 1392b5a49963..c49b8fef584a 100644 --- a/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp +++ b/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp @@ -63,7 +63,8 @@ TaskCreateNodeSet::TaskCreateNodeSet(Fem::FemSetNodesObject *pcObject,QWidget *p tr("Nodes set"), true, parent), - pcObject(pcObject) + pcObject(pcObject), + selectionMode(none) { // we need a separate container widget to add all controls to proxy = new QWidget(this); diff --git a/src/Mod/Measure/App/Measurement.cpp b/src/Mod/Measure/App/Measurement.cpp index e6cb76041cab..7e7b5beac212 100644 --- a/src/Mod/Measure/App/Measurement.cpp +++ b/src/Mod/Measure/App/Measurement.cpp @@ -64,7 +64,7 @@ TYPESYSTEM_SOURCE(Measure::Measurement, Base::BaseClass) Measurement::Measurement() { - + measureType = Invalid; } Measurement::~Measurement() diff --git a/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp b/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp index 5eff897b19de..3198c0eeee16 100644 --- a/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp @@ -192,9 +192,9 @@ TaskDatumParameters::TaskDatumParameters(ViewProviderDatum *DatumView,QWidget *p ui->lineRef4->blockSignals(false); ui->listOfModes->blockSignals(false); + this->iActiveRef = 0; if (pcDatum->Support.getSize() == 0){ autoNext = true; - this->iActiveRef = 0; } else { autoNext = false; } diff --git a/src/Mod/PartDesign/Gui/TaskPocketParameters.cpp b/src/Mod/PartDesign/Gui/TaskPocketParameters.cpp index 2f9d93f0df6e..93622dfdcf6f 100644 --- a/src/Mod/PartDesign/Gui/TaskPocketParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskPocketParameters.cpp @@ -54,6 +54,7 @@ using namespace Gui; TaskPocketParameters::TaskPocketParameters(ViewProviderPocket *PocketView,QWidget *parent, bool newObj) : TaskSketchBasedParameters(PocketView, parent, "PartDesign_Pocket",tr("Pocket parameters")) + , oldLength(0) { // we need a separate container widget to add all controls to proxy = new QWidget(this); diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index a3b8983d7a17..81286bae56bb 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -456,25 +456,25 @@ Base::Vector3d SketchObject::getPoint(int GeoId, PointPos PosId) const throw Base::Exception("SketchObject::getPoint. Invalid GeoId was supplied."); const Part::Geometry *geo = getGeometry(GeoId); if (geo->getTypeId() == Part::GeomPoint::getClassTypeId()) { - const Part::GeomPoint *p = dynamic_cast(geo); + const Part::GeomPoint *p = static_cast(geo); if (PosId == start || PosId == mid || PosId == end) return p->getPoint(); } else if (geo->getTypeId() == Part::GeomLineSegment::getClassTypeId()) { - const Part::GeomLineSegment *lineSeg = dynamic_cast(geo); + const Part::GeomLineSegment *lineSeg = static_cast(geo); if (PosId == start) return lineSeg->getStartPoint(); else if (PosId == end) return lineSeg->getEndPoint(); } else if (geo->getTypeId() == Part::GeomCircle::getClassTypeId()) { - const Part::GeomCircle *circle = dynamic_cast(geo); + const Part::GeomCircle *circle = static_cast(geo); if (PosId == mid) return circle->getCenter(); } else if (geo->getTypeId() == Part::GeomEllipse::getClassTypeId()) { - const Part::GeomEllipse *ellipse = dynamic_cast(geo); + const Part::GeomEllipse *ellipse = static_cast(geo); if (PosId == mid) return ellipse->getCenter(); } else if (geo->getTypeId() == Part::GeomArcOfCircle::getClassTypeId()) { - const Part::GeomArcOfCircle *aoc = dynamic_cast(geo); + const Part::GeomArcOfCircle *aoc = static_cast(geo); if (PosId == start) return aoc->getStartPoint(/*emulateCCW=*/true); else if (PosId == end) @@ -482,7 +482,7 @@ Base::Vector3d SketchObject::getPoint(int GeoId, PointPos PosId) const else if (PosId == mid) return aoc->getCenter(); } else if (geo->getTypeId() == Part::GeomArcOfEllipse::getClassTypeId()) { - const Part::GeomArcOfEllipse *aoc = dynamic_cast(geo); + const Part::GeomArcOfEllipse *aoc = static_cast(geo); if (PosId == start) return aoc->getStartPoint(/*emulateCCW=*/true); else if (PosId == end) @@ -520,7 +520,7 @@ Base::Axis SketchObject::getAxis(int axId) const if ((*geo) && (*geo)->Construction && (*geo)->getTypeId() == Part::GeomLineSegment::getClassTypeId()) { if (count == axId) { - Part::GeomLineSegment *lineSeg = dynamic_cast(*geo); + Part::GeomLineSegment *lineSeg = static_cast(*geo); Base::Vector3d start = lineSeg->getStartPoint(); Base::Vector3d end = lineSeg->getEndPoint(); return Base::Axis(start, end-start); @@ -917,8 +917,8 @@ int SketchObject::fillet(int GeoId, PointPos PosId, double radius, bool trim) const Part::Geometry *geo2 = getGeometry(GeoIdList[1]); if (geo1->getTypeId() == Part::GeomLineSegment::getClassTypeId() && geo2->getTypeId() == Part::GeomLineSegment::getClassTypeId() ) { - const Part::GeomLineSegment *lineSeg1 = dynamic_cast(geo1); - const Part::GeomLineSegment *lineSeg2 = dynamic_cast(geo2); + const Part::GeomLineSegment *lineSeg1 = static_cast(geo1); + const Part::GeomLineSegment *lineSeg2 = static_cast(geo2); Base::Vector3d midPnt1 = (lineSeg1->getStartPoint() + lineSeg1->getEndPoint()) / 2 ; Base::Vector3d midPnt2 = (lineSeg2->getStartPoint() + lineSeg2->getEndPoint()) / 2 ; @@ -941,8 +941,8 @@ int SketchObject::fillet(int GeoId1, int GeoId2, const Part::Geometry *geo2 = getGeometry(GeoId2); if (geo1->getTypeId() == Part::GeomLineSegment::getClassTypeId() && geo2->getTypeId() == Part::GeomLineSegment::getClassTypeId() ) { - const Part::GeomLineSegment *lineSeg1 = dynamic_cast(geo1); - const Part::GeomLineSegment *lineSeg2 = dynamic_cast(geo2); + const Part::GeomLineSegment *lineSeg1 = static_cast(geo1); + const Part::GeomLineSegment *lineSeg2 = static_cast(geo2); Base::Vector3d filletCenter; if (!Part::findFilletCenter(lineSeg1, lineSeg2, radius, refPnt1, refPnt2, filletCenter)) @@ -1039,7 +1039,7 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point) Part::Geometry *geo = geomlist[GeoId]; if (geo->getTypeId() == Part::GeomLineSegment::getClassTypeId()) { - const Part::GeomLineSegment *lineSeg = dynamic_cast(geo); + const Part::GeomLineSegment *lineSeg = static_cast(geo); Base::Vector3d startPnt = lineSeg->getStartPoint(); Base::Vector3d endPnt = lineSeg->getEndPoint(); Base::Vector3d dir = (endPnt - startPnt).Normalize(); @@ -1192,7 +1192,7 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point) } } } else if (geo->getTypeId() == Part::GeomCircle::getClassTypeId()) { - const Part::GeomCircle *circle = dynamic_cast(geo); + const Part::GeomCircle *circle = static_cast(geo); Base::Vector3d center = circle->getCenter(); double theta0 = Base::fmod(atan2(point.y - center.y,point.x - center.x), 2.f*M_PI); if (GeoId1 >= 0 && GeoId2 >= 0) { @@ -1274,7 +1274,7 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point) return 0; } } else if (geo->getTypeId() == Part::GeomEllipse::getClassTypeId()) { - const Part::GeomEllipse *ellipse = dynamic_cast(geo); + const Part::GeomEllipse *ellipse = static_cast(geo); Base::Vector3d center = ellipse->getCenter(); double theta0; ellipse->closestParameter(point,theta0); @@ -1364,7 +1364,7 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point) return 0; } } else if (geo->getTypeId() == Part::GeomArcOfCircle::getClassTypeId()) { - const Part::GeomArcOfCircle *aoc = dynamic_cast(geo); + const Part::GeomArcOfCircle *aoc = static_cast(geo); Base::Vector3d center = aoc->getCenter(); double startAngle, endAngle; aoc->getRange(startAngle, endAngle, /*emulateCCW=*/true); @@ -1386,8 +1386,8 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point) // go through all constraints and replace the point (GeoId,end) with (newGeoId,end) transferConstraints(GeoId, end, newGeoId, end); - Part::GeomArcOfCircle *aoc1 = dynamic_cast(geomlist[GeoId]); - Part::GeomArcOfCircle *aoc2 = dynamic_cast(geomlist[newGeoId]); + Part::GeomArcOfCircle *aoc1 = static_cast(geomlist[GeoId]); + Part::GeomArcOfCircle *aoc2 = static_cast(geomlist[newGeoId]); aoc1->setRange(startAngle, startAngle + theta1, /*emulateCCW=*/true); aoc2->setRange(startAngle + theta2, endAngle, /*emulateCCW=*/true); @@ -1487,7 +1487,7 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point) if (theta1 >= 0.001*arcLength && theta1 <= 0.999*arcLength) { if (theta1 > theta0) { // trim arc start delConstraintOnPoint(GeoId, start, false); - Part::GeomArcOfCircle *aoc1 = dynamic_cast(geomlist[GeoId]); + Part::GeomArcOfCircle *aoc1 = static_cast(geomlist[GeoId]); aoc1->setRange(startAngle + theta1, endAngle, /*emulateCCW=*/true); // constrain the trimming point on the corresponding geometry Sketcher::Constraint *newConstr = new Sketcher::Constraint(); @@ -1509,7 +1509,7 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point) } else { // trim arc end delConstraintOnPoint(GeoId, end, false); - Part::GeomArcOfCircle *aoc1 = dynamic_cast(geomlist[GeoId]); + Part::GeomArcOfCircle *aoc1 = static_cast(geomlist[GeoId]); aoc1->setRange(startAngle, startAngle + theta1, /*emulateCCW=*/true); Sketcher::Constraint *newConstr = new Sketcher::Constraint(); newConstr->Type = constrType; @@ -1531,7 +1531,7 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point) } } } else if (geo->getTypeId() == Part::GeomArcOfEllipse::getClassTypeId()) { - const Part::GeomArcOfEllipse *aoe = dynamic_cast(geo); + const Part::GeomArcOfEllipse *aoe = static_cast(geo); Base::Vector3d center = aoe->getCenter(); double startAngle, endAngle; aoe->getRange(startAngle, endAngle,/*emulateCCW=*/true); @@ -1563,8 +1563,8 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point) // go through all constraints and replace the point (GeoId,end) with (newGeoId,end) transferConstraints(GeoId, end, newGeoId, end); - Part::GeomArcOfEllipse *aoe1 = dynamic_cast(geomlist[GeoId]); - Part::GeomArcOfEllipse *aoe2 = dynamic_cast(geomlist[newGeoId]); + Part::GeomArcOfEllipse *aoe1 = static_cast(geomlist[GeoId]); + Part::GeomArcOfEllipse *aoe2 = static_cast(geomlist[newGeoId]); aoe1->setRange(startAngle, startAngle + theta1, /*emulateCCW=*/true); aoe2->setRange(startAngle + theta2, endAngle, /*emulateCCW=*/true); @@ -1667,7 +1667,7 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point) if (theta1 >= 0.001*arcLength && theta1 <= 0.999*arcLength) { if (theta1 > theta0) { // trim arc start delConstraintOnPoint(GeoId, start, false); - Part::GeomArcOfEllipse *aoe1 = dynamic_cast(geomlist[GeoId]); + Part::GeomArcOfEllipse *aoe1 = static_cast(geomlist[GeoId]); aoe1->setRange(startAngle + theta1, endAngle, /*emulateCCW=*/true); // constrain the trimming point on the corresponding geometry Sketcher::Constraint *newConstr = new Sketcher::Constraint(); @@ -1689,7 +1689,7 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point) } else { // trim arc end delConstraintOnPoint(GeoId, end, false); - Part::GeomArcOfEllipse *aoe1 = dynamic_cast(geomlist[GeoId]); + Part::GeomArcOfEllipse *aoe1 = static_cast(geomlist[GeoId]); aoe1->setRange(startAngle, startAngle + theta1, /*emulateCCW=*/true); if(noRecomputes) // if we do not have a recompute, the sketch must be solved to update the DoF of the solver @@ -4090,7 +4090,7 @@ int SketchObject::port_reversedExternalArcs(bool justAnalyze) //we are dealing with a link to an endpoint of external geom Part::Geometry* g = this->ExternalGeo[-geoId-1]; if (g->getTypeId() == Part::GeomArcOfCircle::getClassTypeId()){ - const Part::GeomArcOfCircle *segm = dynamic_cast(g); + const Part::GeomArcOfCircle *segm = static_cast(g); if(segm->isReversedInXY()){ //Gotcha! a link to an endpoint of external arc that is reversed. //create a constraint copy, affect it, replace the pointer