From 61430e67e1353a9ee5e771a18fe14bb7a1587e26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Tr=C3=B6ger?= Date: Fri, 2 Aug 2013 17:39:49 +0000 Subject: [PATCH] put constraint selection message in dialog window --- .../Assembly/App/opendcm/module3d/solver.hpp | 8 ++--- src/Mod/Assembly/Gui/CommandConstraints.cpp | 33 ++++++++++++------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/src/Mod/Assembly/App/opendcm/module3d/solver.hpp b/src/Mod/Assembly/App/opendcm/module3d/solver.hpp index 31823a109..d2ce5d1d9 100644 --- a/src/Mod/Assembly/App/opendcm/module3d/solver.hpp +++ b/src/Mod/Assembly/App/opendcm/module3d/solver.hpp @@ -382,10 +382,10 @@ void SystemSolver::solveCluster(boost::shared_ptr cluster, Sys& sy #ifdef USE_LOGGING BOOST_LOG(log)<< "non-cyclic system dedected" #endif - //cool, lets do uncylic. first all rotational constraints with rotational parameters - mes.setAccess(rotation); + //cool, lets do uncylic. first all rotational constraints with rotational parameters + mes.setAccess(rotation); mes.setGeneralEquationAccess(false); - //solve can be done without catching exceptions, because this only fails if the system in + //solve can be done without catching exceptions, because this only fails if the system is //unsolvable DummyScaler re; Kernel::solve(mes, re); @@ -414,7 +414,7 @@ void SystemSolver::solveCluster(boost::shared_ptr cluster, Sys& sy #ifdef USE_LOGGING BOOST_LOG(log)<< "Full scale solver used" #endif - Rescaler re(cluster, mes); + Rescaler re(cluster, mes); re(); Kernel::solve(mes, re); #ifdef USE_LOGGING diff --git a/src/Mod/Assembly/Gui/CommandConstraints.cpp b/src/Mod/Assembly/Gui/CommandConstraints.cpp index 198dbff5a..d415c9d38 100644 --- a/src/Mod/Assembly/Gui/CommandConstraints.cpp +++ b/src/Mod/Assembly/Gui/CommandConstraints.cpp @@ -125,14 +125,16 @@ void CmdAssemblyConstraintDistance::activated(int iMsg) std::vector objs = Gui::Selection().getSelectionEx(); if(objs.size() != 2) { - Base::Console().Message("you must select two geometries on two diffrent parts\n"); + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("You need to select two geometries on two different parts")); return; }; Assembly::ItemPart* part1 = Asm->getContainingPart(objs[0].getObject()); Assembly::ItemPart* part2 = Asm->getContainingPart(objs[1].getObject()); if(!part1 || !part2) { - Base::Console().Message("The selected objects need to belong to the active assembly\n"); + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("The selected parts need to belong to the active assembly (active product or one of it's subproducts)")); return; }; @@ -183,7 +185,8 @@ void CmdAssemblyConstraintFix::activated(int iMsg) std::vector objs = Gui::Selection().getSelectionEx(); if(objs.size() != 1) { - Base::Console().Message("you must select one part\n"); + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("You need to select one part only")); return; }; @@ -232,14 +235,16 @@ void CmdAssemblyConstraintAngle::activated(int iMsg) std::vector objs = Gui::Selection().getSelectionEx(); if(objs.size() != 2) { - Base::Console().Message("you must select two geometries on two diffrent parts\n"); + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("You need to select two geometries on two different parts")); return; }; Assembly::ItemPart* part1 = Asm->getContainingPart(objs[0].getObject()); Assembly::ItemPart* part2 = Asm->getContainingPart(objs[1].getObject()); if(!part1 || !part2) { - Base::Console().Message("The selected objects need to belong to the active assembly\n"); + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("The selected parts need to belong to the active assembly (active product or one of it's subproducts)")); return; }; @@ -292,14 +297,16 @@ void CmdAssemblyConstraintOrientation::activated(int iMsg) std::vector objs = Gui::Selection().getSelectionEx(); if(objs.size() != 2) { - Base::Console().Message("you must select two geometries on two diffrent parts\n"); + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("You need to select two geometries on two different parts")); return; }; Assembly::ItemPart* part1 = Asm->getContainingPart(objs[0].getObject()); Assembly::ItemPart* part2 = Asm->getContainingPart(objs[1].getObject()); if(!part1 || !part2) { - Base::Console().Message("The selected objects need to belong to the active assembly\n"); + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("The selected parts need to belong to the active assembly (active product or one of it's subproducts)")); return; }; @@ -354,14 +361,16 @@ void CmdAssemblyConstraintCoincidence::activated(int iMsg) std::vector objs = Gui::Selection().getSelectionEx(); if(objs.size() != 2) { - Base::Console().Message("you must select two geometries on two diffrent parts\n"); + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("You need to select two geometries on two different parts")); return; }; Assembly::ItemPart* part1 = Asm->getContainingPart(objs[0].getObject()); Assembly::ItemPart* part2 = Asm->getContainingPart(objs[1].getObject()); if(!part1 || !part2) { - Base::Console().Message("The selected objects need to belong to the active assembly\n"); + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("The selected parts need to belong to the active assembly (active product or one of it's subproducts)")); return; }; @@ -416,14 +425,16 @@ void CmdAssemblyConstraintAlignment::activated(int iMsg) std::vector objs = Gui::Selection().getSelectionEx(); if(objs.size() != 2) { - Base::Console().Message("you must select two geometries on two diffrent parts\n"); + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("You need to select two geometries on two different parts")); return; }; Assembly::ItemPart* part1 = Asm->getContainingPart(objs[0].getObject()); Assembly::ItemPart* part2 = Asm->getContainingPart(objs[1].getObject()); if(!part1 || !part2) { - Base::Console().Message("The selected objects need to belong to the active assembly\n"); + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("The selected parts need to belong to the active assembly (active product or one of it's subproducts)")); return; };