2 #include "MosaicSceneWorkOrder.h" 4 #include <QProgressDialog> 8 #include "MosaicSceneWidget.h" 12 MosaicSceneWorkOrder::MosaicSceneWorkOrder(QString actionText, MosaicSceneWidget *scene,
13 Project *project) : WorkOrder(project) {
15 QAction::setText(actionText);
16 QUndoCommand::setText(tr(
"%1 on [%2]").arg(actionText).arg(scene->windowTitle()));
19 data.append(scene->windowTitle());
20 setInternalData(data);
24 MosaicSceneWorkOrder::MosaicSceneWorkOrder(Project *project) :
29 MosaicSceneWorkOrder::MosaicSceneWorkOrder(
const MosaicSceneWorkOrder &other) :
56 result =
scene->mosaicSceneWidget();
70 ASSERT(zPositions.count() ==
imageList()->count());
74 QProgressDialog progress(tr(
"Restoring Z Values"),
"", 0,
imageList()->count());
75 progress.setCancelButton(NULL);
76 for (
int i =
imageList()->count() - 1; i >= 0; i--) {
77 int originalZ = qRound(zPositions[i].
toDouble());
78 sceneWidget->moveZ(
imageList()->at(i), originalZ, zValuesMightBeInUse);
79 progress.setValue(progress.value() + 1);
84 void MosaicSceneWorkOrder::storeZPositions(
QList<double> zPositions) {
88 foreach (
double zPosition, zPositions) {
89 data.append(QString::number(qRound(zPosition)));
double toDouble(const QString &string)
Global function to convert from a string to a double.
MosaicSceneWidget * scene()
Returns the MosaicSceneWidget corresponding to this work order's interal data (the MosaicSceneWidget'...
~MosaicSceneWorkOrder()
Destructor.
void restoreZPositions(bool zValuesMightBeInUse)
Namespace for ISIS/Bullet specific routines.
ImageList * imageList()
Returns a pointer to the ImageList for this WorkOrder.
QStringList internalData() const
Gets the internal data for this WorkOrder.
void setInternalData(QStringList data)
Sets the internal data for this WorkOrder.
Directory * directory() const
return the workorder project directory Returns the Directory object of the Project this WorkOrder is ...