diff --git a/src/Mod/Fem/App/FemConstraint.cpp b/src/Mod/Fem/App/FemConstraint.cpp index 86f2288a5..ea180d645 100644 --- a/src/Mod/Fem/App/FemConstraint.cpp +++ b/src/Mod/Fem/App/FemConstraint.cpp @@ -225,7 +225,7 @@ const bool Constraint::getPoints(std::vector &points, std::vecto return true; } -const bool Constraint::getCylinder(float& radius, float& height, Base::Vector3d& base, Base::Vector3d& axis) const +const bool Constraint::getCylinder(double &radius, double &height, Base::Vector3d& base, Base::Vector3d& axis) const { std::vector Objects = References.getValues(); std::vector SubElements = References.getSubValues(); @@ -255,7 +255,7 @@ const bool Constraint::getCylinder(float& radius, float& height, Base::Vector3d& } Base::Vector3d Constraint::getBasePoint(const Base::Vector3d& base, const Base::Vector3d& axis, - const App::PropertyLinkSub& location, const float& dist) + const App::PropertyLinkSub& location, const double& dist) { // Get the point specified by Location and Distance App::DocumentObject* objLoc = location.getValue(); diff --git a/src/Mod/Fem/App/FemConstraint.h b/src/Mod/Fem/App/FemConstraint.h index 693b5be96..a0ba40911 100644 --- a/src/Mod/Fem/App/FemConstraint.h +++ b/src/Mod/Fem/App/FemConstraint.h @@ -60,9 +60,9 @@ protected: protected: /// Calculate the points where symbols should be drawn const bool getPoints(std::vector& points, std::vector& normals) const; - const bool getCylinder(float& radius, float& height, Base::Vector3d& base, Base::Vector3d& axis) const; + const bool getCylinder(double& radius, double& height, Base::Vector3d& base, Base::Vector3d& axis) const; Base::Vector3d getBasePoint(const Base::Vector3d& base, const Base::Vector3d& axis, - const App::PropertyLinkSub &location, const float& dist); + const App::PropertyLinkSub &location, const double& dist); const Base::Vector3d getDirection(const App::PropertyLinkSub &direction); }; diff --git a/src/Mod/Fem/App/FemConstraintBearing.cpp b/src/Mod/Fem/App/FemConstraintBearing.cpp index 6e3b4e63a..5eab9e8b5 100644 --- a/src/Mod/Fem/App/FemConstraintBearing.cpp +++ b/src/Mod/Fem/App/FemConstraintBearing.cpp @@ -70,7 +70,7 @@ void ConstraintBearing::onChanged(const App::Property* prop) if (prop == &References) { // Find data of cylinder - float radius, height; + double radius, height; Base::Vector3d base, axis; if (!getCylinder(radius, height, base, axis)) return; @@ -106,7 +106,7 @@ void ConstraintBearing::onChanged(const App::Property* prop) } } - float radius, height; + double radius, height; Base::Vector3d base, axis; if (!getCylinder(radius, height, base, axis)) return; diff --git a/src/Mod/Fem/Gui/TaskFemConstraintBearing.cpp b/src/Mod/Fem/Gui/TaskFemConstraintBearing.cpp index cf98b3003..ba15669b6 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintBearing.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintBearing.cpp @@ -225,7 +225,7 @@ void TaskFemConstraintBearing::onSelectionChanged(const Gui::SelectionChanges& m void TaskFemConstraintBearing::onDistanceChanged(double l) { Fem::ConstraintBearing* pcConstraint = static_cast(ConstraintView->getObject()); - pcConstraint->Dist.setValue((float)l); + pcConstraint->Dist.setValue(l); } void TaskFemConstraintBearing::onReferenceDeleted() { diff --git a/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp b/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp index 8a51a99e4..5d58026d8 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp @@ -232,7 +232,7 @@ void TaskFemConstraintForce::onSelectionChanged(const Gui::SelectionChanges& msg void TaskFemConstraintForce::onForceChanged(double f) { Fem::ConstraintForce* pcConstraint = static_cast(ConstraintView->getObject()); - pcConstraint->Force.setValue((float)f); + pcConstraint->Force.setValue(f); } void TaskFemConstraintForce::onReferenceDeleted() { diff --git a/src/Mod/Fem/Gui/TaskFemConstraintGear.cpp b/src/Mod/Fem/Gui/TaskFemConstraintGear.cpp index 4f4f3adf9..ad36e01d3 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintGear.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintGear.cpp @@ -177,19 +177,19 @@ void TaskFemConstraintGear::onSelectionChanged(const Gui::SelectionChanges& msg) void TaskFemConstraintGear::onDiameterChanged(double l) { Fem::ConstraintGear* pcConstraint = static_cast(ConstraintView->getObject()); - pcConstraint->Diameter.setValue((float)l); + pcConstraint->Diameter.setValue(l); } void TaskFemConstraintGear::onForceChanged(double f) { Fem::ConstraintGear* pcConstraint = static_cast(ConstraintView->getObject()); - pcConstraint->Force.setValue((float)f); + pcConstraint->Force.setValue(f); } void TaskFemConstraintGear::onForceAngleChanged(double a) { Fem::ConstraintGear* pcConstraint = static_cast(ConstraintView->getObject()); - pcConstraint->ForceAngle.setValue((float)a); + pcConstraint->ForceAngle.setValue(a); } void TaskFemConstraintGear::onButtonDirection(const bool pressed) { diff --git a/src/Mod/Fem/Gui/TaskFemConstraintPulley.cpp b/src/Mod/Fem/Gui/TaskFemConstraintPulley.cpp index e6d7c55ce..365ba9490 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintPulley.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintPulley.cpp @@ -109,19 +109,19 @@ TaskFemConstraintPulley::TaskFemConstraintPulley(ViewProviderFemConstraintPulley void TaskFemConstraintPulley::onOtherDiameterChanged(double l) { Fem::ConstraintPulley* pcConstraint = static_cast(ConstraintView->getObject()); - pcConstraint->OtherDiameter.setValue((float)l); + pcConstraint->OtherDiameter.setValue(l); } void TaskFemConstraintPulley::onCenterDistanceChanged(double l) { Fem::ConstraintPulley* pcConstraint = static_cast(ConstraintView->getObject()); - pcConstraint->CenterDistance.setValue((float)l); + pcConstraint->CenterDistance.setValue(l); } void TaskFemConstraintPulley::onTensionForceChanged(double force) { Fem::ConstraintPulley* pcConstraint = static_cast(ConstraintView->getObject()); - pcConstraint->TensionForce.setValue((float)force); + pcConstraint->TensionForce.setValue(force); } void TaskFemConstraintPulley::onCheckIsDriven(const bool pressed) diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintGear.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintGear.cpp index fc246a006..8ae1e7bcf 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintGear.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintGear.cpp @@ -119,11 +119,11 @@ void ViewProviderFemConstraintGear::updateData(const App::Property* prop) Base::Vector3d direction = pcConstraint->DirectionVector.getValue(); if (direction.Length() < Precision::Confusion()) direction = Base::Vector3d(0,1,0); - float radius = pcConstraint->Radius.getValue(); - float dia = pcConstraint->Diameter.getValue(); + double radius = pcConstraint->Radius.getValue(); + double dia = pcConstraint->Diameter.getValue(); if (dia < 2 * radius) dia = 2 * radius; - float angle = pcConstraint->ForceAngle.getValue() / 180 * M_PI; + double angle = pcConstraint->ForceAngle.getValue() / 180 * M_PI; SbVec3f b(base.x, base.y, base.z); SbVec3f ax(axis.x, axis.y, axis.z); @@ -142,11 +142,11 @@ void ViewProviderFemConstraintGear::updateData(const App::Property* prop) Base::Vector3d direction = pcConstraint->DirectionVector.getValue(); if (direction.Length() < Precision::Confusion()) direction = Base::Vector3d(0,1,0); - float dia = pcConstraint->Diameter.getValue(); - float radius = pcConstraint->Radius.getValue(); + double dia = pcConstraint->Diameter.getValue(); + double radius = pcConstraint->Radius.getValue(); if (dia < 2 * radius) dia = 2 * radius; - float angle = pcConstraint->ForceAngle.getValue() / 180 * M_PI; + double angle = pcConstraint->ForceAngle.getValue() / 180 * M_PI; SbVec3f ax(axis.x, axis.y, axis.z); SbVec3f dir(direction.x, direction.y, direction.z); @@ -165,8 +165,8 @@ void ViewProviderFemConstraintGear::updateData(const App::Property* prop) Base::Vector3d direction = pcConstraint->DirectionVector.getValue(); if (direction.Length() < Precision::Confusion()) direction = Base::Vector3d(0,1,0); - float dia = pcConstraint->Diameter.getValue(); - float angle = pcConstraint->ForceAngle.getValue() / 180 * M_PI; + double dia = pcConstraint->Diameter.getValue(); + double angle = pcConstraint->ForceAngle.getValue() / 180 * M_PI; SbVec3f ax(axis.x, axis.y, axis.z); SbVec3f dir(direction.x, direction.y, direction.z); diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintPulley.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintPulley.cpp index 100ef72d6..5f5401c9a 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintPulley.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintPulley.cpp @@ -116,15 +116,15 @@ void ViewProviderFemConstraintPulley::updateData(const App::Property* prop) // This should always point outside of the cylinder Base::Vector3d base = pcConstraint->BasePoint.getValue(); Base::Vector3d axis = pcConstraint->Axis.getValue(); - float radius = pcConstraint->Radius.getValue(); - float dia = pcConstraint->Diameter.getValue(); + double radius = pcConstraint->Radius.getValue(); + double dia = pcConstraint->Diameter.getValue(); if (dia < 2 * radius) dia = 2 * radius; - float forceAngle = pcConstraint->ForceAngle.getValue() / 180 * M_PI; - float beltAngle = pcConstraint->BeltAngle.getValue(); + double forceAngle = pcConstraint->ForceAngle.getValue() / 180 * M_PI; + double beltAngle = pcConstraint->BeltAngle.getValue(); double rat1 = 0.8, rat2 = 0.2; - float f1 = pcConstraint->BeltForce1.getValue(); - float f2 = pcConstraint->BeltForce2.getValue(); + double f1 = pcConstraint->BeltForce1.getValue(); + double f2 = pcConstraint->BeltForce2.getValue(); if (f1+f2 > Precision::Confusion()) { rat1 = f1 / (f1+f2); rat2 = f2 / (f1+f2); @@ -151,15 +151,15 @@ void ViewProviderFemConstraintPulley::updateData(const App::Property* prop) } else if (strcmp(prop->getName(),"Diameter") == 0) { if (pShapeSep->getNumChildren() > 0) { // Change the symbol - float radius = pcConstraint->Radius.getValue(); - float dia = pcConstraint->Diameter.getValue(); + double radius = pcConstraint->Radius.getValue(); + double dia = pcConstraint->Diameter.getValue(); if (dia < 2 * radius) dia = 2 * radius; - float forceAngle = pcConstraint->ForceAngle.getValue() / 180 * M_PI; - float beltAngle = pcConstraint->BeltAngle.getValue(); + double forceAngle = pcConstraint->ForceAngle.getValue() / 180 * M_PI; + double beltAngle = pcConstraint->BeltAngle.getValue(); double rat1 = 0.8, rat2 = 0.2; - float f1 = pcConstraint->BeltForce1.getValue(); - float f2 = pcConstraint->BeltForce2.getValue(); + double f1 = pcConstraint->BeltForce1.getValue(); + double f2 = pcConstraint->BeltForce2.getValue(); if (f1+f2 > Precision::Confusion()) { rat1 = f1 / (f1+f2); rat2 = f2 / (f1+f2); @@ -182,12 +182,12 @@ void ViewProviderFemConstraintPulley::updateData(const App::Property* prop) } } else if ((strcmp(prop->getName(), "ForceAngle") == 0) || (strcmp(prop->getName(), "BeltAngle") == 0)) { if (pShapeSep->getNumChildren() > 0) { - float radius = pcConstraint->Radius.getValue(); - float dia = pcConstraint->Diameter.getValue(); + double radius = pcConstraint->Radius.getValue(); + double dia = pcConstraint->Diameter.getValue(); if (dia < 2 * radius) dia = 2 * radius; - float forceAngle = pcConstraint->ForceAngle.getValue() / 180 * M_PI; - float beltAngle = pcConstraint->BeltAngle.getValue(); + double forceAngle = pcConstraint->ForceAngle.getValue() / 180 * M_PI; + double beltAngle = pcConstraint->BeltAngle.getValue(); const SoSeparator* sep = static_cast(pShapeSep->getChild(3)); updatePlacement(sep, 0, SbVec3f(dia/2 * sin(forceAngle+beltAngle), 0, dia/2 * cos(forceAngle+beltAngle)), @@ -198,13 +198,13 @@ void ViewProviderFemConstraintPulley::updateData(const App::Property* prop) } } else if ((strcmp(prop->getName(), "BeltForce1") == 0) || (strcmp(prop->getName(), "BeltForce2") == 0)) { if (pShapeSep->getNumChildren() > 0) { - float radius = pcConstraint->Radius.getValue(); - float dia = pcConstraint->Diameter.getValue(); + double radius = pcConstraint->Radius.getValue(); + double dia = pcConstraint->Diameter.getValue(); if (dia < 2 * radius) dia = 2 * radius; double rat1 = 0.8, rat2 = 0.2; - float f1 = pcConstraint->BeltForce1.getValue(); - float f2 = pcConstraint->BeltForce2.getValue(); + double f1 = pcConstraint->BeltForce1.getValue(); + double f2 = pcConstraint->BeltForce2.getValue(); if (f1+f2 > Precision::Confusion()) { rat1 = f1 / (f1+f2); rat2 = f2 / (f1+f2);