add two scaling modes

This commit is contained in:
Stefan Tröger
2015-06-01 06:58:40 +02:00
parent ad352e9b33
commit f199c844e6
7 changed files with 192 additions and 19 deletions

View File

@@ -537,6 +537,14 @@ TaskPipeScaling::TaskPipeScaling(ViewProviderPipe* PipeView, bool newObj, QWidge
this, SLOT(onButtonRefRemove(bool)));
connect(ui->stackedWidget, SIGNAL(currentChanged(int)),
this, SLOT(updateUI(int)));
connect(ui->linearSpinBox, SIGNAL(valueChanged(double)),
this, SLOT(onLinearSpinBox(double)));
connect(ui->sshapeSpinBox, SIGNAL(valueChanged(double)),
this, SLOT(onSshapeChanged(double)));
connect(ui->sshapeStartDeriSpinBox, SIGNAL(valueChanged(double)),
this, SLOT(onSshapeChanged(double)));
connect(ui->sshapeEndDeriSpinBox, SIGNAL(valueChanged(double)),
this, SLOT(onSshapeChanged(double)));
this->groupLayout()->addWidget(proxy);
@@ -582,8 +590,13 @@ void TaskPipeScaling::onButtonRefRemove(bool checked) {
void TaskPipeScaling::onScalingChanged(int idx) {
updateUI(idx);
static_cast<PartDesign::Pipe*>(vp->getObject())->Transformation.setValue(idx);
recomputeFeature();
if(idx==2)
onLinearSpinBox(ui->linearSpinBox->value());
else if(idx==3)
onSshapeChanged(0);
}
void TaskPipeScaling::onSelectionChanged(const SelectionChanges& msg) {
@@ -666,6 +679,23 @@ void TaskPipeScaling::updateUI(int idx) {
ui->stackedWidget->widget(idx)->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
}
void TaskPipeScaling::onLinearSpinBox(double val) {
static_cast<PartDesign::Pipe*>(vp->getObject())->ScalingData.setValue(Base::Vector3d(val,0,0));
recomputeFeature();
}
void TaskPipeScaling::onSshapeChanged(double val) {
double f, d0, d1;
f = ui->sshapeSpinBox->value();
d0 = ui->sshapeStartDeriSpinBox->value();
d1 = ui->sshapeEndDeriSpinBox->value();
static_cast<PartDesign::Pipe*>(vp->getObject())->ScalingData.setValue(Base::Vector3d(f, d0, d1));
recomputeFeature();
}
//**************************************************************************
//**************************************************************************