27#include <QApplication>
34#include <QFutureWatcher>
37#include <QMutexLocker>
38#include <QProgressBar>
45#include <QXmlStreamWriter>
47#include "BundleSettings.h"
48#include "BundleSolutionInfo.h"
51#include "ControlList.h"
52#include "ControlNet.h"
53#include "CorrelationMatrix.h"
56#include "Environment.h"
59#include "GuiCameraList.h"
61#include "ImageReader.h"
62#include "IException.h"
63#include "ProgressBar.h"
64#include "ProjectItem.h"
65#include "ProjectItemModel.h"
66#include "SerialNumberList.h"
71#include "ShapeReader.h"
73#include "TargetBodyList.h"
75#include "TemplateList.h"
77#include "WorkOrderFactory.h"
78#include "XmlStackedHandlerReader.h"
89 m_bundleSettings = NULL;
95 m_idToImageMap = NULL;
96 m_idToShapeMap = NULL;
97 m_idToTargetBodyMap = NULL;
98 m_idToGuiCameraMap = NULL;
100 m_imageReader = NULL;
101 m_shapeReader = NULL;
103 m_mapTemplates = NULL;
104 m_regTemplates = NULL;
106 m_workOrderHistory = NULL;
107 m_isTemporaryProject =
true;
110 m_activeControl = NULL;
111 m_activeImageList = NULL;
116 m_workOrderMutex = NULL;
117 m_imageReadingMutex = NULL;
119 m_numShapesCurrentlyReading = 0;
121 m_shapeReadingMutex = NULL;
124 m_idToImageMap =
new QMap<QString, Image *>;
125 m_idToShapeMap =
new QMap<QString, Shape *>;
126 m_idToTargetBodyMap =
new QMap<QString, TargetBody *>;
127 m_idToGuiCameraMap =
new QMap<QString, GuiCamera *>;
128 m_idToBundleSolutionInfoMap =
new QMap<QString, BundleSolutionInfo *>;
133 QDir tempDir = QDir::temp();
136 QApplication::applicationName() +
"_*");
137 tempDir.setNameFilters(nameFilters);
139 QStringList existingProjects = tempDir.entryList();
140 bool crashedPreviously =
false;
142 foreach (QString existingProject, existingProjects) {
143 FileName existingProjectFileName(tempDir.absolutePath() +
"/" + existingProject);
144 QString pidString = QString(existingProject).replace(QRegExp(
".*_"),
"");
145 int otherPid = pidString.toInt();
148 if ( !QFile::exists(
"/proc/" + pidString) ) {
149 crashedPreviously =
true;
150 int status = system( (
"rm -rf '" +
151 existingProjectFileName.expanded() +
"' &").toLatin1().data() );
153 QString msg =
"Executing command [rm -rf" + existingProjectFileName.expanded() +
154 "' &] failed with return status [" +
toString(status) +
"]";
161 if (crashedPreviously &&
false) {
162 QMessageBox::information( NULL,
163 QObject::tr(
"Crashed"),
164 QObject::tr(
"It appears %1 crashed. We're sorry.").
165 arg( QApplication::applicationName() ) );
168 QCoreApplication* ipce_app =
static_cast<QCoreApplication *
>(
directory.parent());
171 QString tmpFolder = QDir::temp().absolutePath() +
"/"
173 + QApplication::applicationName() +
"_" + QString::number( getpid() );
174 QDir temp(tmpFolder +
"/tmpProject");
175 m_projectRoot =
new QDir(temp);
177 if (ipce_app->arguments().count() == 1) {
184 catch (std::exception &e) {
187 tr(
"Error creating project folders [%1]").arg( e.what() ), _FILEINFO_);
191 m_mutex =
new QMutex;
192 m_workOrderMutex =
new QMutex;
207 connect(m_directory, SIGNAL(cleanProject(
bool)),
210 m_images =
new QList<ImageList *>;
213 m_shapeMutex =
new QMutex;
215 m_shapeReader =
new ShapeReader(m_shapeMutex,
false);
217 connect( m_shapeReader, SIGNAL( shapesReady(
ShapeList) ),
220 m_shapes =
new QList<ShapeList *>;
222 m_controls =
new QList<ControlList *>;
226 m_mapTemplates =
new QList<TemplateList *>;
228 m_regTemplates =
new QList<TemplateList *>;
232 m_bundleSolutionInfo =
new QList<BundleSolutionInfo *>;
235 m_workOrderHistory =
new QList< QPointer<WorkOrder> >;
237 m_imageReadingMutex =
new QMutex;
239 m_shapeReadingMutex =
new QMutex;
300 if (m_mapTemplates) {
302 foreach (
Template *templateFile, *templateList) {
309 delete m_mapTemplates;
310 m_mapTemplates = NULL;
314 if (m_regTemplates) {
316 foreach (
Template *templateFile, *templateList) {
323 delete m_regTemplates;
324 m_regTemplates = NULL;
328 m_activeControl = NULL;
329 m_activeImageList = NULL;
331 if (m_bundleSolutionInfo) {
336 delete m_bundleSolutionInfo;
337 m_bundleSolutionInfo = NULL;
343 delete m_idToImageMap;
344 m_idToImageMap = NULL;
346 delete m_idToShapeMap;
347 m_idToShapeMap = NULL;
349 delete m_idToTargetBodyMap;
350 m_idToTargetBodyMap = NULL;
352 delete m_idToGuiCameraMap;
353 m_idToGuiCameraMap = NULL;
355 delete m_idToBundleSolutionInfoMap;
356 m_idToBundleSolutionInfoMap = NULL;
360 delete m_projectRoot;
361 m_projectRoot = NULL;
366 delete m_imageReader;
367 delete m_shapeReader;
372 m_workOrderHistory->removeAll(NULL);
373 m_workOrderHistory = NULL;
375 delete m_bundleSettings;
376 m_bundleSettings = NULL;
385 if ( !dir.mkpath( m_projectRoot->path() ) ) {
386 warn(
"Cannot create project directory.");
388 tr(
"Unable to create folder [%1] when trying to initialize project")
389 .arg(m_projectRoot->path() ),
395 QString msg = QString(
"Unable to create folder [%1] when trying to initialize project")
402 QString msg = QString(
"Unable to create folder [%1] when trying to initialize project")
409 QString msg = QString(
"Unable to create folder [%1] when trying to initialize project")
416 QString msg = QString(
"Unable to create folder [%1] when trying to initialize project")
422 QString msg = QString(
"Unable to create folder [%1] when trying to initialize project")
428 QString msg = QString(
"Unable to create folder [%1] when trying to initialize project")
434 QString msg = QString(
"Unable to create folder [%1] when trying to initialize project")
439 if ( !dir.mkdir(
templateRoot() +
"/registrations" ) ) {
440 QString msg = QString(
"Unable to create folder [%1] when trying to initialize project")
447 warn(
"Failed to create project directory structure");
473 bool bundles =
false;
476 if (projectXml.open(QIODevice::ReadOnly)) {
477 QTextStream projectXmlInput(&projectXml);
479 while (!projectXmlInput.atEnd() ) {
481 QString line = projectXmlInput.readLine();
483 if (
controls || line.contains(
"<controlNets>") ) {
486 if (line.contains(
"</controlNets>") ) {
490 else if (!line.contains(
"<controlNets>") ) {
491 cnetDirList.append(line.split(
'"').at(3));
495 else if (
images || line.contains(
"<imageLists>") ) {
498 if (line.contains(
"</imageLists>")) {
502 else if (!line.contains(
"<imageLists>") ) {
503 imageDirList.append(line.split(
'"').at(3).simplified());
507 else if (
shapes || line.contains(
"<shapeLists>")) {
510 if (line.contains(
"</shapeLists>") ) {
514 else if (!line.contains(
"<shapeLists>") ) {
515 shapeDirList.append(line.split(
'"').at(3));
519 else if (
mapTemplates || line.contains(
"<mapTemplateLists>") ) {
522 if (line.contains(
"</mapTemplateLists>") ) {
526 else if (!line.contains(
"<mapTemplateLists>") ) {
527 QList<QString> components = line.split(
'"');
528 mapTemplateDirList.append(components.at(5));
532 else if (
regTemplates || line.contains(
"<regTemplateLists>") ) {
535 if (line.contains(
"</regTemplateLists>") ) {
539 else if (!line.contains(
"<regTemplateLists>") ) {
540 QList<QString> components = line.split(
'"');
541 regTemplateDirList.append(components.at(5));
545 else if (bundles || line.contains(
"<bundleSolutionInfo>") ) {
548 if (line.contains(
"</bundleSolutionInfo>") ) {
552 else if (line.contains(
"<runTime>") ) {
553 bundleDirList.append(line.split(
'>').at(1).split(
'<').at(0));
558 QDir cnetsDir(m_projectRoot->path() +
"/cnets/");
559 cnetsDir.setFilter(QDir::NoDotAndDotDot | QDir::Dirs);
561 foreach (QString dir, cnetsList) {
562 dir = dir.simplified();
564 if ( !cnetDirList.contains(dir) ) {
565 QDir tempDir(cnetsDir.path() +
"/" + dir);
566 tempDir.removeRecursively();
570 QDir imagesDir(m_projectRoot->path() +
"/images/");
571 imagesDir.setFilter(QDir::NoDotAndDotDot | QDir::Dirs);
573 foreach (QString dir, imagesList) {
574 dir = dir.simplified();
576 if ( !imageDirList.contains(dir) ) {
577 QDir tempDir(imagesDir.path() +
"/" + dir);
578 tempDir.removeRecursively();
582 QDir shapesDir(m_projectRoot->path() +
"/shapes/");
583 shapesDir.setFilter(QDir::NoDotAndDotDot | QDir::Dirs);
585 foreach (QString dir, shapesList) {
586 dir = dir.simplified();
588 if ( !shapeDirList.contains(dir) ) {
589 QDir tempDir(shapesDir.path() +
"/" + dir);
590 tempDir.removeRecursively();
594 QDir mapTemplatesDir(m_projectRoot->path() +
"/templates/maps");
595 mapTemplatesDir.setFilter(QDir::NoDotAndDotDot | QDir::Dirs);
596 QStringList mapTemplatesList = mapTemplatesDir.entryList();
597 foreach (QString dir, mapTemplatesList) {
598 dir = dir.simplified();
600 if ( !mapTemplateDirList.contains(
"maps/" + dir) ) {
601 QDir tempDir(mapTemplatesDir.path() +
"/" + dir);
602 tempDir.removeRecursively();
606 QDir regTemplatesDir(m_projectRoot->path() +
"/templates/registrations");
607 regTemplatesDir.setFilter(QDir::NoDotAndDotDot | QDir::Dirs);
608 QStringList regTemplatesList = regTemplatesDir.entryList();
609 foreach (QString dir, regTemplatesList) {
610 dir = dir.simplified();
612 if ( !regTemplateDirList.contains(
"registrations/" + dir)) {
613 QDir tempDir(regTemplatesDir.path() +
"/" + dir);
614 tempDir.removeRecursively();
618 QDir bundlesDir(m_projectRoot->path() +
"/results/bundle/");
619 bundlesDir.setFilter(QDir::NoDotAndDotDot | QDir::Dirs);
621 foreach (QString dir, bundleList) {
622 dir = dir.simplified();
624 if ( !bundleDirList.contains(dir) ) {
625 QDir tempDir(bundlesDir.path() +
"/" + dir);
626 tempDir.removeRecursively();
634 QString tmpFolder = QDir::temp().absolutePath() +
"/"
636 + QApplication::applicationName() +
"_" + QString::number( getpid() );
637 QDir temp(tmpFolder +
"/tmpProject");
638 m_projectRoot =
new QDir(temp);
645 catch (std::exception &e) {
647 tr(
"Error creating project folders [%1]").arg( e.what() ), _FILEINFO_);
653 m_mapTemplates->clear();
654 m_regTemplates->clear();
656 m_guiCameras->
clear();
657 m_bundleSolutionInfo->clear();
658 m_workOrderHistory->clear();
665 bool Project::clearing() {
670 ImageList *Project::createOrRetrieveImageList(QString name, QString path) {
683 connect( result, SIGNAL( destroyed(
QObject *) ),
685 m_images->append(result);
691 ShapeList *Project::createOrRetrieveShapeList(QString name, QString path) {
704 connect( result, SIGNAL( destroyed(
QObject *) ),
706 m_shapes->append(result);
726 stream.writeStartElement(
"project");
728 stream.writeAttribute(
"name", m_name);
730 if ( !m_controls->isEmpty() ) {
731 stream.writeStartElement(
"controlNets");
733 for (
int i = 0; i < m_controls->count(); i++) {
737 stream.writeEndElement();
740 if ( !m_images->isEmpty() ) {
741 stream.writeStartElement(
"imageLists");
742 for (
int i = 0; i < m_images->count(); i++) {
746 stream.writeEndElement();
749 if ( !m_shapes->isEmpty() ) {
750 stream.writeStartElement(
"shapeLists");
752 for (
int i = 0; i < m_shapes->count(); i++) {
756 stream.writeEndElement();
759 if ( !m_mapTemplates->isEmpty() ) {
760 stream.writeStartElement(
"mapTemplateLists");
762 for (
int i = 0; i < m_mapTemplates->count(); i++) {
766 stream.writeEndElement();
769 if ( !m_regTemplates->isEmpty() ) {
770 stream.writeStartElement(
"regTemplateLists");
772 for (
int i = 0; i < m_regTemplates->count(); i++) {
776 stream.writeEndElement();
809 if ( !m_bundleSolutionInfo->isEmpty() ) {
810 stream.writeStartElement(
"results");
812 for (
int i = 0; i < m_bundleSolutionInfo->count(); i++) {
816 stream.writeEndElement();
819 if (m_activeImageList) {
820 stream.writeStartElement(
"activeImageList");
821 stream.writeAttribute(
"displayName", m_activeImageList->name());
822 stream.writeEndElement();
825 if (m_activeControl) {
826 stream.writeStartElement(
"activeControl");
827 stream.writeAttribute(
"displayName", m_activeControl->displayProperties()->displayName());
828 stream.writeEndElement();
831 stream.writeEndElement();
851 stream.writeStartElement(
"history");
853 foreach (
WorkOrder *workOrder, *m_workOrderHistory) {
855 workOrder->save(stream);
859 stream.writeEndElement();
874 stream.writeStartElement(
"warnings");
876 foreach (QString warning, *m_warnings) {
877 stream.writeStartElement(
"warning");
878 stream.writeAttribute(
"text", warning);
879 stream.writeEndElement();
882 stream.writeEndElement();
897 foreach (QString fileName, fileNames) {
900 result.append(fileName);
928 int prefixCounter = 0;
930 QString numberedPrefix;
933 numberedPrefix = prefix.arg( QString::number(prefixCounter) );
935 while ( cnetFolder.exists(numberedPrefix) );
937 if ( !cnetFolder.mkpath(numberedPrefix) ) {
939 tr(
"Could not create control network directory [%1] in [%2].")
940 .arg(numberedPrefix).arg( cnetFolder.absolutePath() ),
944 cnetFolder.cd(numberedPrefix);
946 m_currentCnetFolder = cnetFolder;
972 ControlList *Project::createOrRetrieveControlList(QString name, QString path) {
986 connect( result, SIGNAL( destroyed(
QObject *) ),
989 m_controls->append(result);
1005 int prefixCounter = 0;
1007 QString numberedPrefix;
1010 numberedPrefix = prefix.arg( QString::number(prefixCounter) );
1012 while ( imageFolder.exists(numberedPrefix) );
1014 if ( !imageFolder.mkpath(numberedPrefix) ) {
1016 tr(
"Could not create image directory [%1] in [%2].")
1017 .arg(numberedPrefix).arg( imageFolder.absolutePath() ),
1021 imageFolder.cd(numberedPrefix);
1033 m_imageReadingMutex->lock();
1037 m_imageReader->read(imageFiles);
1062 int prefixCounter = 0;
1064 QString numberedPrefix;
1067 numberedPrefix = prefix.arg( QString::number(prefixCounter) );
1069 while ( shapeFolder.exists(numberedPrefix) );
1071 if ( !shapeFolder.mkpath(numberedPrefix) ) {
1073 tr(
"Could not create shape directory [%1] in [%2].")
1074 .arg(numberedPrefix).arg( shapeFolder.absolutePath() ),
1078 shapeFolder.cd(numberedPrefix);
1089 if (m_numShapesCurrentlyReading == 0) {
1090 m_shapeReadingMutex->lock();
1093 m_numShapesCurrentlyReading += shapeFiles.count();
1094 m_shapeReader->read(shapeFiles);
1103 shapesReady(newShapes);
1113 foreach (
Template *templateFile, *templateList) {
1115 templateFile, SLOT( updateFileName(
Project *) ) );
1117 if (templateList->
type() ==
"maps") {
1118 m_mapTemplates->append(templateList);
1120 else if (templateList->
type() ==
"registrations") {
1121 m_regTemplates->append(templateList);
1124 emit templatesAdded(templateList);
1136 int prefixCounter = 0;
1137 QString numberedPrefix;
1141 numberedPrefix = prefix.arg( QString::number(prefixCounter) );
1143 while ( templateFolder.exists(numberedPrefix) );
1145 if ( !templateFolder.mkpath(numberedPrefix) ) {
1147 tr(
"Could not create template directory [%1] in [%2].")
1148 .arg(numberedPrefix).arg( templateFolder.absolutePath() ),
1152 templateFolder.cd(numberedPrefix);
1154 return templateFolder;
1176 if (!bundleSolutionInfoFolder.mkpath(folder)) {
1178 tr(
"Could not create bundle results directory [%1] in [%2].")
1179 .arg(folder).arg(bundleSolutionInfoFolder.absolutePath()),
1183 bundleSolutionInfoFolder.cd(folder);
1184 return bundleSolutionInfoFolder;
1233 void Project::writeSettings() {
1235 QString appName = QApplication::applicationName();
1238 QSettings globalSettings(
1239 FileName(
"$HOME/.Isis/" + appName +
"/" + appName +
"_" +
"Project.config")
1241 QSettings::NativeFormat);
1243 globalSettings.beginGroup(
"recent_projects");
1245 QMap<QString,QString> recentProjects;
1247 foreach (QString key,keys) {
1249 recentProjects[key]=globalSettings.value(key).toString();
1253 QList<QString> projectPaths = recentProjects.values();
1255 if (keys.count() >= m_maxRecentProjects) {
1258 globalSettings.remove(
"");
1264 if (!this->
projectRoot().contains(
"tmpProject") && !projectPaths.contains(this->projectRoot()) ) {
1265 QString s=keys.first();
1266 recentProjects.remove( s );
1272 if (projectPaths.contains(this->projectRoot())) {
1273 QString key = recentProjects.key(this->
projectRoot());
1274 recentProjects.remove(key);
1280 for (i=recentProjects.begin();i!=recentProjects.end();i++) {
1282 globalSettings.setValue(i.key(),i.value());
1287 long t0 = QDateTime::currentMSecsSinceEpoch();
1288 QString projName = this->
name();
1290 QString t0String=QString::number(t0);
1293 if (!this->
projectRoot().contains(
"tmpProject") ) {
1294 globalSettings.setValue(t0String+
"%%%%%"+projName,this->
projectRoot());
1304 globalSettings.remove(
"");
1305 if (projectPaths.contains(this->projectRoot())) {
1306 QString key = recentProjects.key(this->
projectRoot());
1307 recentProjects.remove(key);
1312 for ( i=recentProjects.begin(); i!=recentProjects.end(); i++ ) {
1313 globalSettings.setValue(i.key(),i.value());
1316 long t0 = QDateTime::currentMSecsSinceEpoch();
1317 QString projName = this->
name();
1318 QString t0String=QString::number(t0);
1321 if (!this->
projectRoot().contains(
"tmpProject") ) {
1322 globalSettings.setValue(t0String+
"%%%%%"+projName,this->
projectRoot());
1328 globalSettings.endGroup();
1346 QString projectAbsolutePathStr = QDir(projectPathStr).absolutePath();
1348 QString projectXmlPath = projectAbsolutePathStr +
"/project.xml";
1349 QFile file(projectXmlPath);
1351 if ( !file.open(QFile::ReadOnly) ) {
1353 QString(
"Unable to open [%1] with read access")
1354 .arg(projectXmlPath),
1358 QString projectXmlHistoryPath = projectAbsolutePathStr +
"/history.xml";
1359 QFile historyFile(projectXmlHistoryPath);
1361 if ( !historyFile.open(QFile::ReadOnly) ) {
1363 QString(
"Unable to open [%1] with read access")
1364 .arg(projectXmlHistoryPath),
1368 QString projectXmlWarningsPath = projectAbsolutePathStr +
"/warnings.xml";
1369 QFile warningsFile(projectXmlWarningsPath);
1371 if (!warningsFile.open(QFile::ReadOnly)) {
1373 QString(
"Unable to open [%1] with read access")
1374 .arg(projectXmlWarningsPath),
1378 QString directoryXmlPath = projectAbsolutePathStr +
"/directory.xml";
1379 QFile directoryFile(directoryXmlPath);
1381 if (!directoryFile.open(QFile::ReadOnly)) {
1383 QString(
"Unable to open [%1] with read access")
1384 .arg(directoryXmlPath),
1392 m_isTemporaryProject =
false;
1398 reader.setErrorHandler(&handler);
1400 QDir oldProjectRoot(*m_projectRoot);
1401 *m_projectRoot = QDir(projectAbsolutePathStr);
1403 QXmlInputSource xmlInputSource(&file);
1409 reader.parse(xmlInputSource);
1413 .arg(projectAbsolutePathStr));
1416 catch (std::exception &e) {
1418 .arg(projectAbsolutePathStr));
1423 QXmlInputSource xmlHistoryInputSource(&historyFile);
1426 reader.parse(xmlHistoryInputSource);
1431 .arg(projectAbsolutePathStr));
1434 catch (std::exception &e) {
1436 .arg(projectAbsolutePathStr));
1442 QXmlInputSource xmlWarningsInputSource(&warningsFile);
1444 if (!reader.parse(xmlWarningsInputSource)) {
1445 warn(tr(
"Failed to read warnings from project [%1]").arg(projectAbsolutePathStr));
1450 QXmlInputSource xmlDirectoryInputSource(&directoryFile);
1453 reader.parse(xmlDirectoryInputSource);
1457 .arg(projectAbsolutePathStr));
1461 catch (std::exception &e) {
1463 .arg(projectAbsolutePathStr));
1468 if (bundleRoot.exists()) {
1470 bundleRoot.setFilter(QDir::AllDirs | QDir::NoDotAndDotDot | QDir::NoSymLinks);
1472 QFileInfoList bundleDirs = bundleRoot.entryInfoList();
1474 for (
int dirListIndex = 0; dirListIndex < bundleDirs.size(); dirListIndex++) {
1477 QDir bundleSolutionDir(bundleDirs[dirListIndex].absoluteFilePath());
1478 bundleSolutionDir.setFilter(QDir::Files | QDir::NoSymLinks);
1499 return m_imageReader->progress();
1510 return (*m_idToImageMap)[id];
1520 QListIterator<ImageList *> it(*m_images);
1523 while (it.hasNext() && !result) {
1526 if (list->
name() ==
name) result = list;
1539 return (*m_idToShapeMap)[id];
1549 QListIterator<ShapeList *> it(*m_shapes);
1552 while (it.hasNext() && !result) {
1555 if (list->
name() ==
name) result = list;
1567 return m_isTemporaryProject;
1596 m_undoStack.cleanChanged(value);
1606 QListIterator< QPointer<WorkOrder> > it(*m_workOrderHistory);
1609 while ( !result && it.hasPrevious() ) {
1612 if ( !workOrder->isUndone() && !workOrder->isUndoing() ) {
1635 QListIterator< QPointer<WorkOrder> > it(*m_workOrderHistory);
1638 while ( !result && it.hasPrevious() ) {
1641 if ( !workOrder->isUndone() && !workOrder->isUndoing() ) {
1666 return m_projectRoot->path();
1675 return m_newProjectRoot;
1694 return &m_undoStack;
1698 QString Project::nextImageListGroupName() {
1699 int numLists = m_images->size();
1700 QString maxName =
"";
1701 QString newGroupName =
"Group";
1705 if ( !
name.contains(
"Group") )
continue;
1706 if ( maxName.isEmpty() ) {
1709 else if (
name > maxName) {
1714 if ( maxName.isEmpty() ) {
1715 newGroupName += QString::number(numLists+1);
1718 int maxNum = maxName.remove(
"Group").toInt();
1721 newGroupName += QString::number(maxNum);
1723 return newGroupName;
1732 QMutexLocker locker(m_imageReadingMutex);
1740 QMutexLocker locker(m_shapeReadingMutex);
1748 QList<WorkOrder *> result;
1749 foreach (
WorkOrder *workOrder, *m_workOrderHistory) {
1750 result.append(workOrder);
1767 if (m_activeControl && m_activeImageList) {
1819 Control *previousControl = m_activeControl;
1820 if (m_activeControl) {
1824 if (m_activeControl->isModified()) {
1826 msgBox.setText(
"Save current active control");
1827 msgBox.setInformativeText(
"The current active control has been modified. Do you want "
1828 "to save before setting a new active control?");
1829 msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
1830 msgBox.setDefaultButton(QMessageBox::Save);
1831 int ret = msgBox.exec();
1834 case QMessageBox::Save:
1835 m_activeControl->write();
1838 case QMessageBox::Discard:
1840 m_activeControl->closeControlNet();
1841 m_activeControl->openControlNet();
1842 emit discardActiveControlEdits();
1845 case QMessageBox::Cancel:
1851 displayProperties()->displayName(), Qt::DisplayRole);
1852 item->setTextColor(Qt::black);
1854 if (!
directory()->controlUsedInCnetEditorWidget(m_activeControl)) {
1855 m_activeControl->closeControlNet();
1861 m_activeControl = item->
control();
1864 m_activeControl->controlNet()->SetImages(*(
activeImageList()->serialNumberList()));
1865 item->setTextColor(Qt::darkGreen);
1868 if (previousControl) {
1869 m_activeControl = previousControl;
1871 displayProperties()->displayName(), Qt::DisplayRole);
1872 item->setTextColor(Qt::darkGreen);
1873 m_activeControl->controlNet()->SetImages(*(
activeImageList()->serialNumberList()));
1876 m_activeControl = NULL;
1904 if (!m_activeControl && (m_controls->count() == 1 && m_controls->at(0)->count() ==1)) {
1907 QString controlName = m_controls->at(0)->at(0)->displayProperties()->displayName();
1912 return m_activeControl;
1924 if (m_activeControl && m_activeControl->isModified()) {
1955 ImageList *previousImageList = m_activeImageList;
1956 if (m_activeImageList) {
1958 name(), Qt::DisplayRole);
1959 item->setTextColor(Qt::black);
1965 if (m_activeControl) {
1970 if (previousImageList) {
1971 m_activeImageList = previousImageList;
1973 name(), Qt::DisplayRole);
1974 item->setTextColor(Qt::darkGreen);
1978 m_activeImageList = NULL;
1983 item->setTextColor(Qt::darkGreen);
2004 if (!m_activeImageList && m_images->count() == 1) {
2005 QString
imageList = m_images->at(0)->name();
2009 return m_activeImageList;
2029 return cnetRoot( m_projectRoot->path() );
2048 QListIterator< ControlList * > it(*m_controls);
2051 while (it.hasNext() && !result) {
2054 if (list->
name() ==
name) result = list;
2145 QList<TemplateList *> allTemplates = *m_mapTemplates + *m_regTemplates;
2146 return allTemplates;
2156 return *m_mapTemplates;
2166 return *m_regTemplates;
2223 return *m_bundleSolutionInfo;
2257 foreach (
ImageList *imagesInAFolder, *m_images) {
2258 imagesInAFolder->deleteFromDisk(
this);
2262 warn( tr(
"Did not properly clean up images folder [%1] in project").arg(
imageDataRoot() ) );
2265 foreach (
ShapeList *shapesInAFolder, *m_shapes) {
2266 shapesInAFolder->deleteFromDisk(
this);
2270 warn( tr(
"Did not properly clean up shapes folder [%1] in project").
2274 foreach (
ControlList *controlsInAFolder, *m_controls) {
2275 controlsInAFolder->deleteFromDisk(
this);
2278 if ( !m_projectRoot->rmdir(
cnetRoot() ) ) {
2279 warn( tr(
"Did not properly clean up control network folder [%1] in project")
2283 if ( !(QDir(
resultsRoot()).removeRecursively()) ) {
2284 warn( tr(
"Did not properly clean up results folder [%1] in project")
2289 warn( tr(
"Did not properly clean up templates folder [%1] in project")
2293 if ( !m_projectRoot->rmpath( m_projectRoot->path() ) ) {
2294 warn( tr(
"Did not properly clean up project in [%1]").arg( m_projectRoot->path() ) );
2325 bool saveDialogCompleted =
true;
2327 if (m_isTemporaryProject) {
2328 QString newDestination = QFileDialog::getSaveFileName(NULL,
2329 QString(
"Project Location"),
2332 if ( !newDestination.isEmpty() ) {
2333 m_isTemporaryProject =
false;
2334 save( QFileInfo(newDestination +
"/").absolutePath() );
2344 open(newDestination);
2348 saveDialogCompleted =
false;
2362 save(m_projectRoot->absolutePath(),
false);
2366 return saveDialogCompleted;
2472 if ( verifyPathDoesntExist && QFile::exists( newPath.toString() ) ) {
2474 QString(
"Projects may not be saved to an existing path [%1]; "
2475 "please select a new path or delete the current folder")
2476 .arg(newPath.original()),
2481 if (!dir.mkpath(newPath.toString())) {
2483 QString(
"Unable to save project at [%1] "
2484 "because we could not create the folder")
2485 .arg(newPath.original()),
2493 m_newProjectRoot = newPath.toString();
2498 m_name = newPath.name();
2500 QFile projectSettingsFile(newPath.toString() +
"/project.xml");
2501 if (!projectSettingsFile.open(QIODevice::ReadWrite | QIODevice::Truncate)) {
2503 QString(
"Unable to save project at [%1] because the file [%2] "
2504 "could not be opened for writing")
2505 .arg(newPath.original()).arg(projectSettingsFile.fileName()),
2509 QXmlStreamWriter writer(&projectSettingsFile);
2510 writer.setAutoFormatting(
true);
2512 writer.writeStartDocument();
2515 save(writer, newPath);
2517 writer.writeEndDocument();
2519 QFile projectHistoryFile(newPath.toString() +
"/history.xml");
2520 if (!projectHistoryFile.open(QIODevice::ReadWrite | QIODevice::Truncate)) {
2522 QString(
"Unable to save project at [%1] because the file [%2] "
2523 "could not be opened for writing")
2524 .arg(newPath.original()).arg(projectHistoryFile.fileName()),
2528 QXmlStreamWriter historyWriter(&projectHistoryFile);
2529 historyWriter.setAutoFormatting(
true);
2531 historyWriter.writeStartDocument();
2533 historyWriter.writeEndDocument();
2535 QFile projectWarningsFile(newPath.toString() +
"/warnings.xml");
2536 if (!projectWarningsFile.open(QIODevice::ReadWrite | QIODevice::Truncate)) {
2538 QString(
"Unable to save project at [%1] because the file [%2] could not be "
2539 "opened for writing")
2540 .arg(newPath.original()).arg(projectWarningsFile.fileName()),
2544 QXmlStreamWriter warningsWriter(&projectWarningsFile);
2545 warningsWriter.setAutoFormatting(
true);
2547 warningsWriter.writeStartDocument();
2549 warningsWriter.writeEndDocument();
2552 QFile directoryStateFile(newPath.toString() +
"/directory.xml");
2553 if (!directoryStateFile.open(QIODevice::ReadWrite | QIODevice::Truncate)) {
2555 QString(
"Unable to save project at [%1] because the file [%2] could not be "
2556 "opened for writing")
2557 .arg(newPath.original()).arg(directoryStateFile.fileName()),
2561 QXmlStreamWriter directoryStateWriter(&directoryStateFile);
2562 directoryStateWriter.setAutoFormatting(
true);
2564 directoryStateWriter.writeStartDocument();
2571 m_directory->save(directoryStateWriter, newPath);
2573 directoryStateWriter.writeEndDocument();
2599 connect(workOrder, SIGNAL(finished(
WorkOrder *)),
2604 if (workOrder->setupExecution()) {
2605 if (workOrder->previous()) workOrder->previous()->setNext(workOrder);
2607 m_workOrderHistory->append(workOrder);
2609 if (workOrder->isSavedToHistory()) {
2615 if (workOrder->createsCleanState()) {
2616 m_undoStack.setClean();
2617 workOrder->execute();
2620 else if (workOrder->isUndoable()) {
2623 m_undoStack.push(workOrder);
2632 m_workOrderHistory->removeAll(NULL);
2642 template<
typename Data>
void Project::warn(QString text, Data relevantData) {
2643 storeWarning(text, relevantData);
2648 void Project::warn(QString text) {
2649 foreach (QString line, text.split(
"\n")) {
2656 void Project::storeWarning(QString text) {
2657 m_warnings->append(text);
2676 if (
images.name() !=
"") {
2688 QMutexLocker lock(m_mutex);
2692 foreach (openImage,
images) {
2703 m_imageReadingMutex->unlock();
2716 if (QString::compare(targetBody->targetName(),
id, Qt::CaseInsensitive) == 0) {
2733 m_targets->
append(targetBody);
2747 if (QString::compare(camera->instrumentId(),
id, Qt::CaseInsensitive) == 0) {
2764 m_guiCameras->
append(guiCamera);
2785 void Project::removeImages(
ImageList &imageList) {
2791 m_images->removeOne(list);
2802 QMutableListIterator<ImageList *> it(*m_images);
2803 while (it.hasNext()) {
2806 int foundElement = list->indexOf((
Image *)imageObj);
2808 if (foundElement != -1) {
2813 m_idToImageMap->remove(m_idToImageMap->key((
Image *)imageObj));
2822 int indexToRemove = m_images->indexOf(
static_cast<ImageList *
>(imageListObj));
2823 if (indexToRemove != -1) {
2824 m_images->removeAt(indexToRemove);
2841 int indexToRemove = m_controls->indexOf(
static_cast<ControlList *
>(controlListObj));
2842 if (indexToRemove != -1) {
2843 m_controls->removeAt(indexToRemove);
2856 int indexToRemove = m_shapes->indexOf(
static_cast<ShapeList *
>(shapeListObj));
2857 if (indexToRemove != -1) {
2858 m_shapes->removeAt(indexToRemove);
2867 QMutableListIterator<BundleSolutionInfo *> it(*m_bundleSolutionInfo);
2868 while (it.hasNext()) {
2874 int foundElement = m_bundleSolutionInfo->indexOf(
2877 if (foundElement != -1) {
2878 m_bundleSolutionInfo->removeAt(foundElement);
2882 m_idToBundleSolutionInfoMap->remove(
2912 void Project::shapesReady(
ShapeList shapes) {
2914 m_numShapesCurrentlyReading -=
shapes.count();
2923 if (
shapes.name() !=
"") {
2936 QMutexLocker lock(m_shapeMutex);
2940 foreach (openShape,
shapes) {
2944 if (m_numShapesCurrentlyReading == 0) {
2945 m_shapeReadingMutex->unlock();
2954 QMutableListIterator<ShapeList *> it(*m_shapes);
2955 while (it.hasNext()) {
2958 int foundElement = list->indexOf((
Shape *)imageObj);
2960 if (foundElement != -1) {
2965 m_idToShapeMap->remove(m_idToShapeMap->key((
Shape *)imageObj));
2969 Project::XmlHandler::XmlHandler(
Project *project) {
2970 m_project = project;
2986 return m_workOrderMutex;
2990 bool Project::XmlHandler::startElement(
const QString &namespaceURI,
const QString &localName,
2991 const QString &qName,
const QXmlAttributes &atts) {
2992 if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) {
2994 if (localName ==
"project") {
2995 QString
name = atts.value(
"name");
2996 if (!
name.isEmpty()) {
2997 m_project->setName(
name);
3000 else if (localName ==
"controlNets") {
3001 m_controls.append(
new ControlList(m_project, reader()));
3003 else if (localName ==
"imageList") {
3004 m_imageLists.append(
new ImageList(m_project, reader()));
3006 else if (localName ==
"shapeList") {
3007 m_shapeLists.append(
new ShapeList(m_project, reader()));
3009 else if (localName ==
"mapTemplateList") {
3010 m_mapTemplateLists.append(
new TemplateList(m_project, reader()));
3012 else if (localName ==
"regTemplateList") {
3013 m_regTemplateLists.append(
new TemplateList(m_project, reader()));
3016 else if (localName ==
"workOrder") {
3017 QString type = atts.value(
"type");
3021 m_workOrder->read(reader());
3024 else if (localName ==
"warning") {
3025 QString warningText = atts.value(
"text");
3027 if (!warningText.isEmpty()) {
3028 m_project->warn(warningText);
3031 else if (localName ==
"directory") {
3032 m_project->directory()->load(reader());
3034 else if (localName ==
"dockRestore") {
3041 else if (localName ==
"bundleSolutionInfo") {
3044 else if (localName ==
"activeImageList") {
3045 QString displayName = atts.value(
"displayName");
3046 m_project->setActiveImageList(displayName);
3048 else if (localName ==
"activeControl") {
3050 QString displayName = atts.value(
"displayName");
3051 m_project->setActiveControl(displayName);
3071 const QString &qName) {
3072 if (localName ==
"imageLists") {
3077 else if (localName ==
"shapeLists") {
3083 else if (localName ==
"mapTemplateLists") {
3084 foreach (
TemplateList *templateList, m_mapTemplateLists) {
3085 m_project->addTemplates(templateList);
3088 else if (localName ==
"regTemplateLists") {
3089 foreach (
TemplateList *templateList, m_regTemplateLists) {
3090 m_project->addTemplates(templateList);
3093 else if (localName ==
"workOrder") {
3094 m_project->m_workOrderHistory->append(m_workOrder);
3097 else if (localName ==
"controlNets") {
3100 m_project->addControl(
control);
3106 else if (localName ==
"results") {
3108 m_project->addBundleSolutionInfo(bundleInfo);
3111 if (bundleInfo->adjustedImages().count()) {
3112 foreach (
ImageList *adjustedImageList, bundleInfo->adjustedImages()) {
3113 m_project->addImagesToIdMap(*adjustedImageList);
3118 return XmlStackedHandler::endElement(namespaceURI, localName, qName);
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Container class for BundleAdjustment results.
This represents an ISIS control net in a project-based GUI interface.
QString id() const
Access the unique ID associated with this Control.
ControlNet * controlNet()
Open and return a pointer to the ControlNet for this Control.
bool write()
@description Write control net to disk.
bool isModified()
@description Has this control been modified?
QString fileName() const
Access the name of the control network file associated with this Control.
Maintains a list of Controls so that control nets can easily be copied from one Project to another,...
void append(Control *const &value)
Appends a control pointer to the control list.
QString name() const
Get the human-readable name of this control list.
void setName(QString newName)
Set the human-readable name of this control list.
void setPath(QString newPath)
Set the relative path (from the project root) to this control list's folder.
void SetImages(const QString &imageListFile)
Creates the ControlNet's image cameras based on an input file.
IO Handler for Isis Cubes.
void clean()
Cleans directory of everything to do with the current project.
void showWarning(QString text)
Displays a Warning.
ProjectItemModel * model()
Gets the ProjectItemModel for this directory.
static QString userName()
@Returns the user name.
File name manipulation and expansion.
QDir dir() const
Returns the path of the file's parent directory as a QDir object.
Container class for GuiCamera.
List of GuiCameras saved as QSharedPointers.
void clear()
Clears the list.
void append(GuiCameraQsp const &value)
Appends a single GuiCamera to the list.
@ Programmer
This error is for when a programmer made an API call that was illegal.
@ Io
A type of error that occurred when performing an actual I/O operation.
@ FootprintViewProperties
Every display property for footprint views, provided for convenience.
This represents a cube in a project-based GUI interface.
void closeCube()
Cleans up the Cube pointer.
QString id() const
Get a unique, identifying string associated with this image.
Internalizes a list of images and allows for operations on the entire list.
void setPath(QString newPath)
Set the relative path (from the project root) to this image list's folder.
void removeAt(int i)
Removes the image at an index.
void append(Image *const &value)
Appends an image to the image list.
void setName(QString newName)
Set the human-readable name of this image list.
QString name() const
Get the human-readable name of this image list.
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
The xml parser for ending tags.
The main project for ipce.
void activeControlSet(bool boolean)
Emitted when an active control is set.
void setActiveImageList(QString displayName)
Set the Active ImageList from the displayName which is saved in project.xml.
void imageListDeleted(QObject *imageList)
An image list is being deleted from the project.
void addBundleSolutionInfo(BundleSolutionInfo *bundleSolutionInfo)
Add the given BundleSolutionInfo to the current project.
void checkActiveControlAndImageList()
Checks if both an active control and active image list have been set.
void activeImageListSet()
Emitted when an active image list is set.
Shape * shape(QString id)
Return a shape given its id.
QString targetBodyRoot() const
Accessor for the root directory of the target body data.
QMutex * mutex()
Return mutex used for Naif calls.
ImageList * imageList(QString name)
Return an imagelist given its name.
void workOrderStarting(WorkOrder *)
Emitted when work order starts.
QList< TemplateList * > templates()
Return all template FileNames.
bool isTemporaryProject() const
Returns if the project is a temp project or not.
void bundleSolutionInfoAdded(BundleSolutionInfo *bundleSolutionInfo)
Emitted when new BundleSolutionInfo available from jigsaw receivers: ProjectTreeWidget (TODO: should ...
void imagesReady(ImageList)
Prepare new images for opening.
void targetBodyClosed(QObject *targetBodyObj)
A target body is being deleted from the project.
void setName(QString newName)
Change the project's name (GUI only, doesn't affect location on disk).
void imageClosed(QObject *image)
An image is being deleted from the project.
void imagesAdded(ImageList *images)
Emitted when new images are available.
void projectSaved(Project *)
Emitted when project is saved.
QDir addCnetFolder(QString prefix)
Create and return the name of a folder for placing control networks.
void controlListAdded(ControlList *controls)
apparently not used?
void addControl(Control *control)
Add the given Control's to the current project.
WorkOrder * lastNotUndoneWorkOrder()
Return the last not undone workorder.
QDir addTemplateFolder(QString prefix)
Create and navigate to the appropriate template type folder in the project directory.
void allControlsRemoved()
Emitted when all controls have been removed from the Project.
QString bundleSolutionInfoRoot() const
Accessor for the root directory of the results data.
void projectRelocated(Project *)
Emitted when project location moved receivers: Control, BundleSolutionInfo, Image,...
void shapeListDeleted(QObject *shapeList)
A shape model list is being deleted from the project.
void deleteAllProjectFiles()
Delete all of the files, that this project stores, from disk.
QString newProjectRoot() const
Get the top-level folder of the new project.
void setActiveControl(QString displayName)
Set the Active Control (control network)
QDir addBundleSolutionInfoFolder(QString folder)
Create and return the name of a folder for placing BundleSolutionInfo.
void controlClosed(QObject *control)
A control is being deleted from the project.
QList< TemplateList * > regTemplates()
Return registration template FileNames.
void projectLoaded(Project *)
Emitted when project loaded receivers: IpceMainWindow, Directory, HistoryTreeWidget.
QString templateRoot() const
Accessor for the root directory of the template data.
QUndoStack * undoStack()
Returns the Projects stack of QUndoCommands.
void workOrderFinished(WorkOrder *)
Emitted when work order ends.
bool hasCamera(QString id)
This method checks for the existence of a camera based on InstrumentId.
QList< WorkOrder * > workOrderHistory()
Get the entire list of work orders that have executed.
QString resultsRoot() const
Accessor for the root directory of the results data.
void addImagesToIdMap(ImageList images)
Add images to the id map which are not under the projects main data area, the Images node on the proj...
bool m_isClean
used to determine whether a project is currently open
void waitForShapeReaderFinished()
Locks program if another spot in code is still running and called this function.
TargetBodyList targetBodies()
Return TargetBodyList in Project.
void waitForImageReaderFinished()
Locks program if another spot in code is still running and called this function.
ShapeList * shapeList(QString name)
Return a shapelist given its name.
bool hasTarget(QString id)
This method checks for the existence of a target based on TargetName.
void controlAdded(Control *control)
Emitted when new Control added to Project receivers: ProjectTreeWidget.
void shapeClosed(QObject *shape)
A shape model is being deleted from the project.
QList< ShapeList * > shapes()
Return the projects shapelist.
QMutex * workOrderMutex()
This function returns a QMutex.
~Project()
Clean up the project.
QList< QAction * > userPreferenceActions()
Get a list of configuration/settings actions related to reading images into this Project.
void saveHistory(QXmlStreamWriter &stream) const
Serialize the work orders into the given XML.
void clear()
Function to clear out all values in a project essentially making it a new project object.
void addToProject(WorkOrder *)
This executes the WorkOrder and stores it in the project.
void activeControlAndImageListSet()
Emitted when both an active control and active image list have been set.
void activeControlModified()
Emmited in cnetModified() when the actice control is modified.
void addTarget(Target *target)
Adds a new target to the project.
QList< TemplateList * > mapTemplates()
Return map template FileNames.
Control * control(QString id)
Accessor for if the project is clearing or not.
void createFolders()
This creates the project root, image root, and control net root directories.
void cnetModified()
When a cnet is modified, set the project state to not clean.
void guiCamerasAdded(GuiCameraList *targets)
Emitted when new GuiCamera objects added to project receivers: Directory.
QString imageDataRoot() const
Accessor for the root directory of the image data.
void bundleSolutionInfoClosed(QObject *bundleSolutionInfo)
A BundleSolutionInfo object is being deleted from the project.
void shapesAdded(ShapeList *shapes)
Emitted when new shape model images are available.
void cnetSaved(bool value)
Emmited in save() when the project is being saved Connected to Directory so that ControlPointEditWidg...
QString cnetRoot() const
Get where control networks ought to be stored inside the project.
void checkControlsAndImagesAvailable()
Checks if at least one control and image have been added to the project.
QList< ControlList * > controls()
Return controls in project.
QMap< QString, Control * > * m_idToControlMap
This variable will probably go away when we add the bundle results object because it will be under: B...
bool m_clearing
used to determine whether a project's changes are unsaved
Directory * directory() const
Returns the directory associated with this Project.
int m_numImagesCurrentlyReading
used to negate segfaults happening in post undos when clearning project
void targetsAdded(TargetBodyList *targets)
Emitted when new TargetBody objects added to project receivers: Directory.
bool isClean()
Accessor to determine whether the current project is Unsaved.
void open(QString)
Open the project at the given path.
ImageList * activeImageList()
Returns the active ImageList.
QList< BundleSolutionInfo * > bundleSolutionInfo()
Return BundleSolutionInfo objects in Project.
QString projectRoot() const
Get the top-level folder of the project.
QString name() const
Get the project's GUI name.
void setClean(bool value)
Function to change the clean state of the project.
Control * activeControl()
Return the Active Control (control network)
void loadBundleSolutionInfo(BundleSolutionInfo *bundleSolutionInfo)
Loads bundle solution info into project.
void addCamera(Camera *camera)
Adds a new camera to the project.
QDir addImageFolder(QString prefix)
Create and return the name of a folder for placing images.
void nameChanged(QString newName)
Emitted when project name is changed receivers: ProjectTreeWidget.
void saveWarnings(QXmlStreamWriter &stream) const
Serialize the warnings into the given XML.
void relocateProjectRoot(QString newRoot)
This is called when the project is moved.
void controlListDeleted(QObject *controlList)
An control list is being deleted from the project.
QString shapeDataRoot() const
Accessor for the root directory of the shape model data.
bool isOpen()
Accessor to determine whether a current project is Open.
QList< ImageList * > images()
Return projects imagelist.
void controlsAndImagesAvailable()
Emitted when at least one cnet and image have been added to the project.
Image * image(QString id)
Return an image given its id.
void addTemplates(TemplateList *templateFiles)
Add new templates to m_mapTemplates or m_regTemplates and update project item model.
void addShapes(QStringList shapeFiles)
Read the given shape model cube file names as Images and add them to the project.
Project(Directory &directory, QObject *parent=0)
Create a new Project.
void addImages(QStringList imageFiles)
Read the given cube file names as Images and add them to the project.
bool save()
Generic save method to save the state of the project.
QDir addShapeFolder(QString prefix)
Create and return the name of a folder for placing shape models.
ControlList * controlList(QString name)
Return controlslist matching name in Project.
Represents an item of a ProjectItemModel in Qt's model-view framework.
bool isControl() const
Returns true if a Control is stored in the data of the item.
bool isImageList() const
Returns true if an ImageList is stored in the data of the item.
ImageList * imageList() const
Returns the ImageList stored in the data of the item.
Control * control() const
Returns the Control stored in the data of the item.
ProjectItem * findItemData(const QVariant &data, int role=Qt::UserRole+1)
Returns the first item found that contains the given data in the given role or a null pointer if no i...
This represents a shape in a project-based GUI interface.
void closeCube()
Cleans up the Cube *.
QString id() const
Get a unique, identifying string associated with this shape.
Internalizes a list of shapes and allows for operations on the entire list.
void append(Shape *const &value)
Appends an shape to the shape list.
void removeAt(int i)
Removes the shape at an index.
void setName(QString newName)
Set the human-readable name of this shape list.
QString name() const
Get the human-readable name of this shape list.
void setPath(QString newPath)
Set the relative path (from the project root) to this shape list's folder.
Container class for TargetBody.
List for holding TargetBodies.
void append(TargetBodyQsp const &value)
Appends a TargetBody to the list.
void clear()
clears the list.
This class is used to create and store valid Isis targets.
QString type() const
Get the type of template in this TemplateList.
static WorkOrder * create(Project *project, QString type)
This instantiates a work order given a project and a type name (class name in a string).
Provide Undo/redo abilities, serialization, and history for an operation.
WorkOrder * previous() const
Gets the previous WorkOrder.
Manage a stack of content handlers for reading XML files.
virtual void pushContentHandler(XmlStackedHandler *newHandler)
Push a contentHandler and maybe continue parsing...
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
QSharedPointer< GuiCamera > GuiCameraQsp
GuiCameraQsp Represents a smart pointer to a GuiCamera object.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
QSharedPointer< TargetBody > TargetBodyQsp
Defines A smart pointer to a TargetBody obj.