From 71154f5f25c4e51d32102608d69653b899d9c49a Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 10 Oct 2014 17:42:33 +0200 Subject: [PATCH] + fix issues with force constraint --- src/Mod/Fem/App/FemConstraint.cpp | 5 ++++- src/Mod/Fem/Gui/TaskFemConstraintForce.cpp | 2 +- src/Mod/Fem/Gui/ViewProviderFemConstraintForce.cpp | 2 -- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Mod/Fem/App/FemConstraint.cpp b/src/Mod/Fem/App/FemConstraint.cpp index 6112c46a185d..1297b8fefbb4 100644 --- a/src/Mod/Fem/App/FemConstraint.cpp +++ b/src/Mod/Fem/App/FemConstraint.cpp @@ -309,7 +309,10 @@ const Base::Vector3d Constraint::getDirection(const App::PropertyLinkSub &direct return Base::Vector3d(0,0,0); std::string subName = names.front(); Part::Feature* feat = static_cast(obj); - TopoDS_Shape sh = feat->Shape.getShape().getSubShape(subName.c_str()); + const Part::TopoShape& shape = feat->Shape.getShape(); + if (shape.isNull()) + return Base::Vector3d(0,0,0); + TopoDS_Shape sh = shape.getSubShape(subName.c_str()); gp_Dir dir; if (sh.ShapeType() == TopAbs_FACE) { diff --git a/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp b/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp index 4ec7f00d3f51..a83b1a2f65b2 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp @@ -142,7 +142,7 @@ void TaskFemConstraintForce::updateUI() else if (ref.substr(pos+1, 4) == "Edge") ui->labelForce->setText(tr("Force [N/mm]")); else if (ref.substr(pos+1, 4) == "Face") - ui->labelForce->setText(tr("Force [N/mm²]")); + ui->labelForce->setText(trUtf8("Force [N/mm\xc2\xb2]")); } void TaskFemConstraintForce::onSelectionChanged(const Gui::SelectionChanges& msg) diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintForce.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintForce.cpp index 4d1ac8c2a225..b3f2727b3843 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintForce.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintForce.cpp @@ -55,8 +55,6 @@ ViewProviderFemConstraintForce::~ViewProviderFemConstraintForce() bool ViewProviderFemConstraintForce::setEdit(int ModNum) { - Base::Console().Error("ViewProviderFemConstraintForce::setEdit(%u)\n", ModNum); - if (ModNum == ViewProvider::Default ) { // When double-clicking on the item for this constraint the // object unsets and sets its edit mode without closing