Skip to content
Snippets Groups Projects
Commit 9d02ca2e authored by Provot Bertrand's avatar Provot Bertrand
Browse files

test ready operation

parent 62e6dcdb
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,7 @@ using namespace imagein;
RotateOp::RotateOp() : Operation(qApp->translate("Operations", "Rotation").toStdString())
{
_test=false, _angle=0.00;
}
bool RotateOp::needCurrentImg() const {
......@@ -84,9 +85,13 @@ void RotateOp::operator()(const Image* img, const map<const Image*, string>& img
QObject::connect(buttonBox, SIGNAL(accepted()), dialog, SLOT(accept()));
QObject::connect(buttonBox, SIGNAL(rejected()), dialog, SLOT(reject()));
QDialog::DialogCode code = static_cast<QDialog::DialogCode>(dialog->exec());
if(code!=QDialog::Accepted) return;
if(_test){
angleSpinBox->setValue(_angle);
}
else{
QDialog::DialogCode code = static_cast<QDialog::DialogCode>(dialog->exec());
if(code!=QDialog::Accepted) return;
}
double angle = angleSpinBox->value() * acos(0)/90;
Image::depth_t fillValue = valueSpinBox->value();
......@@ -152,3 +157,11 @@ void RotateOp::operator()(const Image* img, const map<const Image*, string>& img
QString name = qApp->translate("Rotation", "rotated %1").arg(angleSpinBox->value());
this->outImage(resImg, name.toStdString());
}
void RotateOp::setTest(bool a){
_test =a;
}
void RotateOp::setAngle(double a){
_angle=a;
}
......@@ -43,6 +43,14 @@ public:
void operator()(const imagein::Image*, const std::map<const imagein::Image*, std::string>&);
bool needCurrentImg() const;
void setTest(bool);
void setAngle(double);
private:
bool _test;
double _angle;
};
#endif // ROTATEOP_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment