Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis Developer Reference
Project.h
Go to the documentation of this file.
1#ifndef Project_H
2#define Project_H
25#include <QDir>
26#include <QObject>
27#include <QPointer>
28#include <QStringList>
29#include <QUndoStack>
30
31class QMutex;
32class QProgressBar;
33class QXmlStreamWriter;
34class QXmlStreamReader;
35
36#include "ControlList.h"
37#include "Directory.h"
38#include "GuiCameraList.h"
39#include "ImageList.h"
40#include "ShapeList.h"
41#include "TargetBody.h"
42#include "TemplateList.h"
43
44namespace Isis {
46 class BundleSettings;
47 class Control;
48 class ControlList;
50 class FileName;
51 class Shape;
52 class ImageReader;
53 class ProgressBar;
54 class ShapeReader;
55 class Template;
56 class TemplateList;
57 class WorkOrder;
58
287 class Project : public QObject {
288 Q_OBJECT
289 public:
290 Project(Directory &directory, QObject *parent = 0);
291 ~Project();
292
295// static QStringList verifyCNets(QStringList);
296
298
299 bool hasTarget(QString id);
300 bool hasCamera(QString id);
301
302 QDir addBundleSolutionInfoFolder(QString folder);
303 QDir addCnetFolder(QString prefix);
305 QDir addImageFolder(QString prefix);
306 void addImages(QStringList imageFiles);
307 void addImages(ImageList newImages);
309 QDir addShapeFolder(QString prefix);
310 void addShapes(QStringList shapeFiles);
311 void addShapes(ShapeList newShapes);
312 void addTemplates(TemplateList *templateFiles);
313 QDir addTemplateFolder(QString prefix);
315 void addTarget(Target *target);
316 void addCamera(Camera *camera);
317
319 void clear();
320 bool clearing();
321 Control *control(QString id);
322 Directory *directory() const;
323 Image *image(QString id);
324 ImageList *imageList(QString name);
325 Shape *shape(QString id);
326 ShapeList *shapeList(QString name);
327 // CorrelationMatrix *correlationMatrix();
328 bool isTemporaryProject() const;
329 bool isOpen();
330 bool isClean();
332 const WorkOrder *lastNotUndoneWorkOrder() const;
333 QString name() const;
334 QMutex *workOrderMutex();
335 QMutex *mutex();
336 QString projectRoot() const;
337 QString newProjectRoot() const;
338
339 void setName(QString newName);
340 QUndoStack *undoStack();
344 void writeSettings(FileName projName) const;
345
346 void readProjectXml(QXmlStreamReader *xmlReader);
347
348 void setActiveControl(QString displayName);
350 void setActiveImageList(QString displayName);
352
353 static QString cnetRoot(QString projectRoot);
354 QString cnetRoot() const;
356 ControlList *controlList(QString name);
357
358 static QString imageDataRoot(QString projectRoot);
359 QString imageDataRoot() const;
361
362 static QString shapeDataRoot(QString projectRoot);
363 QString shapeDataRoot() const;
365
366 static QString targetBodyRoot(QString projectRoot);
367 QString targetBodyRoot() const;
369
370 static QString resultsRoot(QString projectRoot);
371 QString resultsRoot() const;
372 static QString bundleSolutionInfoRoot(QString projectRoot);
373 QString bundleSolutionInfoRoot() const;
375
376 static QString templateRoot(QString projectRoot);
377 QString templateRoot() const;
381 void removeTemplate(FileName file);
382
384 void relocateProjectRoot(QString newRoot);
385
390 BundleSettings *bundleSettings() {return m_bundleSettings;}
391
396 static int maxRecentProjects() { return m_maxRecentProjects; }
397
399
401
402 bool save();
403 void save(FileName projectPath, bool verifyPathDoesntExist = true);
404
405 void addToProject(WorkOrder *);
406
407 template<typename Data> void warn(QString text, Data relevantData);
408
409 void warn(QString text);
410
411 signals:
415// void allImagesClosed();
416
422
428
433 void activeControlSet(bool boolean);
434
444
450
456
462
468
475
481
487
493
499
504 void nameChanged(QString newName);
505
511
517
523
528
533
534 void templatesAdded(TemplateList *newTemplates);
535
537
543
548 void cnetSaved(bool value);
549
550 public slots:
551 void open(QString);
552 void setClean(bool value);
553 void cnetModified();
554
555 private slots:
556 void controlClosed(QObject *control);
557 void controlListDeleted(QObject *controlList);
558 void imagesReady(ImageList);
559 void imageClosed(QObject *image);
560 void imageListDeleted(QObject *imageList);
561 void bundleSolutionInfoClosed(QObject *bundleSolutionInfo);
562 void targetBodyClosed(QObject *targetBodyObj);
563 void shapesReady(ShapeList shapes);
564 void shapeClosed(QObject *shape);
565 void shapeListDeleted(QObject *shapeList);
566 void checkActiveControlAndImageList();
567 void checkControlsAndImagesAvailable();
568
569 private:
570 Project(const Project &other);
571 Project &operator=(const Project &rhs);
572 void createFolders();
573
574 ControlList *createOrRetrieveControlList(QString name, QString path = "");
575 ImageList *createOrRetrieveImageList(QString name, QString path = "");
576 ShapeList *createOrRetrieveShapeList(QString name, QString path = "");
577
578 void writeSettings();
579
580
581 QString nextImageListGroupName();
582// void removeImage(Image *image);
583
584 void save(QXmlStreamWriter &stream, FileName newProjectRoot) const;
585 void saveHistory(QXmlStreamWriter &stream) const;
586 void saveWarnings(QXmlStreamWriter &stream) const;
587
588 void storeWarning(QString text);
589 void storeWarning(QString text, const ImageList &relevantData);
590
591 private:
592
593 static const int m_maxRecentProjects = 5;
594 QDir *m_projectRoot;
595 QString m_newProjectRoot;
596 QDir *m_cnetRoot;
597 QDir m_currentCnetFolder;
598 QPointer<Directory> m_directory;
599 QList<ImageList *> *m_images;
600 QList<ControlList *> *m_controls;
601 QList<ShapeList *> *m_shapes;
602 TargetBodyList *m_targets;
603 QList<TemplateList *> *m_mapTemplates;
604 QList<TemplateList *> *m_regTemplates;
605 GuiCameraList *m_guiCameras;
606 QList<BundleSolutionInfo *> *m_bundleSolutionInfo;
607
608 QPointer<Control> m_activeControl;
609 QPointer<ImageList> m_activeImageList;
610
611
612 // TODO: kle testing - this will almost certainly be changed
613 BundleSettings *m_bundleSettings;
621// CorrelationMatrix *m_correlationMatrix;
622
623 QMap<QString, Control *> *m_idToControlMap;
624 QMap<QString, Image *> *m_idToImageMap;
625 QMap<QString, Shape *> *m_idToShapeMap;
626 QMap<QString, BundleSolutionInfo *> *m_idToBundleSolutionInfoMap;
627 QMap<QString, TargetBody *> *m_idToTargetBodyMap;
628 QMap<QString, GuiCamera *> *m_idToGuiCameraMap;
629
630 QString m_name;
631 QStringList *m_warnings;
632 QList< QPointer<WorkOrder> > *m_workOrderHistory;
633
634 QPointer<ImageReader> m_imageReader;
635 //QList<QPair<QString, Data> > m_storedWarnings;
636 bool m_isTemporaryProject;
637 bool m_isOpen;
638 bool m_isClean;
639 bool m_clearing;
640 int m_numImagesCurrentlyReading;
641
642 QMutex *m_mutex;
643 QMutex *m_workOrderMutex;
644 QMutex *m_imageReadingMutex;
645
646 int m_numShapesCurrentlyReading;
647 QMutex *m_shapeMutex;
648 QPointer<ShapeReader> m_shapeReader;
649 QMutex *m_shapeReadingMutex;
650
651 QUndoStack m_undoStack;
652
653 Project *m_project;
654 QList<ImageList *> m_imageLists;
655 QList<ShapeList *> m_shapeLists;
656 QList<BundleSolutionInfo *> m_bundleSolutionInfos;
657 QList<TemplateList *> m_mapTemplateLists;
658 QList<TemplateList *> m_regTemplateLists;
659 WorkOrder *m_workOrder;
660 };
661}
662
664
665#endif // Project_H
Q_DECLARE_METATYPE(Isis::Project *)
Container class for BundleAdjustment settings.
Definition BundleSettings.h:125
Container class for BundleAdjustment results.
Definition BundleSolutionInfo.h:174
Definition Camera.h:236
This represents an ISIS control net in a project-based GUI interface.
Definition Control.h:65
Maintains a list of Controls so that control nets can easily be copied from one Project to another,...
Definition ControlList.h:41
This is a container for the correlation matrix that comes from a bundle adjust.
Definition CorrelationMatrix.h:61
Definition Directory.h:271
List of GuiCameras saved as QSharedPointers.
Definition GuiCameraList.h:32
This represents a cube in a project-based GUI interface.
Definition Image.h:105
Internalizes a list of images and allows for operations on the entire list.
Definition ImageList.h:52
Definition ImageReader.h:42
Definition ProgressBar.h:15
The main project for ipce.
Definition Project.h:287
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.
Definition Project.cpp:2017
void addBundleSolutionInfo(BundleSolutionInfo *bundleSolutionInfo)
Add the given BundleSolutionInfo to the current project.
Definition Project.cpp:1192
void readProjectXml(QXmlStreamReader *xmlReader)
Definition Project.cpp:1493
void activeImageListSet()
Emitted when an active image list is set.
Shape * shape(QString id)
Return a shape given its id.
Definition Project.cpp:1601
QString targetBodyRoot() const
Accessor for the root directory of the target body data.
Definition Project.cpp:2248
QMutex * mutex()
Return mutex used for Naif calls.
Definition Project.cpp:1720
ImageList * imageList(QString name)
Return an imagelist given its name.
Definition Project.cpp:1582
void workOrderStarting(WorkOrder *)
Emitted when work order starts.
QList< TemplateList * > templates()
Return all template FileNames.
Definition Project.cpp:2207
bool isTemporaryProject() const
Returns if the project is a temp project or not.
Definition Project.cpp:1629
void bundleSolutionInfoAdded(BundleSolutionInfo *bundleSolutionInfo)
Emitted when new BundleSolutionInfo available from jigsaw receivers: ProjectTreeWidget (TODO: should ...
void setName(QString newName)
Change the project's name (GUI only, doesn't affect location on disk).
Definition Project.cpp:1746
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.
Definition Project.cpp:924
void controlListAdded(ControlList *controls)
apparently not used?
void addControl(Control *control)
Add the given Control's to the current project.
Definition Project.cpp:956
WorkOrder * lastNotUndoneWorkOrder()
Return the last not undone workorder.
Definition Project.cpp:1667
QDir addTemplateFolder(QString prefix)
Create and navigate to the appropriate template type folder in the project directory.
Definition Project.cpp:1132
void allControlsRemoved()
Emitted when all controls have been removed from the Project.
QString bundleSolutionInfoRoot() const
Accessor for the root directory of the results data.
Definition Project.cpp:2305
void projectRelocated(Project *)
Emitted when project location moved receivers: Control, BundleSolutionInfo, Image,...
void deleteAllProjectFiles()
Delete all of the files, that this project stores, from disk.
Definition Project.cpp:2313
QString newProjectRoot() const
Get the top-level folder of the new project.
Definition Project.cpp:1737
void setActiveControl(QString displayName)
Set the Active Control (control network)
Definition Project.cpp:1881
QDir addBundleSolutionInfoFolder(QString folder)
Create and return the name of a folder for placing BundleSolutionInfo.
Definition Project.cpp:1172
QList< TemplateList * > regTemplates()
Return registration template FileNames.
Definition Project.cpp:2228
void projectLoaded(Project *)
Emitted when project loaded receivers: IpceMainWindow, Directory, HistoryTreeWidget.
QString templateRoot() const
Accessor for the root directory of the template data.
Definition Project.cpp:2197
QUndoStack * undoStack()
Returns the Projects stack of QUndoCommands.
Definition Project.cpp:1756
void workOrderFinished(WorkOrder *)
Emitted when work order ends.
bool hasCamera(QString id)
This method checks for the existence of a camera based on InstrumentId.
Definition Project.cpp:2807
QList< WorkOrder * > workOrderHistory()
Get the entire list of work orders that have executed.
Definition Project.cpp:1810
void templatesAdded(TemplateList *newTemplates)
QString resultsRoot() const
Accessor for the root directory of the results data.
Definition Project.cpp:2276
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...
Definition Project.cpp:2840
void waitForShapeReaderFinished()
Locks program if another spot in code is still running and called this function.
Definition Project.cpp:1802
TargetBodyList targetBodies()
Return TargetBodyList in Project.
Definition Project.cpp:2256
void waitForImageReaderFinished()
Locks program if another spot in code is still running and called this function.
Definition Project.cpp:1794
ShapeList * shapeList(QString name)
Return a shapelist given its name.
Definition Project.cpp:1611
bool clearing()
Definition Project.cpp:664
BundleSettings * bundleSettings()
Return BundleSettings objects in Project.
Definition Project.h:390
bool hasTarget(QString id)
This method checks for the existence of a target based on TargetName.
Definition Project.cpp:2777
void controlAdded(Control *control)
Emitted when new Control added to Project receivers: ProjectTreeWidget.
QList< ShapeList * > shapes()
Return the projects shapelist.
Definition Project.cpp:2168
QMutex * workOrderMutex()
This function returns a QMutex.
Definition Project.cpp:3041
~Project()
Clean up the project.
Definition Project.cpp:254
QList< QAction * > userPreferenceActions()
Get a list of configuration/settings actions related to reading images into this Project.
Definition Project.cpp:914
void clear()
Function to clear out all values in a project essentially making it a new project object.
Definition Project.cpp:457
void addToProject(WorkOrder *)
This executes the WorkOrder and stores it in the project.
Definition Project.cpp:2660
void warn(QString text, Data relevantData)
Definition Project.cpp:2705
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.
Definition Project.cpp:2792
QList< TemplateList * > mapTemplates()
Return map template FileNames.
Definition Project.cpp:2218
Control * control(QString id)
Accessor for if the project is clearing or not.
Definition Project.cpp:1161
void cnetModified()
When a cnet is modified, set the project state to not clean.
Definition Project.cpp:1986
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.
Definition Project.cpp:2139
void shapesAdded(ShapeList *shapes)
Emitted when new shape model images are available.
static QStringList images(QStringList)
Verify that the input fileNames are image files.
Definition Project.cpp:892
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.
Definition Project.cpp:2091
QList< ControlList * > controls()
Return controls in project.
Definition Project.cpp:2100
Directory * directory() const
Returns the directory associated with this Project.
Definition Project.cpp:1227
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.
Definition Project.cpp:1646
void open(QString)
Open the project at the given path.
Definition Project.cpp:1343
ImageList * activeImageList()
Returns the active ImageList.
Definition Project.cpp:2065
QList< BundleSolutionInfo * > bundleSolutionInfo()
Return BundleSolutionInfo objects in Project.
Definition Project.cpp:2285
void writeSettings(FileName projName) const
QString projectRoot() const
Get the top-level folder of the project.
Definition Project.cpp:1728
void removeImages(ImageList &imageList)
Definition Project.cpp:2848
QString name() const
Get the project's GUI name.
Definition Project.cpp:1687
void setClean(bool value)
Function to change the clean state of the project.
Definition Project.cpp:1657
Control * activeControl()
Return the Active Control (control network)
Definition Project.cpp:1965
void loadBundleSolutionInfo(BundleSolutionInfo *bundleSolutionInfo)
Loads bundle solution info into project.
Definition Project.cpp:1208
void addCamera(Camera *camera)
Adds a new camera to the project.
Definition Project.cpp:2823
QDir addImageFolder(QString prefix)
Create and return the name of a folder for placing images.
Definition Project.cpp:1001
void discardActiveControlEdits()
void nameChanged(QString newName)
Emitted when project name is changed receivers: ProjectTreeWidget.
void relocateProjectRoot(QString newRoot)
This is called when the project is moved.
Definition Project.cpp:2367
void imageListAdded(ImageList *images)
Emitted when new ImageList added to Project receivers: ProjectTreeWidget.
static int maxRecentProjects()
Return max number of recent projects to be displayed.
Definition Project.h:396
static QStringList shapes(QStringList)
QString shapeDataRoot() const
Accessor for the root directory of the shape model data.
Definition Project.cpp:2159
bool isOpen()
Accessor to determine whether a current project is Open.
Definition Project.cpp:1637
QList< ImageList * > images()
Return projects imagelist.
Definition Project.cpp:2177
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.
Definition Project.cpp:1571
void addTemplates(TemplateList *templateFiles)
Add new templates to m_mapTemplates or m_regTemplates and update project item model.
Definition Project.cpp:1111
void addShapes(QStringList shapeFiles)
Read the given shape model cube file names as Images and add them to the project.
Definition Project.cpp:1087
QProgressBar * progress()
Definition Project.cpp:1561
Project(Directory &directory, QObject *parent=0)
Create a new Project.
Definition Project.cpp:85
void addImages(QStringList imageFiles)
Read the given cube file names as Images and add them to the project.
Definition Project.cpp:1030
bool save()
Generic save method to save the state of the project.
Definition Project.cpp:2386
QDir addShapeFolder(QString prefix)
Create and return the name of a folder for placing shape models.
Definition Project.cpp:1058
ControlList * controlList(QString name)
Return controlslist matching name in Project.
Definition Project.cpp:2110
void removeTemplate(FileName file)
This represents a shape in a project-based GUI interface.
Definition Shape.h:66
Internalizes a list of shapes and allows for operations on the entire list.
Definition ShapeList.h:30
Definition ShapeReader.h:33
List for holding TargetBodies.
Definition TargetBodyList.h:30
This class is used to create and store valid Isis targets.
Definition Target.h:63
Definition Template.h:30
Definition TemplateList.h:35
Provide Undo/redo abilities, serialization, and history for an operation.
Definition WorkOrder.h:311
This is free and unencumbered software released into the public domain.
Definition BoxcarCachingAlgorithm.h:13
This is free and unencumbered software released into the public domain.
Definition CubeIoHandler.h:23
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16