Some code unification for sketchbased features

This commit is contained in:
jrheinlaender
2013-05-23 17:33:23 +04:30
committed by Stefan Tröger
parent c382fb3afb
commit dfd27740a9
7 changed files with 31 additions and 75 deletions

View File

@@ -128,8 +128,7 @@ void TaskGrooveParameters::onAngleChanged(double len)
{
PartDesign::Groove* pcGroove = static_cast<PartDesign::Groove*>(vp->getObject());
pcGroove->Angle.setValue(len);
if (updateView())
pcGroove->getDocument()->recomputeFeature(pcGroove);
recomputeFeature();
}
void TaskGrooveParameters::onAxisChanged(int num)
@@ -166,24 +165,21 @@ void TaskGrooveParameters::onAxisChanged(int num)
}
}
}
if (updateView())
pcGroove->getDocument()->recomputeFeature(pcGroove);
recomputeFeature();
}
void TaskGrooveParameters::onMidplane(bool on)
{
PartDesign::Groove* pcGroove = static_cast<PartDesign::Groove*>(vp->getObject());
pcGroove->Midplane.setValue(on);
if (updateView())
pcGroove->getDocument()->recomputeFeature(pcGroove);
recomputeFeature();
}
void TaskGrooveParameters::onReversed(bool on)
{
PartDesign::Groove* pcGroove = static_cast<PartDesign::Groove*>(vp->getObject());
pcGroove->Reversed.setValue(on);
if (updateView())
pcGroove->getDocument()->recomputeFeature(pcGroove);
recomputeFeature();
}
double TaskGrooveParameters::getAngle(void) const
@@ -226,11 +222,6 @@ bool TaskGrooveParameters::getReversed(void) const
return ui->checkBoxReversed->isChecked();
}
const bool TaskGrooveParameters::updateView() const
{
return ui->checkBoxUpdateView->isChecked();
}
TaskGrooveParameters::~TaskGrooveParameters()
{
delete ui;