1#include "MosaicSceneWorkOrder.h"
3#include <QProgressDialog>
6#include "Footprint2DView.h"
7#include "MosaicSceneWidget.h"
11 MosaicSceneWorkOrder::MosaicSceneWorkOrder(QString actionText, MosaicSceneWidget *scene,
12 Project *project) : WorkOrder(project) {
14 QAction::setText(actionText);
15 QUndoCommand::setText(tr(
"%1 on [%2]").arg(actionText).arg(scene->windowTitle()));
18 data.append(scene->windowTitle());
19 setInternalData(data);
23 MosaicSceneWorkOrder::MosaicSceneWorkOrder(Project *project) :
28 MosaicSceneWorkOrder::MosaicSceneWorkOrder(
const MosaicSceneWorkOrder &other) :
36 MosaicSceneWorkOrder::~MosaicSceneWorkOrder() {
66 void MosaicSceneWorkOrder::restoreZPositions(
bool zValuesMightBeInUse) {
71 QProgressDialog progress(tr(
"Restoring Z Values"),
"", 0, imageList()->count());
72 progress.setCancelButton(NULL);
73 for (
int i = imageList()->count() - 1; i >= 0; i--) {
74 int originalZ = qRound(zPositions[i].
toDouble());
75 sceneWidget->
moveZ(imageList()->at(i), originalZ, zValuesMightBeInUse);
76 progress.setValue(progress.value() + 1);
81 void MosaicSceneWorkOrder::storeZPositions(QList<double> zPositions) {
83 data.append(internalData().first());
85 foreach (
double zPosition, zPositions) {
86 data.append(QString::number(qRound(zPosition)));
89 setInternalData(data);
This is free and unencumbered software released into the public domain.
double toDouble(const QString &string)
Global function to convert from a string to a double.