Isis 3 Programmer Reference
Isis::Project Class Reference

The main project for ipce. More...

#include <Project.h>

Inheritance diagram for Isis::Project:
Inheritance graph
Collaboration diagram for Isis::Project:
Collaboration graph

Classes

class  XmlHandler
 

Public Slots

void open (QString)
 Open the project at the given path. More...
 
void setClean (bool value)
 Function to change the clean state of the project. More...
 
void cnetModified ()
 When a cnet is modified, set the project state to not clean. More...
 

Signals

void controlListAdded (ControlList *controls)
 apparently not used? More...
 
void controlAdded (Control *control)
 Emitted when new Control added to Project receivers: ProjectTreeWidget. More...
 
void activeControlSet (bool boolean)
 Emitted when an active control is set. More...
 
void allControlsRemoved ()
 Emitted when all controls have been removed from the Project. More...
 
void imageListAdded (ImageList *images)
 Emitted when new ImageList added to Project receivers: ProjectTreeWidget. More...
 
void imagesAdded (ImageList *images)
 Emitted when new images are available. More...
 
void activeImageListSet ()
 Emitted when an active image list is set. More...
 
void activeControlAndImageListSet ()
 Emitted when both an active control and active image list have been set. More...
 
void controlsAndImagesAvailable ()
 Emitted when at least one cnet and image have been added to the project. More...
 
void shapesAdded (ShapeList *shapes)
 Emitted when new shape model images are available. More...
 
void bundleSolutionInfoAdded (BundleSolutionInfo *bundleSolutionInfo)
 Emitted when new BundleSolutionInfo available from jigsaw receivers: ProjectTreeWidget (TODO: should this be the Directory?) More...
 
void targetsAdded (TargetBodyList *targets)
 Emitted when new TargetBody objects added to project receivers: Directory. More...
 
void guiCamerasAdded (GuiCameraList *targets)
 Emitted when new GuiCamera objects added to project receivers: Directory. More...
 
void nameChanged (QString newName)
 Emitted when project name is changed receivers: ProjectTreeWidget. More...
 
void projectLoaded (Project *)
 Emitted when project loaded receivers: IpceMainWindow, Directory, HistoryTreeWidget. More...
 
void projectSaved (Project *)
 Emitted when project is saved. More...
 
void projectRelocated (Project *)
 Emitted when project location moved receivers: Control, BundleSolutionInfo, Image, TargetBody. More...
 
void workOrderStarting (WorkOrder *)
 Emitted when work order starts. More...
 
void workOrderFinished (WorkOrder *)
 Emitted when work order ends. More...
 
void templatesAdded (TemplateList *newTemplates)
 
void discardActiveControlEdits ()
 
void activeControlModified ()
 Emmited in cnetModified() when the actice control is modified. More...
 
void cnetSaved (bool value)
 Emmited in save() when the project is being saved Connected to Directory so that ControlPointEditWidget can recolor the save net button. More...
 

Public Member Functions

 Project (Directory &directory, QObject *parent=0)
 Create a new Project. More...
 
 ~Project ()
 Clean up the project. More...
 
QList< QAction * > userPreferenceActions ()
 Get a list of configuration/settings actions related to reading images into this Project. More...
 
bool hasTarget (QString id)
 This method checks for the existence of a target based on TargetName. More...
 
bool hasCamera (QString id)
 This method checks for the existence of a camera based on InstrumentId. More...
 
QDir addBundleSolutionInfoFolder (QString folder)
 Create and return the name of a folder for placing BundleSolutionInfo. More...
 
QDir addCnetFolder (QString prefix)
 Create and return the name of a folder for placing control networks. More...
 
void addControl (Control *control)
 Add the given Control's to the current project. More...
 
QDir addImageFolder (QString prefix)
 Create and return the name of a folder for placing images. More...
 
void addImages (QStringList imageFiles)
 Read the given cube file names as Images and add them to the project. More...
 
void addImages (ImageList newImages)
 Read the given cube file names as Images and add them to the project. More...
 
void addImagesToIdMap (ImageList images)
 Add images to the id map which are not under the projects main data area, the Images node on the project tree, such as the images under bundle results. More...
 
QDir addShapeFolder (QString prefix)
 Create and return the name of a folder for placing shape models. More...
 
void addShapes (QStringList shapeFiles)
 Read the given shape model cube file names as Images and add them to the project. More...
 
void addShapes (ShapeList newShapes)
 Read the given shape model cube file names as Images and add them to the project. More...
 
void addTemplates (TemplateList *templateFiles)
 Add new templates to m_mapTemplates or m_regTemplates and update project item model. More...
 
QDir addTemplateFolder (QString prefix)
 Create and navigate to the appropriate template type folder in the project directory. More...
 
void addBundleSolutionInfo (BundleSolutionInfo *bundleSolutionInfo)
 Add the given BundleSolutionInfo to the current project. More...
 
void addTarget (Target *target)
 Adds a new target to the project. More...
 
void addCamera (Camera *camera)
 Adds a new camera to the project. More...
 
void loadBundleSolutionInfo (BundleSolutionInfo *bundleSolutionInfo)
 Loads bundle solution info into project. More...
 
void clear ()
 Function to clear out all values in a project essentially making it a new project object. More...
 
bool clearing ()
 
Controlcontrol (QString id)
 Accessor for if the project is clearing or not. More...
 
Directorydirectory () const
 Returns the directory associated with this Project. More...
 
Imageimage (QString id)
 Return an image given its id. More...
 
ImageListimageList (QString name)
 Return an imagelist given its name. More...
 
Shapeshape (QString id)
 Return a shape given its id. More...
 
ShapeListshapeList (QString name)
 Return a shapelist given its name. More...
 
bool isTemporaryProject () const
 Returns if the project is a temp project or not. More...
 
bool isOpen ()
 Accessor to determine whether a current project is Open. More...
 
bool isClean ()
 Accessor to determine whether the current project is Unsaved. More...
 
WorkOrderlastNotUndoneWorkOrder ()
 Return the last not undone workorder. More...
 
const WorkOrderlastNotUndoneWorkOrder () const
 Return the last not undone workorder. More...
 
QString name () const
 Get the project's GUI name. More...
 
QMutex * workOrderMutex ()
 This function returns a QMutex. More...
 
QMutex * mutex ()
 Return mutex used for Naif calls. More...
 
QString projectRoot () const
 Get the top-level folder of the project. More...
 
QString newProjectRoot () const
 Get the top-level folder of the new project. More...
 
void setName (QString newName)
 Change the project's name (GUI only, doesn't affect location on disk). More...
 
QUndoStack * undoStack ()
 Returns the Projects stack of QUndoCommands. More...
 
void waitForImageReaderFinished ()
 Locks program if another spot in code is still running and called this function. More...
 
void waitForShapeReaderFinished ()
 Locks program if another spot in code is still running and called this function. More...
 
QList< WorkOrder * > workOrderHistory ()
 Get the entire list of work orders that have executed. More...
 
void writeSettings (FileName projName) const
 
void setActiveControl (QString displayName)
 Set the Active Control (control network) More...
 
ControlactiveControl ()
 Return the Active Control (control network) More...
 
void setActiveImageList (QString displayName)
 Set the Active ImageList from the displayName which is saved in project.xml. More...
 
ImageListactiveImageList ()
 Returns the active ImageList. More...
 
QString cnetRoot () const
 Get where control networks ought to be stored inside the project. More...
 
QList< ControlList * > controls ()
 Return controls in project. More...
 
ControlListcontrolList (QString name)
 Return controlslist matching name in Project. More...
 
QString imageDataRoot () const
 Accessor for the root directory of the image data. More...
 
QList< ImageList * > images ()
 Return projects imagelist. More...
 
QString shapeDataRoot () const
 Accessor for the root directory of the shape model data. More...
 
QList< ShapeList * > shapes ()
 Return the projects shapelist. More...
 
QString targetBodyRoot () const
 Accessor for the root directory of the target body data. More...
 
TargetBodyList targetBodies ()
 Return TargetBodyList in Project. More...
 
QString resultsRoot () const
 Accessor for the root directory of the results data. More...
 
QString bundleSolutionInfoRoot () const
 Accessor for the root directory of the results data. More...
 
QList< BundleSolutionInfo * > bundleSolutionInfo ()
 Return BundleSolutionInfo objects in Project. More...
 
QString templateRoot () const
 Accessor for the root directory of the template data. More...
 
QList< TemplateList * > templates ()
 Return all template FileNames. More...
 
QList< TemplateList * > mapTemplates ()
 Return map template FileNames. More...
 
QList< TemplateList * > regTemplates ()
 Return registration template FileNames. More...
 
void removeTemplate (FileName file)
 
void deleteAllProjectFiles ()
 Delete all of the files, that this project stores, from disk. More...
 
void relocateProjectRoot (QString newRoot)
 This is called when the project is moved. More...
 
BundleSettingsbundleSettings ()
 Return BundleSettings objects in Project. More...
 
QProgressBarprogress ()
 
void removeImages (ImageList &imageList)
 
bool save ()
 Generic save method to save the state of the project. More...
 
void save (FileName projectPath, bool verifyPathDoesntExist=true)
 Project::save Saves the project state out to an XML file. More...
 
void addToProject (WorkOrder *)
 This executes the WorkOrder and stores it in the project. More...
 
template<typename Data >
void warn (QString text, Data relevantData)
 
void warn (QString text)
 

Static Public Member Functions

static QStringList images (QStringList)
 Verify that the input fileNames are image files. More...
 
static QStringList shapes (QStringList)
 
static QString cnetRoot (QString projectRoot)
 Appends the root directory name 'cnets' to the project. More...
 
static QString imageDataRoot (QString projectRoot)
 Appends the root directory name 'images' to the project . More...
 
static QString shapeDataRoot (QString projectRoot)
 Appends the root directory name 'shapes' to the project . More...
 
static QString targetBodyRoot (QString projectRoot)
 Appends the root directory name 'targets' to the project . More...
 
static QString resultsRoot (QString projectRoot)
 Appends the root directory name 'results' to the project. More...
 
static QString bundleSolutionInfoRoot (QString projectRoot)
 Appends the root directory name 'bundle' to the project results directory. More...
 
static QString templateRoot (QString projectRoot)
 Appends the root directory name 'templates' to the project . More...
 
static int maxRecentProjects ()
 Return max number of recent projects to be displayed. More...
 

Private Slots

void controlClosed (QObject *control)
 A control is being deleted from the project. More...
 
void controlListDeleted (QObject *controlList)
 An control list is being deleted from the project. More...
 
void imagesReady (ImageList)
 Prepare new images for opening. More...
 
void imageClosed (QObject *image)
 An image is being deleted from the project. More...
 
void imageListDeleted (QObject *imageList)
 An image list is being deleted from the project. More...
 
void bundleSolutionInfoClosed (QObject *bundleSolutionInfo)
 A BundleSolutionInfo object is being deleted from the project. More...
 
void targetBodyClosed (QObject *targetBodyObj)
 A target body is being deleted from the project. More...
 
void shapesReady (ShapeList shapes)
 
void shapeClosed (QObject *shape)
 A shape model is being deleted from the project. More...
 
void shapeListDeleted (QObject *shapeList)
 A shape model list is being deleted from the project. More...
 
void checkActiveControlAndImageList ()
 Checks if both an active control and active image list have been set. More...
 
void checkControlsAndImagesAvailable ()
 Checks if at least one control and image have been added to the project. More...
 

Private Member Functions

 Project (const Project &other)
 
Projectoperator= (const Project &rhs)
 
void createFolders ()
 This creates the project root, image root, and control net root directories. More...
 
ControlListcreateOrRetrieveControlList (QString name, QString path="")
 
ImageListcreateOrRetrieveImageList (QString name, QString path="")
 
ShapeListcreateOrRetrieveShapeList (QString name, QString path="")
 
void writeSettings ()
 
QString nextImageListGroupName ()
 
void save (QXmlStreamWriter &stream, FileName newProjectRoot) const
 Converts the project settings into XML. More...
 
void saveHistory (QXmlStreamWriter &stream) const
 Serialize the work orders into the given XML. More...
 
void saveWarnings (QXmlStreamWriter &stream) const
 Serialize the warnings into the given XML. More...
 
void storeWarning (QString text)
 
void storeWarning (QString text, const ImageList &relevantData)
 

Private Attributes

QDir * m_projectRoot
 
QString m_newProjectRoot
 
QDir * m_cnetRoot
 
QDir m_currentCnetFolder
 
QPointer< Directorym_directory
 
QList< ImageList * > * m_images
 
QList< ControlList * > * m_controls
 
QList< ShapeList * > * m_shapes
 
TargetBodyListm_targets
 
QList< TemplateList * > * m_mapTemplates
 
QList< TemplateList * > * m_regTemplates
 
GuiCameraListm_guiCameras
 
QList< BundleSolutionInfo * > * m_bundleSolutionInfo
 
QPointer< Controlm_activeControl
 
QPointer< ImageListm_activeImageList
 
BundleSettingsm_bundleSettings
 
QMap< QString, Control * > * m_idToControlMap
 This variable will probably go away when we add the bundle results object because it will be under: BundleSolutionInfo BundleResults CorrelationMatrix. More...
 
QMap< QString, Image * > * m_idToImageMap
 
QMap< QString, Shape * > * m_idToShapeMap
 
QMap< QString, BundleSolutionInfo * > * m_idToBundleSolutionInfoMap
 
QMap< QString, TargetBody * > * m_idToTargetBodyMap
 
QMap< QString, GuiCamera * > * m_idToGuiCameraMap
 
QString m_name
 
QStringListm_warnings
 
QList< QPointer< WorkOrder > > * m_workOrderHistory
 
QPointer< ImageReaderm_imageReader
 
bool m_isTemporaryProject
 
bool m_isOpen
 
bool m_isClean
 used to determine whether a project is currently open More...
 
bool m_clearing
 used to determine whether a project's changes are unsaved More...
 
int m_numImagesCurrentlyReading
 used to negate segfaults happening in post undos when clearning project More...
 
QMutex * m_mutex
 
QMutex * m_workOrderMutex
 
QMutex * m_imageReadingMutex
 
int m_numShapesCurrentlyReading
 
QMutex * m_shapeMutex
 
QPointer< ShapeReaderm_shapeReader
 
QMutex * m_shapeReadingMutex
 
QUndoStack m_undoStack
 

Static Private Attributes

static const int m_maxRecentProjects = 5
 

Detailed Description

The main project for ipce.

Author
2012-??-?? ???
History:

2012-07-27 Kimberly Oyama - Added comments to some of the methods.

2012-09-04 Tracie Sucharski - Renamed addCNets to addCnets, controlNetRoot to cnetRoot, networkLoaded to cnetLoaded. Added new method, addCnetFolder.

2012-09-11 Tracie Sucharski - Added mutex accessor method.

2012-09-12 Tracie Sucharski - Implemented ControlList instead of QList<Control *>, re-ordered some methods to match header order.

2012-09-12 Steven Lambright - Renamed imageList() to createOrRetrieveImageList(), added imageList() and image().

2012-09-17 Steven Lambright - Reduced the time complexity of image() to log(n) from n/2. This method is often called n times.

2012-09-17 Steven Lambright - Added crash detection/cleanup. Prompt is coded but disabled (we'll find a good wording or handle recovery better when we don't expect so many crashes during development).

2012-10-29 Steven Lambright and Stuart Sides - Added isTemporaryProject(). This is useful for the import images to know if it should prompt the user to save their project.

2013-05-14 Jeannie Backer - Used return status of c++ system() in the constructor to verify that the call was successful.

2014-07-14 Kimberly Oyama - Updated to better meet programming standards. Added support for correlation matrix.

2015-02-20 Jeannie Backer - Replaced BundleResults references with BundleSolutionInfo and BundleStatistics references with BundleResults due to class name changes.

2015-09-03 Jeannie Backer - Removed svn merge conflict comment lines. Removed call to save BundleSolutionInfo as an xml file. Added hdf5 preliminary serialization calls. Some ISIS coding standards improvements.

2015-10-14 Jeffrey Covington - Declared Project * as a Qt metatype for use with QVariant.

2016-06-23 Tracie Sucharski - Added a member variable for active control network and active image list, along with accessor methods.

2016-07-06 Tracie Sucharski - Changed the ImageReader to require footprints, because ImageReader class was changed so that footprints are no longer created if not required.

2016-07-06 Tracie Sucharski - Add import shape models to project.

2016-11-09 Tyler Wilson - Added try-catch blocks around reader.parse calls in the open function, so that warnings/errors are output to the warnings tab of the GUI instead of causing the application to exit. Fixes #4488.

2016-11-22 Tracie Sucharski - When saving a new project, if it is currently a temporary project, save project name as the base pathname for the project.

2016-12-02 Tracie Sucharski - Changed the the tag name in ::endElement from "project" to "imageLists" and "shapeLists", so that images and shapes are added to the project when their end tags are found instead of the project end tag.

2016-12-29 Tracie Sucharski - Changed setActiveControl and setActiveImageList to take a displayName instead of a Control/ImageList so that restoration of Project which contains an active control/imageList can be used. The only piece of info that can be saved to a project is the displayName.

2017-02-06 Tracie Sucharski - When adding a work order to the project, check the work order to determine if it should be put on the QUndoStack. Fixes #4598.

2017-03-30 Tracie Sucharski - Cleaned up some documentation regarding last change.

2017-04-04 Makayla Shepherd - Updated addToProject to support the new WorkOrder design. Fixes #4729.

2017-04-06 Tracie Sucharski - Added call to child WorkOrder::execute() even if it a CleanState.

2017-04-16 Ian Humphrey - Added activeControlSet and activeImageListSet, activeControlAndImageListSet signals. Added checkActiveControlAndImageList slot. This facilitates enabling the JigsawWorkOrder on the main window menu. Fixes #4749. Also, modified addToProject so that not undoable work orders have their redo called instead of execute.

2017-04-25 Ian Humphrey - Added checkControlsAndImagesAvailable() slot and controlsAndImagesAvailble() signal. These are used by internally by Project constructor to listen for when a control and image are added, used externally by directory to enable the jigsaw work order when a cnet and image are available in the project. Fixes #4819.

2017-05-02 Tracie Sucharski - Added saving and resoring of BundleSolutionInfo. Fixes #4822.

2017-05-15 Tracie Sucharski - Moved creation of BundleSolutionInfo results folder to JigsawDialog::acceptBundleResults. It was in Project::addBundleSolutionInfo which is called for both adding to the project and reading a saved project (which already has the folder). Backed out changes make for deciding whether to copy cube dn data because this broke importing images.

2017-05-17 Tracie Sucharski - Changed activeControl and activeImageList methods to return default values if project contains a single control and a single image list. Fixes #4867.

2017-07-13 Makayla Shepherd - Added the ability to change the name of image imports, shape imports, and bundle solution info. Fixes #4855, #4979, #4980.

2017-07-17 Cole Neubauer - Changed activeControl signal to emit a bool to be able to slot a setEnabled(bool) call to a QAction. This was necessary to reenable the CNet Tool when a control net is made active. Fixes #5046.

2017-07-24 Cole Neubauer - Added isOpen, isClean, setClean, and clear functions to allow for opening of a new project. Fixes #4969.

2017-07-27 Cole Neubauer - Added check before emmiting workOrderStarting() Fixes #4715.

2017-07-27 Cole Neubauer - Added a workordermutex to be used in workorder accessors Fixes #5082.

2017-08-02 Cole Neubauer - Made setClean emit a signal from undoStack. Fixes #4960

2017-08-03 Cole Neubauer - Parsed XML to remove leftover files not in project Fixes #5046.

2017-08-08 Makayla Shepherd - Fixed a seg fault that occurs when trying to edit a control net without having an active control net set. Fixes #5048.

2017-08-07 Cole Neubauer - Added functionality to switch between active controls and ImageList Fixes #4567

2017-08-11 Cole Neubauer - Removed unnecessary code in controlClosed that was a segfault causing. Fixes #5064

2017-08-11 Cole Neubauer - Updated documentation for setClean and isClean #5113

2017-08-11 Christopher Combs - Added addTemplates(), removeTemplate(), addTemplateFolder(), templateRoot(), and m_templates as well as serialization and structure for importing template filenames Fixes #5086.

2017-09-13 Tracie Sucharski - Fixed problems with cleanup on temporary projects. Remove shapes, controls, and results.

2017-09-26 Tracie Sucharski - Close Image cube in ::addTargetsFromImportedImagesToProject and ::addCamerasFromImportedImagesToProject. Fixes #4955.

2017-10-04 Tracie Sucharski - Comment out connections for addTargetsFromImportedImagesToProject and addCamerasFromImportedImagesToProject. This functionality needs to be put into the asynchronous process of importing images for speed and memory efficiency. See ticket #5181. Fixes #4955.

2017-10-16 Ian Humphrey - Modified activeControl() to check if any images have been imported into the project before trying to set an active control when there is only one control in the project. Fixes #5160.

2017-11-01 Tracie Sucharski - Added new member variable for the new project root when a Save As is being executed. Both the old and new project roots are needed for copying files into the new project folders. Also updated the project name based on the new project. Fixes #4849.

2017-11-02 Tyler Wilson - Added support for opening Recent Projects from the File Menu. Fixes #4492.

2017-11-08 Ian Humphrey - Changed save() from a void to a bool return value. This indicates if the save dialog (for a temp project) is successfully saved (i.e. not cancelled). Fixes #5205.

2017-11-03 Christopher Combs - Added support for new Template and TemplateList classes. Fixes #5117.

2017-11-13 Makayla Shepherd - Modifying the name of an ImageList, ShapeList or BundeSolutionInfo on the ProjectTree now sets the project to not clean. Fixes #5174.

2017-11-15 Cole Neubauer - Added a check if there was an arg for the command line to avoid creation of new temp project if a user is opening one from the command line #5222

2017-12-01 Adam Goins - Added the maxRecentProjects() function to return the max number of recent projects to be displayed. Fixes #5216.

2017-12-05 Christopher Combs - Added support for TemplateEditorWidget and TemplateEditViewWorkOrder. Fixes #5168. Also fixed issue with saving a project before save as where isOpen was not set to true.

2017-12-08 Tracie Sucharski - Added public method to add an Image to the idToImageMap. This was needed to add Images from the results item. We need to access the map when opening saved projects that contain images from groups other than the main project data area. This is a temporary fix until the project and model/view is improved. Corrected the setting of the project root when pening a project from the command line. Removed m_projectPath, it is no longer needed since m_projectRoot contains the correct path. References #5104.

2018-03-14 Ken Edmundson - Modified save method to reopen project if we are saving a temporary project to ensure all project files are pointing to the correct directory. Note that this is NOT ideal, particularly it the project has many files.

2018-03-14 Tracie Sucharski - Call the appropriate workorder from the methods activeControl and activeImageList when returning a default value. This ensures that all the proper error checking is handled and prevents duplicate code.

2018-03-23 Ken Edmundson - Modified loadBundleSolutionInfo method to add the BundleSolutionInfo's output control id to the project member variable m_idToControlMap.

2018-03-26 Tracie Sucharski - When setting a new active control do not close the old active control net if it is still being viewed in a CnetEditorWidget. References #5026.

2018-03-27 Tracie Sucharski - Removed the calls to work orders from activeImageList and activeControl methods. Additional errors checks needed for default values that are not in work orders. Fixes #5256.

2018-03-30 Tracie Sucharski - Added public slot, activeControlModified, which sets the modified state on the active Control. This was done, so that a Control knows if its control net has been modified. Also added signal, discardActiveControlEdits if user does not want to save edits. This is needed for CnetEditorWidgets that are displaying the modified active control, it will effectively close that CnetEditorView and reload with the original control net. It was done this way because there is no easy way to reload a control net in the CnetEditor widgets. When saving Project, if there is an active control and it has been modified, write active control to disk. Unfortunately this is done in 2 different places depending on whether a project "Save" or "Save As" is being done. If "Save As", a modified active cnet is not written out to the original project only to the new project, so this had to be done in Control::copyToNewProjectRoot. If simply saving current projct, the write is done here in the save method.

2018-04-25 Tracie Sucharski - Fixed typo in XmlHandler::startElement reading imported shapes from a project which caused the shapes to be put in the wrong place on the project tree. Fixes #5274.

2018-06-06 Kaitlyn Lee - activeControlModified() calls setClean(false) to enable the save button when the active control net is modified, i.e. a point is modified.

2018-06-14 Makayla Shepherd - Save and Save As now save the geometry and state of the project.

2018-07-07 Summer Stapleton - Separated m_templates into m_mapTemplates and m_regTemplates to keep track of the two template types as well as adjusted logic to save these serparately into the .xml files in the project directory. Also added clean-up of unsaved templates at project close in Project::clear().

2018-07-12 Summer Stapleton - Added hasTemplate() and hasCamera() and modified addCamera() and addTarget logic in order to determine if a targetBody or a guiCamera already exist in a project. This allows cameras and targets to be created in ImportImagesWorkOrder only when needed rather than creating them for every image imported and then removing them if not needed. Fixed segfault occuring on astrovm4 with larger imports. References #5460.

2018-07-12 Kaitlyn Lee - Changed activeControlModified() to cnetModified() and removed the line m_activeControl->setModified(true) in cnetModified() since this is now done in the CnetEditorWidget and it caused a seg fault when no images were imported and a user tried to edit a cnet. I changed this because when a user made changes to a cnet, even if it was not the active, the active was the only one that was recognized as being modified. This stopped any changes made to a nonactive cnet from being saved and caused the active to be saved if a nonactive was edited. Fixes #5414.

2018-07-13 Kaitlyn Lee - Added singal cnetSaved() so that the save net button goes back to black after the cnet is saved. Added signal activeControlModified() that is emitted in cnetModified() and is connected to Directory. This stops views from being redrawn when any cnet is modified. Only the active should cause this. Fixes #5396.

2018-07-26 Tracie Sucharski - Fixed history entry errors introduced during the merge conflict resolution for PR #255.

Definition at line 289 of file Project.h.

Constructor & Destructor Documentation

◆ Project()

Isis::Project::Project ( Directory directory,
QObject parent = 0 
)

◆ ~Project()

Isis::Project::~Project ( )

Clean up the project.

This will bring the Project back to a safe on-disk state.

Definition at line 257 of file Project.cpp.

References bundleSolutionInfo(), control(), controlList(), image(), imageList(), m_idToControlMap, shape(), and shapeList().

Member Function Documentation

◆ activeControl()

Control * Isis::Project::activeControl ( )

Return the Active Control (control network)

Returns the active control (control network) for views which need to operate on the same control, ie. Footprint2dView, CubeDnView, ControlPointEditView. IMPORTANT: Returns NULL if no active Control.

Returns
Control * Returns the active Control if set, otherwise returns NULL
History:

2016-06-23 Tracie Sucharski - Original version.

2017-05-17 Tracie Sucharski - If no active control set & there is only one control in the project, default to that control.

2017-10-16 Ian Humphrey - Check to make sure we have imported images before trying to set an active control when there is only one control in the project. Fixes #5160.

Definition at line 1903 of file Project.cpp.

References activeImageList(), and setActiveControl().

Referenced by Isis::Directory::cleanupCnetEditorViewWidgets(), Isis::ControlHealthMonitorView::ControlHealthMonitorView(), Isis::Footprint2DView::enableActions(), Isis::CubeDnView::enableActions(), Isis::SetActiveControlWorkOrder::isExecutable(), Isis::MosaicControlNetTool::loadNetwork(), Isis::Directory::newActiveControl(), Isis::MosaicControlNetTool::openControlNet(), Isis::ImportControlNetWorkOrder::postExecution(), Isis::Directory::reloadActiveControlInCnetEditorView(), setActiveImageList(), and Isis::ControlPointEditWidget::setControlFromActive().

◆ activeControlAndImageListSet

void Isis::Project::activeControlAndImageListSet ( )
signal

Emitted when both an active control and active image list have been set.

receivers: WorkOrder::enableWorkOrder

Referenced by checkActiveControlAndImageList().

◆ activeControlModified

void Isis::Project::activeControlModified ( )
signal

Emmited in cnetModified() when the actice control is modified.

Connected to Directory so that other views can redraw measures.

Referenced by cnetModified().

◆ activeControlSet

void Isis::Project::activeControlSet ( bool  boolean)
signal

Emitted when an active control is set.

receivers: Project::checkActiveControlAndImageList

Referenced by setActiveControl().

◆ activeImageList()

ImageList * Isis::Project::activeImageList ( )

Returns the active ImageList.

Returns the active ImageList for views which need to operate on the same list of images, ie. Footprint2dView, CubeDnView, ControlPointEditView. IMPORTANT: Returns NULL if active ImageList is not set and a default cannot be set if there are multiple image lists in the project.

History:

2016-06-23 Tracie Sucharski - Original version.

2017-05-17 Tracie Sucharski - If no active ImageList set & there is only one ImageList in the project, default to that ImageList.

Definition at line 2003 of file Project.cpp.

References imageList(), and setActiveImageList().

Referenced by activeControl(), Isis::SetActiveImageListWorkOrder::isExecutable(), and setActiveControl().

◆ activeImageListSet

void Isis::Project::activeImageListSet ( )
signal

Emitted when an active image list is set.

receivers: Project::checkActiveControlAndImageList

Referenced by setActiveImageList().

◆ addBundleSolutionInfo()

void Isis::Project::addBundleSolutionInfo ( BundleSolutionInfo bundleSolutionInfo)

Add the given BundleSolutionInfo to the current project.

This will cause the BundleSolutionInfo to be saved/restored from disk, Project-related GUIs to display the BundleSolutionInfo, and enable access to the BundleSolutionInfo given access to the project.

Definition at line 1194 of file Project.cpp.

References bundleSolutionInfo(), bundleSolutionInfoClosed(), loadBundleSolutionInfo(), and projectRelocated().

Referenced by Isis::JigsawRunWidget::on_JigsawAcceptButton_clicked().

◆ addBundleSolutionInfoFolder()

QDir Isis::Project::addBundleSolutionInfoFolder ( QString  folder)

Create and return the name of a folder for placing BundleSolutionInfo.

TODO: don't know if sentence below is accurate. This can be called from multiple threads, but should only be called by one thread at a time.

Definition at line 1174 of file Project.cpp.

References _FILEINFO_, bundleSolutionInfoRoot(), and Isis::IException::Io.

Referenced by Isis::JigsawRunWidget::on_JigsawAcceptButton_clicked().

◆ addCamera()

void Isis::Project::addCamera ( Camera camera)

Adds a new camera to the project.

Parameters
cameraThe camera to be added.

Definition at line 2761 of file Project.cpp.

References Isis::GuiCameraList::append().

Referenced by Isis::ImportImagesWorkOrder::importConfirmedImages().

◆ addCnetFolder()

QDir Isis::Project::addCnetFolder ( QString  prefix)

Create and return the name of a folder for placing control networks.

This can be called from multiple threads, but should only be called by one thread at a time.

Definition at line 926 of file Project.cpp.

References _FILEINFO_, cnetRoot(), and Isis::IException::Io.

Referenced by Isis::ImportControlNetWorkOrder::execute().

◆ addControl()

void Isis::Project::addControl ( Control control)

Add the given Control's to the current project.

This will cause the controls to be saved/restored from disk, Project-related GUIs to display the control, and enable access to the controls given access to the project.

Definition at line 958 of file Project.cpp.

References control(), controlAdded(), controlClosed(), Isis::Control::fileName(), Isis::Control::id(), and projectRelocated().

Referenced by Isis::ImportControlNetWorkOrder::cnetReady().

◆ addImageFolder()

QDir Isis::Project::addImageFolder ( QString  prefix)

Create and return the name of a folder for placing images.

This can be called from multiple threads, but should only be called by one thread at a time.

Definition at line 1003 of file Project.cpp.

References _FILEINFO_, imageDataRoot(), and Isis::IException::Io.

Referenced by Isis::ImportImagesWorkOrder::importConfirmedImages().

◆ addImages() [1/2]

void Isis::Project::addImages ( QStringList  imageFiles)

Read the given cube file names as Images and add them to the project.

Parameters
QStringListnames of imageFiles

Definition at line 1032 of file Project.cpp.

References m_numImagesCurrentlyReading.

Referenced by Isis::ImportImagesWorkOrder::postExecution().

◆ addImages() [2/2]

void Isis::Project::addImages ( ImageList  newImages)

Read the given cube file names as Images and add them to the project.

Parameters
ImageList

Definition at line 1046 of file Project.cpp.

References guiCamerasAdded(), imagesReady(), and targetsAdded().

◆ addImagesToIdMap()

void Isis::Project::addImagesToIdMap ( ImageList  images)

Add images to the id map which are not under the projects main data area, the Images node on the project tree, such as the images under bundle results.

This is an interim solution since the Project and model/view does not seem to be properly handling data which is not on the main data part of the project tree.

Parameters
ImagesListof images

Definition at line 2778 of file Project.cpp.

References Isis::Image::id(), image(), and images().

◆ addShapeFolder()

QDir Isis::Project::addShapeFolder ( QString  prefix)

Create and return the name of a folder for placing shape models.

This can be called from multiple threads, but should only be called by one thread at a time.

Definition at line 1060 of file Project.cpp.

References _FILEINFO_, Isis::IException::Io, and shapeDataRoot().

Referenced by Isis::ImportShapesWorkOrder::importConfirmedShapes().

◆ addShapes() [1/2]

void Isis::Project::addShapes ( QStringList  shapeFiles)

Read the given shape model cube file names as Images and add them to the project.

Parameters
QStringListof shape Files names

Definition at line 1089 of file Project.cpp.

Referenced by Isis::ImportShapesWorkOrder::postExecution().

◆ addShapes() [2/2]

void Isis::Project::addShapes ( ShapeList  newShapes)

Read the given shape model cube file names as Images and add them to the project.

Parameters
ShapeList

Definition at line 1103 of file Project.cpp.

◆ addTarget()

void Isis::Project::addTarget ( Target target)

Adds a new target to the project.

Parameters
targetThe target to be added.

Definition at line 2730 of file Project.cpp.

References Isis::TargetBodyList::append().

Referenced by Isis::ImportImagesWorkOrder::importConfirmedImages().

◆ addTemplateFolder()

QDir Isis::Project::addTemplateFolder ( QString  prefix)

Create and navigate to the appropriate template type folder in the project directory.

Parameters
prefixThe name of the director under templates/ to store the template file.

Definition at line 1134 of file Project.cpp.

References _FILEINFO_, Isis::IException::Io, and templateRoot().

Referenced by Isis::ImportRegistrationTemplateWorkOrder::execute(), and Isis::ImportMapTemplateWorkOrder::execute().

◆ addTemplates()

void Isis::Project::addTemplates ( TemplateList templateList)

Add new templates to m_mapTemplates or m_regTemplates and update project item model.

Parameters
newFileListQList of FileNames for each new imported template

Definition at line 1113 of file Project.cpp.

References projectRelocated(), and Isis::TemplateList::type().

Referenced by Isis::ImportRegistrationTemplateWorkOrder::execute(), and Isis::ImportMapTemplateWorkOrder::execute().

◆ addToProject()

void Isis::Project::addToProject ( WorkOrder workOrder)

◆ allControlsRemoved

void Isis::Project::allControlsRemoved ( )
signal

Emitted when all controls have been removed from the Project.

receivers: WorkOrder::disableWorkOrder

Currently does not work (there is no work order to remove cnets).

See also
Project::controlListDeleted(QObject *controlListObj)

Referenced by controlListDeleted().

◆ bundleSettings()

BundleSettings* Isis::Project::bundleSettings ( )
inline

Return BundleSettings objects in Project.

Returns
BundleSettings

Definition at line 390 of file Project.h.

◆ bundleSolutionInfo()

◆ bundleSolutionInfoAdded

void Isis::Project::bundleSolutionInfoAdded ( BundleSolutionInfo bundleSolutionInfo)
signal

Emitted when new BundleSolutionInfo available from jigsaw receivers: ProjectTreeWidget (TODO: should this be the Directory?)

Referenced by loadBundleSolutionInfo().

◆ bundleSolutionInfoClosed

void Isis::Project::bundleSolutionInfoClosed ( QObject bundleSolutionInfo)
privateslot

A BundleSolutionInfo object is being deleted from the project.

Definition at line 2867 of file Project.cpp.

References bundleSolutionInfo().

Referenced by addBundleSolutionInfo().

◆ bundleSolutionInfoRoot() [1/2]

QString Isis::Project::bundleSolutionInfoRoot ( QString  projectRoot)
static

Appends the root directory name 'bundle' to the project results directory.

Returns
The path to the root directory of bundle results data.

Definition at line 2233 of file Project.cpp.

References projectRoot().

Referenced by Isis::JigsawRunWidget::on_JigsawAcceptButton_clicked(), and Isis::BundleSolutionInfo::save().

◆ bundleSolutionInfoRoot() [2/2]

QString Isis::Project::bundleSolutionInfoRoot ( ) const

Accessor for the root directory of the results data.

Returns
The path to the root directory of the results data.

Definition at line 2243 of file Project.cpp.

Referenced by addBundleSolutionInfoFolder(), createFolders(), open(), and Isis::BundleSolutionInfo::save().

◆ checkActiveControlAndImageList

void Isis::Project::checkActiveControlAndImageList ( )
privateslot

Checks if both an active control and active image list have been set.

This can be used to check when both an active control and active image list have been set. This is used for enabling the jigsaw work order on the Project menu when there is an active control and image list set.

See also
Directory::initializeActions()

Definition at line 1767 of file Project.cpp.

References activeControlAndImageListSet().

◆ checkControlsAndImagesAvailable

void Isis::Project::checkControlsAndImagesAvailable ( )
privateslot

Checks if at least one control and image have been added to the project.

This can be used to check whenever there are control nets and images available in the project. This is used for enabling the jigsaw work order on the Project menu when a control net and image are available / loaded in the project.

See also
Project::Project(Directory &directory, QObject *parent)
Directory::initializeActions()

Definition at line 1784 of file Project.cpp.

References controls(), controlsAndImagesAvailable(), and images().

Referenced by Project().

◆ clear()

void Isis::Project::clear ( )

Function to clear out all values in a project essentially making it a new project object.

This function is also respoinsible for cleaning any directories created when importing but are no longer a part of the project.

Definition at line 459 of file Project.cpp.

References _FILEINFO_, Isis::Directory::clean(), Isis::TargetBodyList::clear(), Isis::GuiCameraList::clear(), controls(), directory(), images(), m_clearing, mapTemplates(), Isis::IException::Programmer, projectRoot(), regTemplates(), setClean(), shapes(), and Isis::Environment::userName().

Referenced by Isis::CloseProjectWorkOrder::execute(), and open().

◆ cnetModified

void Isis::Project::cnetModified ( )
slot

When a cnet is modified, set the project state to not clean.

If the active control was modified, send a signal back to Directory so that other views know that the active was modified. This allows for CubeDnView and Footprint2DView to be redrawn. Currently, this was the easiest place to emit this signal.

Definition at line 1924 of file Project.cpp.

References activeControlModified(), and setClean().

◆ cnetRoot() [1/2]

QString Isis::Project::cnetRoot ( QString  projectRoot)
static

Appends the root directory name 'cnets' to the project.

Returns
The path to the root directory of the cnet data.

Definition at line 2019 of file Project.cpp.

References projectRoot().

Referenced by Isis::Control::copyToNewProjectRoot(), Isis::ControlList::deleteFromDisk(), Isis::Control::updateFileName(), and Isis::BundleSolutionInfo::updateFileName().

◆ cnetRoot() [2/2]

QString Isis::Project::cnetRoot ( ) const

Get where control networks ought to be stored inside the project.

This is a full path.

Returns
The path to the root directory of the cnet data.

Definition at line 2029 of file Project.cpp.

Referenced by addCnetFolder(), createFolders(), deleteAllProjectFiles(), and Isis::ControlList::save().

◆ cnetSaved

void Isis::Project::cnetSaved ( bool  value)
signal

Emmited in save() when the project is being saved Connected to Directory so that ControlPointEditWidget can recolor the save net button.

Referenced by save().

◆ control()

Control * Isis::Project::control ( QString  id)

Accessor for if the project is clearing or not.

Given the id return the corrsponding control net.

Parameters
QStringid of control net

Definition at line 1163 of file Project.cpp.

References m_idToControlMap.

Referenced by addControl(), Isis::Project::XmlHandler::endElement(), Isis::ExportControlNetWorkOrder::execute(), save(), and ~Project().

◆ controlAdded

void Isis::Project::controlAdded ( Control control)
signal

Emitted when new Control added to Project receivers: ProjectTreeWidget.

Referenced by addControl().

◆ controlClosed

void Isis::Project::controlClosed ( QObject control)
privateslot

A control is being deleted from the project.

Definition at line 2833 of file Project.cpp.

References m_idToControlMap.

Referenced by addControl().

◆ controlList()

ControlList * Isis::Project::controlList ( QString  name)

Return controlslist matching name in Project.

Parameters
QStringname of controllist to be returned
Returns
ControlList matching name

Definition at line 2048 of file Project.cpp.

References Isis::ControlList::name(), and name().

Referenced by save(), and ~Project().

◆ controlListAdded

void Isis::Project::controlListAdded ( ControlList controls)
signal

apparently not used?

Emitted when new ControlList added to Project receivers: ProjectTreeWidget

Referenced by Project().

◆ controlListDeleted

void Isis::Project::controlListDeleted ( QObject controlList)
privateslot

An control list is being deleted from the project.

Definition at line 2841 of file Project.cpp.

References allControlsRemoved(), and controls().

◆ controls()

◆ controlsAndImagesAvailable

void Isis::Project::controlsAndImagesAvailable ( )
signal

Emitted when at least one cnet and image have been added to the project.

This is used to enable the JigsawWorkOrder in the main menu. receivers: WorkOrder::enableWorkOrder

Referenced by checkControlsAndImagesAvailable().

◆ createFolders()

void Isis::Project::createFolders ( )
private

This creates the project root, image root, and control net root directories.

Definition at line 384 of file Project.cpp.

References _FILEINFO_, bundleSolutionInfoRoot(), cnetRoot(), imageDataRoot(), Isis::IException::Io, resultsRoot(), shapeDataRoot(), and templateRoot().

Referenced by Project().

◆ deleteAllProjectFiles()

void Isis::Project::deleteAllProjectFiles ( )

Delete all of the files, that this project stores, from disk.

Definition at line 2251 of file Project.cpp.

References cnetRoot(), Isis::ShapeList::deleteFromDisk(), Isis::ControlList::deleteFromDisk(), Isis::ImageList::deleteFromDisk(), imageDataRoot(), resultsRoot(), shapeDataRoot(), and templateRoot().

Referenced by save().

◆ directory()

Directory * Isis::Project::directory ( ) const

Returns the directory associated with this Project.

The directory is not part of the project so a non-const pointer is returned and this is okay.

Returns
The Directory that was used to create this Project.

Definition at line 1229 of file Project.cpp.

Referenced by clear(), Isis::WorkOrder::directory(), Isis::ControlHealthMonitorWorkOrder::execute(), Isis::TemplateEditViewWorkOrder::execute(), Isis::BundleObservationViewWorkOrder::execute(), Isis::MatrixViewWorkOrder::execute(), Isis::SensorGetInfoWorkOrder::execute(), Isis::TargetGetInfoWorkOrder::execute(), Isis::ImageFileListViewWorkOrder::execute(), Isis::CnetEditorViewWorkOrder::execute(), Isis::RemoveImagesWorkOrder::execute(), Isis::CubeDnViewWorkOrder::execute(), Isis::JigsawWorkOrder::execute(), Isis::Footprint2DViewWorkOrder::execute(), Isis::TemplateEditViewWorkOrder::isExecutable(), Isis::SensorGetInfoWorkOrder::isExecutable(), Isis::TargetGetInfoWorkOrder::isExecutable(), open(), Project(), setActiveControl(), setActiveImageList(), Isis::MatrixViewWorkOrder::setupExecution(), Isis::ImageFileListViewWorkOrder::setupExecution(), Isis::RemoveImagesWorkOrder::setupExecution(), Isis::CubeDnViewWorkOrder::setupExecution(), Isis::Footprint2DViewWorkOrder::setupExecution(), Isis::ImportRegistrationTemplateWorkOrder::undoExecution(), Isis::ImportMapTemplateWorkOrder::undoExecution(), Isis::MatrixViewWorkOrder::undoExecution(), Isis::CnetEditorViewWorkOrder::undoExecution(), Isis::ImportShapesWorkOrder::undoExecution(), and Isis::ImportImagesWorkOrder::undoExecution().

◆ guiCamerasAdded

void Isis::Project::guiCamerasAdded ( GuiCameraList targets)
signal

Emitted when new GuiCamera objects added to project receivers: Directory.

Referenced by addImages().

◆ hasCamera()

bool Isis::Project::hasCamera ( QString  id)

This method checks for the existence of a camera based on InstrumentId.

Parameters
idThe instrument string to be compared.
Returns
bool Returns true if GuiCamera already exists in project

Definition at line 2745 of file Project.cpp.

◆ hasTarget()

bool Isis::Project::hasTarget ( QString  id)

This method checks for the existence of a target based on TargetName.

Parameters
idThe target string to be compared.
Returns
bool Returns true if targetBody already exists in project

Definition at line 2715 of file Project.cpp.

◆ image()

Image * Isis::Project::image ( QString  id)

Return an image given its id.

Parameters
QStringid
Returns
Image matching id

Definition at line 1509 of file Project.cpp.

Referenced by addImagesToIdMap(), Isis::WorkOrder::imageList(), imagesReady(), and ~Project().

◆ imageClosed

void Isis::Project::imageClosed ( QObject imageObj)
privateslot

An image is being deleted from the project.

Parameters
QObjectimage object to be closed

Definition at line 2802 of file Project.cpp.

References Isis::ImageList::removeAt().

Referenced by imagesReady().

◆ imageDataRoot() [1/2]

QString Isis::Project::imageDataRoot ( QString  projectRoot)
static

Appends the root directory name 'images' to the project .

Returns
The path to the root directory of the image data.

Definition at line 2067 of file Project.cpp.

References projectRoot().

Referenced by Isis::ImageList::deleteFromDisk(), and Isis::Image::updateFileName().

◆ imageDataRoot() [2/2]

QString Isis::Project::imageDataRoot ( ) const

Accessor for the root directory of the image data.

Returns
The path to the root directory of the image data.

Definition at line 2077 of file Project.cpp.

Referenced by addImageFolder(), Isis::Image::copyToNewProjectRoot(), createFolders(), deleteAllProjectFiles(), and Isis::ImageList::save().

◆ imageList()

ImageList * Isis::Project::imageList ( QString  name)

Return an imagelist given its name.

Parameters
QStringname
Returns
Imagelist matching name

Definition at line 1520 of file Project.cpp.

References Isis::ImageList::name(), and name().

Referenced by activeImageList(), Isis::Project::XmlHandler::endElement(), Isis::ExportImagesWorkOrder::execute(), and ~Project().

◆ imageListAdded

void Isis::Project::imageListAdded ( ImageList images)
signal

Emitted when new ImageList added to Project receivers: ProjectTreeWidget.

◆ imageListDeleted

void Isis::Project::imageListDeleted ( QObject imageListObj)
privateslot

An image list is being deleted from the project.

Parameters
QObjectlist of images to be deleted

Definition at line 2822 of file Project.cpp.

◆ images() [1/2]

QStringList Isis::Project::images ( QStringList  fileNames)
static

Verify that the input fileNames are image files.

Parameters
fileNamesnames of files on disk
Returns
the files that are images.

Definition at line 894 of file Project.cpp.

Referenced by Isis::RemoveImagesWorkOrder::execute(), Isis::ControlHealthMonitorView::openImageEditor(), Isis::ImportImagesWorkOrder::postExecution(), and Isis::ProjectItem::ProjectItem().

◆ images() [2/2]

QList< ImageList * > Isis::Project::images ( )

Return projects imagelist.

Returns
Imagelist

Definition at line 2115 of file Project.cpp.

Referenced by addImagesToIdMap(), checkControlsAndImagesAvailable(), clear(), and imagesReady().

◆ imagesAdded

void Isis::Project::imagesAdded ( ImageList images)
signal

Emitted when new images are available.

receivers: Directory, Project, WorkOrder

Referenced by imagesReady(), and Project().

◆ imagesReady

void Isis::Project::imagesReady ( ImageList  images)
privateslot

Prepare new images for opening.

Parameters
Imagelistof images

Definition at line 2666 of file Project.cpp.

References Isis::ImageList::append(), Isis::Image::closeCube(), Isis::Image::id(), image(), imageClosed(), images(), imagesAdded(), m_numImagesCurrentlyReading, and projectRelocated().

Referenced by addImages(), and Project().

◆ isClean()

bool Isis::Project::isClean ( )

Accessor to determine whether the current project is Unsaved.

This is used to determine how the program should react with things like opening a new project or closing he window.

Definition at line 1584 of file Project.cpp.

References m_isClean.

Referenced by open().

◆ isOpen()

bool Isis::Project::isOpen ( )

Accessor to determine whether a current project is Open.

Definition at line 1575 of file Project.cpp.

Referenced by open().

◆ isTemporaryProject()

bool Isis::Project::isTemporaryProject ( ) const

Returns if the project is a temp project or not.

Returns
bool true if the project is temporary false otherwise

Definition at line 1567 of file Project.cpp.

Referenced by Isis::ImportImagesWorkOrder::setupExecution().

◆ lastNotUndoneWorkOrder() [1/2]

WorkOrder * Isis::Project::lastNotUndoneWorkOrder ( )

Return the last not undone workorder.

Returns
WorkOrder

Definition at line 1605 of file Project.cpp.

References Isis::WorkOrder::isUndoing(), Isis::WorkOrder::isUndone(), and Isis::WorkOrder::previous().

Referenced by addToProject().

◆ lastNotUndoneWorkOrder() [2/2]

const WorkOrder * Isis::Project::lastNotUndoneWorkOrder ( ) const

Return the last not undone workorder.

Returns
WorkOrder

Definition at line 1634 of file Project.cpp.

References Isis::WorkOrder::isUndoing(), Isis::WorkOrder::isUndone(), and Isis::WorkOrder::previous().

◆ loadBundleSolutionInfo()

void Isis::Project::loadBundleSolutionInfo ( BundleSolutionInfo bundleSolutionInfo)

Loads bundle solution info into project.

Parameters
BundleSolutionInfo

Definition at line 1210 of file Project.cpp.

References bundleSolutionInfo(), and bundleSolutionInfoAdded().

Referenced by addBundleSolutionInfo().

◆ mapTemplates()

QList< TemplateList * > Isis::Project::mapTemplates ( )

Return map template FileNames.

Returns
QList of FileName

Definition at line 2156 of file Project.cpp.

Referenced by clear().

◆ maxRecentProjects()

static int Isis::Project::maxRecentProjects ( )
inlinestatic

Return max number of recent projects to be displayed.

Returns
Max number of recent Projects

Definition at line 396 of file Project.h.

Referenced by Isis::Directory::updateRecentProjects().

◆ mutex()

QMutex * Isis::Project::mutex ( )

Return mutex used for Naif calls.

This method is thread-safe.

Author
2012-09-11 Tracie Sucharski
Returns
QMutex*

Definition at line 1658 of file Project.cpp.

Referenced by Isis::Control::openControlNet().

◆ name()

◆ nameChanged

void Isis::Project::nameChanged ( QString  newName)
signal

Emitted when project name is changed receivers: ProjectTreeWidget.

Referenced by setName().

◆ newProjectRoot()

QString Isis::Project::newProjectRoot ( ) const

Get the top-level folder of the new project.

This is where the project is opened from/saved to. This is set when a Save As operation is in progress.

Definition at line 1675 of file Project.cpp.

Referenced by Isis::Image::copyToNewProjectRoot(), relocateProjectRoot(), Isis::ImageList::save(), Isis::BundleSolutionInfo::save(), and save().

◆ open

void Isis::Project::open ( QString  projectPathStr)
slot

Open the project at the given path.

Parameters
Thepath to the project folder
History:

Tyler Wilson - Added try-catch blocks around all reader.parse calls. The exception information is not piped to the Warnings tab in the GUI instead of the command line, and the application starts instead of executing prematurely. Fixes #4488.

2017-07-24 Cole Neubauer - Moved all exception checking in Open function to beginning of function to avoid clearing a project when an invalid directory is chosen Fixes #4969

Definition at line 1345 of file Project.cpp.

References _FILEINFO_, bundleSolutionInfoRoot(), clear(), directory(), Isis::IException::Io, isClean(), isOpen(), m_clearing, projectLoaded(), Isis::XmlStackedHandlerReader::pushContentHandler(), setClean(), Isis::Directory::showWarning(), and Isis::IException::toString().

Referenced by Isis::SaveProjectAsWorkOrder::execute(), Isis::OpenProjectWorkOrder::execute(), and save().

◆ projectLoaded

void Isis::Project::projectLoaded ( Project )
signal

Emitted when project loaded receivers: IpceMainWindow, Directory, HistoryTreeWidget.

Referenced by open().

◆ projectRelocated

void Isis::Project::projectRelocated ( Project )
signal

Emitted when project location moved receivers: Control, BundleSolutionInfo, Image, TargetBody.

Referenced by addBundleSolutionInfo(), addControl(), addTemplates(), imagesReady(), and relocateProjectRoot().

◆ projectRoot()

◆ projectSaved

void Isis::Project::projectSaved ( Project )
signal

Emitted when project is saved.

receivers: IpceMainWindow

◆ regTemplates()

QList< TemplateList * > Isis::Project::regTemplates ( )

Return registration template FileNames.

Returns
QList of FileName

Definition at line 2166 of file Project.cpp.

Referenced by clear(), and Isis::ControlPointEditWidget::createPointEditor().

◆ relocateProjectRoot()

void Isis::Project::relocateProjectRoot ( QString  newProjectRoot)

This is called when the project is moved.

Parameters
newProjectRootThe new root directory for the project.

Definition at line 2305 of file Project.cpp.

References newProjectRoot(), and projectRelocated().

Referenced by save().

◆ resultsRoot() [1/2]

QString Isis::Project::resultsRoot ( QString  projectRoot)
static

Appends the root directory name 'results' to the project.

Returns
The path to the root directory of bundleresults data.

Definition at line 2204 of file Project.cpp.

References projectRoot().

◆ resultsRoot() [2/2]

QString Isis::Project::resultsRoot ( ) const

Accessor for the root directory of the results data.

Returns
The path to the root directory of the results data.

Definition at line 2214 of file Project.cpp.

Referenced by createFolders(), and deleteAllProjectFiles().

◆ save() [1/3]

bool Isis::Project::save ( )

Generic save method to save the state of the project.

This method is used to save the state of the project. If the project is currently a temporary project, this method will create a file dialog to prompt the user for a place/name to save the project as. Otherwise, the existing project state will be saved. This method also informs the caller whether or not the save occurred. It is possible for a save to NOT occur if the project is a temporary project and the user cancels/closes the dialog prompt.

Returns
bool Returns true if the save completed. The save is considered incomplete if the project is a temporary project and the user either cancels or closes the file dialog prompt that is created.

Definition at line 2324 of file Project.cpp.

References cnetSaved(), control(), controlList(), deleteAllProjectFiles(), Isis::Control::isModified(), open(), relocateProjectRoot(), and Isis::Control::write().

Referenced by Isis::SaveProjectAsWorkOrder::execute(), and Isis::SaveProjectWorkOrder::setupExecution().

◆ save() [2/3]

void Isis::Project::save ( FileName  newPath,
bool  verifyPathDoesntExist = true 
)

Project::save Saves the project state out to an XML file.

Parameters
projectPathThe path to the project directory.
verifyPathDoesntExistA boolean variable which is set to true if we wish to check that we are not overwriting a pre-existing save.

XML Serialization. Below is a tree listing the XML tag hiearchy.

{projectXMLTagHierarchy.png}"Project::Save XML Tag Hierarchy"

{ {T +project (project.xml) ++controlNets +++controlList 1 (controls.xml) ++++controls +++++controlNet +++controlList 2 ++++controls +++++controlNet ++imageLists +++imageList 1 (images.xml) ++++images +++++image +++imageList 2 (images.xml) ++++images +++++image ++shapeLists +++shapeList 1 (shapes.xml) ++++shapes +++++shape +++shapeList 2 (shapes.xml) ++bundleRuns (currently the tag is output, but not run times) ++activeImageList ++activeControl } }

The figure below represents a flow chart for XML code generation which starts with a call to this function:

Definition at line 2472 of file Project.cpp.

References _FILEINFO_, Isis::IException::Io, Isis::FileName::name(), Isis::FileName::original(), and Isis::FileName::toString().

◆ save() [3/3]

void Isis::Project::save ( QXmlStreamWriter &  stream,
FileName  newProjectRoot 
) const
private

Converts the project settings into XML.

The format of the project settings is:

  <project>
    <controlNets>
      <controlNet name="...">
    </controlNets>
  </project>
 

Definition at line 726 of file Project.cpp.

References newProjectRoot().

◆ saveHistory()

void Isis::Project::saveHistory ( QXmlStreamWriter &  stream) const
private

Serialize the work orders into the given XML.

The format of the history xml is:

  <history>
    <workOrder>
       ...
    </workOrder>
    <workOrder>
       ...
    </workOrder>
  </history>

Definition at line 851 of file Project.cpp.

References Isis::WorkOrder::save().

◆ saveWarnings()

void Isis::Project::saveWarnings ( QXmlStreamWriter &  stream) const
private

Serialize the warnings into the given XML.

The format of the warnings xml is:

  <warnings>
    <warning text="...">
    <warning text="...">
  </warnings>

Definition at line 874 of file Project.cpp.

◆ setActiveControl()

void Isis::Project::setActiveControl ( QString  displayName)

Set the Active Control (control network)

Set the active control (control network) for views which need to operate on the same control, ie. Footprint2dView, CubeDnView, ControlPointEditView.

History:

2016-06-23 Tracie Sucharski - Original version.

2016-12-22 Tracie Sucharski - Changed to take a displayName, so that it can be used when loading a saved project which has an active control saved with the displayName.

2017-01-09 Tracie Sucharski - Moved SetImages step from SetActiveControlWorkOrder::execute so that SetImages is always done whether from the workorder or calling this method directly from the project loading. TODO: should project loading call the WorkOrder rather than this method directly?

2017-07-25 Cole Neubauer - Removed code that stops a new control from being chosen Fixes #4969

2017-08-02 Cole Neubauer - Added functionality to switch between active controls Fixes #4567

2018-03-30 Tracie Sucharski - If current activeControl has been modified, prompt for saving. Emit signal to discardActiveControlEdits.

2018-07-12 Tracie Sucharski - Moved the close/open control net from Directory::reloadActiveControlInCnetEditorView to this method to prevent seg fault when there are multiple cnetEditorViews with same cnet.

Definition at line 1819 of file Project.cpp.

References activeControlSet(), activeImageList(), Isis::ProjectItem::control(), directory(), Isis::ProjectItemModel::findItemData(), Isis::ProjectItem::isControl(), and Isis::Directory::model().

Referenced by activeControl(), and Isis::SetActiveControlWorkOrder::execute().

◆ setActiveImageList()

void Isis::Project::setActiveImageList ( QString  displayName)

Set the Active ImageList from the displayName which is saved in project.xml.

Set the active ImageList for views which need to operate on the same list of images, ie. Footprint2dView, CubeDnView, ControlPointEditView. This version of the setActiveImageList method is used when loading a project which has an activeImageList saved.

History:

2016-12-02 Tracie Sucharski - Original version.

2016-12-29 Tracie Sucharski - Combined the functionality of setActiveImageList(ImageList *) in this method. This will allow projects saved with an active ImageList to be restored properly. Only the displayName is saved in a project since the ImageList is created when the project is loaded. As long as the Images and Controls are loaded before the setActiveImageList is loaded, there will be a correct correspondence between the displayName and ImageList.

2017-07-25 Cole Neubauer - Removed code that stops a new imageList from being choosen Fixes #4969

2017-08-02 Cole Neubauer - Added functionality to switch between active imagelist Fixes #4567

Definition at line 1955 of file Project.cpp.

References activeControl(), activeImageListSet(), Isis::Control::controlNet(), directory(), Isis::ProjectItemModel::findItemData(), Isis::ProjectItem::imageList(), Isis::ProjectItem::isImageList(), Isis::Directory::model(), name(), and Isis::ControlNet::SetImages().

Referenced by activeImageList(), and Isis::SetActiveImageListWorkOrder::execute().

◆ setClean

◆ setName()

void Isis::Project::setName ( QString  newName)

Change the project's name (GUI only, doesn't affect location on disk).

Definition at line 1684 of file Project.cpp.

References nameChanged().

Referenced by Isis::RenameProjectWorkOrder::execute(), and Isis::RenameProjectWorkOrder::undoExecution().

◆ shape()

Shape * Isis::Project::shape ( QString  id)

Return a shape given its id.

Parameters
QStringid
Returns
Shape matching id

Definition at line 1539 of file Project.cpp.

Referenced by Isis::WorkOrder::shapeList(), and ~Project().

◆ shapeClosed

void Isis::Project::shapeClosed ( QObject shape)
privateslot

A shape model is being deleted from the project.

Definition at line 2954 of file Project.cpp.

References Isis::ShapeList::removeAt().

◆ shapeDataRoot() [1/2]

QString Isis::Project::shapeDataRoot ( QString  projectRoot)
static

Appends the root directory name 'shapes' to the project .

Returns
The path to the root directory of the shape models data.

Definition at line 2087 of file Project.cpp.

References projectRoot().

Referenced by Isis::ControlPointEditWidget::checkGroundFileLocation(), Isis::ShapeList::deleteFromDisk(), and Isis::Shape::updateFileName().

◆ shapeDataRoot() [2/2]

QString Isis::Project::shapeDataRoot ( ) const

Accessor for the root directory of the shape model data.

Returns
The path to the root directory of the shape model data.

Definition at line 2097 of file Project.cpp.

Referenced by addShapeFolder(), Isis::Shape::copyToNewProjectRoot(), createFolders(), deleteAllProjectFiles(), and Isis::ShapeList::save().

◆ shapeList()

ShapeList * Isis::Project::shapeList ( QString  name)

Return a shapelist given its name.

Parameters
QStringname
Returns
Shapelist matching name

Definition at line 1549 of file Project.cpp.

References Isis::ShapeList::name(), and name().

Referenced by Isis::Project::XmlHandler::endElement(), and ~Project().

◆ shapeListDeleted

void Isis::Project::shapeListDeleted ( QObject shapeList)
privateslot

A shape model list is being deleted from the project.

Definition at line 2856 of file Project.cpp.

◆ shapes()

QList< ShapeList * > Isis::Project::shapes ( )

Return the projects shapelist.

Returns
Qlist of Shapelist

Definition at line 2106 of file Project.cpp.

Referenced by clear().

◆ shapesAdded

void Isis::Project::shapesAdded ( ShapeList shapes)
signal

Emitted when new shape model images are available.

receivers: Directory, Project, WorkOrder

◆ targetBodies()

TargetBodyList Isis::Project::targetBodies ( )

Return TargetBodyList in Project.

Definition at line 2194 of file Project.cpp.

◆ targetBodyClosed

void Isis::Project::targetBodyClosed ( QObject targetBodyObj)
privateslot

A target body is being deleted from the project.

TODO: should prevent deleting a target body if there are currently images in the project with this target?

Definition at line 2893 of file Project.cpp.

◆ targetBodyRoot() [1/2]

QString Isis::Project::targetBodyRoot ( QString  projectRoot)
static

Appends the root directory name 'targets' to the project .

Returns
The path to the root directory of the target body data.

Definition at line 2176 of file Project.cpp.

References projectRoot().

◆ targetBodyRoot() [2/2]

QString Isis::Project::targetBodyRoot ( ) const

Accessor for the root directory of the target body data.

Returns
The path to the root directory of the target body data.

Definition at line 2186 of file Project.cpp.

◆ targetsAdded

void Isis::Project::targetsAdded ( TargetBodyList targets)
signal

Emitted when new TargetBody objects added to project receivers: Directory.

Referenced by addImages().

◆ templateRoot() [1/2]

QString Isis::Project::templateRoot ( QString  projectRoot)
static

Appends the root directory name 'templates' to the project .

Returns
The path to the root directory of the templates data.

Definition at line 2125 of file Project.cpp.

References projectRoot().

Referenced by Isis::TemplateList::deleteFromDisk(), Isis::ControlPointEditWidget::setTemplateFile(), and Isis::Template::updateFileName().

◆ templateRoot() [2/2]

QString Isis::Project::templateRoot ( ) const

Accessor for the root directory of the template data.

Returns
The path to the root directory of the template data.

Definition at line 2135 of file Project.cpp.

Referenced by addTemplateFolder(), createFolders(), deleteAllProjectFiles(), and Isis::TemplateList::save().

◆ templates()

QList< TemplateList * > Isis::Project::templates ( )

Return all template FileNames.

Returns
QList of FileName

Definition at line 2145 of file Project.cpp.

Referenced by Isis::ProjectItem::ProjectItem().

◆ undoStack()

QUndoStack * Isis::Project::undoStack ( )

◆ userPreferenceActions()

QList< QAction * > Isis::Project::userPreferenceActions ( )

Get a list of configuration/settings actions related to reading images into this Project.

These are things like default opacity, default filled, etc.

Definition at line 916 of file Project.cpp.

References Isis::ImageDisplayProperties::FootprintViewProperties.

◆ waitForImageReaderFinished()

void Isis::Project::waitForImageReaderFinished ( )

Locks program if another spot in code is still running and called this function.

Definition at line 1732 of file Project.cpp.

Referenced by Isis::ImportImagesWorkOrder::undoExecution().

◆ waitForShapeReaderFinished()

void Isis::Project::waitForShapeReaderFinished ( )

Locks program if another spot in code is still running and called this function.

Definition at line 1740 of file Project.cpp.

Referenced by Isis::ImportShapesWorkOrder::undoExecution().

◆ workOrderFinished

void Isis::Project::workOrderFinished ( WorkOrder )
signal

Emitted when work order ends.

Referenced by addToProject().

◆ workOrderHistory()

QList< WorkOrder * > Isis::Project::workOrderHistory ( )

Get the entire list of work orders that have executed.

Definition at line 1748 of file Project.cpp.

Referenced by Isis::HistoryTreeWidget::showHistory().

◆ workOrderMutex()

QMutex * Isis::Project::workOrderMutex ( )

This function returns a QMutex.

This was needed to be able to deal with a threading issue with Work Order functions returning a member variable. This is used by creating a QMutexLocker inside of a function accessing a member variable and using the returned QMutex from this function as a parameter. Because the QMutexLocker was created in the function accessing the member variable when the function exits the QMutexLocker is destroyed and the QMutex is unlocked.

Returns
QMutex

Definition at line 2986 of file Project.cpp.

◆ workOrderStarting

void Isis::Project::workOrderStarting ( WorkOrder )
signal

Emitted when work order starts.

Referenced by addToProject().

Member Data Documentation

◆ m_clearing

bool Isis::Project::m_clearing
private

used to determine whether a project's changes are unsaved

Definition at line 667 of file Project.h.

Referenced by clear(), open(), and Project().

◆ m_idToControlMap

QMap<QString, Control *>* Isis::Project::m_idToControlMap
private

This variable will probably go away when we add the bundle results object because it will be under: BundleSolutionInfo BundleResults CorrelationMatrix.

Definition at line 651 of file Project.h.

Referenced by control(), controlClosed(), Project(), and ~Project().

◆ m_isClean

bool Isis::Project::m_isClean
private

used to determine whether a project is currently open

Definition at line 666 of file Project.h.

Referenced by isClean(), Project(), and setClean().

◆ m_numImagesCurrentlyReading

int Isis::Project::m_numImagesCurrentlyReading
private

used to negate segfaults happening in post undos when clearning project

Definition at line 668 of file Project.h.

Referenced by addImages(), imagesReady(), and Project().


The documentation for this class was generated from the following files: