Fixed bugs in Transformed features

This commit is contained in:
Jan Rheinländer 2014-05-19 21:43:59 +02:00 committed by Stefan Tröger
parent 35e35527db
commit 0ddff2419f
3 changed files with 13 additions and 7 deletions

View File

@ -462,10 +462,11 @@ void TaskLinearPatternParameters::apply()
App::DocumentObject* obj;
getDirection(obj, directions);
std::string direction = getPythonStr(obj, directions);
if (!direction.empty()) {
if (!direction.empty() && obj) {
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Direction = %s", name.c_str(), direction.c_str());
} else
} else {
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Direction = None", name.c_str());
}
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Reversed = %u",name.c_str(),getReverse());
ui->spinLength->apply();

View File

@ -393,10 +393,11 @@ bool TaskDlgMirroredParameters::accept()
App::DocumentObject* obj;
mirrorParameter->getMirrorPlane(obj, mirrorPlanes);
std::string mirrorPlane = getPythonStr(obj, mirrorPlanes);
if (!mirrorPlane.empty()) {
if (!mirrorPlane.empty() && obj) {
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.MirrorPlane = %s", name.c_str(), mirrorPlane.c_str());
} else
} else {
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.MirrorPlane = None", name.c_str());
}
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.recompute()");
if (!TransformedView->getObject()->isValid())
throw Base::Exception(TransformedView->getObject()->getStatusString());

View File

@ -385,11 +385,15 @@ void TaskPolarPatternParameters::changeEvent(QEvent *e)
void TaskPolarPatternParameters::apply()
{
std::string name = TransformedView->getObject()->getNameInDocument();
std::string axis = getAxis();
if (!axis.empty()) {
std::vector<std::string> axes;
App::DocumentObject* obj;
getAxis(obj, axes);
std::string axis = getPythonStr(obj, axes);
if (!axis.empty() && obj) {
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Axis = %s", name.c_str(), axis.c_str());
} else
} else {
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Axis = None", name.c_str());
}
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Reversed = %u",name.c_str(),getReverse());
ui->polarAngle->apply();
ui->spinOccurrences->apply();