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.
 
void setClean (bool value)
 Function to change the clean state of the project.
 
void cnetModified ()
 When a cnet is modified, set the project state to not clean.
 

Signals

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

Public Member Functions

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

Private Slots

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

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.
 
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.
 
void saveHistory (QXmlStreamWriter &stream) const
 Serialize the work orders into the given XML.
 
void saveWarnings (QXmlStreamWriter &stream) const
 Serialize the warnings into the given XML.
 
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.
 
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
 
bool m_clearing
 used to determine whether a project's changes are unsaved
 
int m_numImagesCurrentlyReading
 used to negate segfaults happening in post undos when clearning project
 
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 256 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)

@description 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 1902 of file Project.cpp.

References activeImageList(), and setActiveControl().

Referenced by Isis::Directory::cleanupCnetEditorViewWidgets(), Isis::ControlHealthMonitorView::ControlHealthMonitorView(), Isis::CubeDnView::enableActions(), Isis::Footprint2DView::enableActions(), Isis::MosaicControlNetTool::loadNetwork(), Isis::MosaicControlNetTool::openControlNet(), Isis::ImportControlNetWorkOrder::postExecution(), 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 2002 of file Project.cpp.

References imageList(), and setActiveImageList().

Referenced by activeControl(), 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 1193 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 1173 of file Project.cpp.

References 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 2760 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 925 of file Project.cpp.

References 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 957 of file Project.cpp.

References Isis::ControlList::append(), control(), controlAdded(), controlClosed(), Isis::FileName::dir(), 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 1002 of file Project.cpp.

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

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

◆ addImages() [1/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 1045 of file Project.cpp.

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

◆ addImages() [2/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 1031 of file Project.cpp.

References m_numImagesCurrentlyReading.

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

◆ 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 2777 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 1059 of file Project.cpp.

References 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 1088 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 1102 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 2729 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 1133 of file Project.cpp.

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

Referenced by Isis::ImportMapTemplateWorkOrder::execute(), and Isis::ImportRegistrationTemplateWorkOrder::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 1112 of file Project.cpp.

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

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

◆ addToProject()

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

This executes the WorkOrder and stores it in the project.

@decription Run the WorkOrder and stores it in the project. If WorkOrder::setupExecution() returns true then the WorkOrder's redo is called. This takes ownership of WorkOrder.

The order of events is: 1) WorkOrder::setupExecution() 2) emit workOrderStarting() 3) WorkOrder::redo()

See also
WorkOrder::redo()
Parameters
workOrderThe work order to be executed. This work order must not already be in the project.

Definition at line 2597 of file Project.cpp.

References lastNotUndoneWorkOrder(), workOrderFinished(), and workOrderStarting().

Referenced by Isis::WorkOrder::addCloneToProject(), Isis::Directory::initiateRenameProjectWorkOrder(), Isis::CloseProjectWorkOrder::setupExecution(), and Isis::OpenProjectWorkOrder::setupExecution().

◆ 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 2866 of file Project.cpp.

References bundleSolutionInfo().

Referenced by addBundleSolutionInfo().

◆ bundleSolutionInfoRoot() [1/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 2242 of file Project.cpp.

References bundleSolutionInfoRoot().

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

◆ bundleSolutionInfoRoot() [2/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 2232 of file Project.cpp.

References projectRoot().

Referenced by Isis::JigsawRunWidget::on_JigsawAcceptButton_clicked(), 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 1766 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 1783 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 458 of file Project.cpp.

References Isis::Directory::clean(), Isis::GuiCameraList::clear(), Isis::TargetBodyList::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().

◆ clearing()

bool Isis::Project::clearing ( )

Definition at line 665 of file Project.cpp.

◆ 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 1923 of file Project.cpp.

References activeControlModified(), and setClean().

◆ cnetRoot() [1/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 2028 of file Project.cpp.

References cnetRoot().

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

◆ cnetRoot() [2/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 2018 of file Project.cpp.

References projectRoot().

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

◆ 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 1162 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 2832 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 2047 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 2840 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 383 of file Project.cpp.

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

Referenced by Project().

◆ createOrRetrieveControlList()

ControlList * Isis::Project::createOrRetrieveControlList ( QString name,
QString path = "" )
private

Definition at line 972 of file Project.cpp.

◆ createOrRetrieveImageList()

ImageList * Isis::Project::createOrRetrieveImageList ( QString name,
QString path = "" )
private

Definition at line 670 of file Project.cpp.

◆ createOrRetrieveShapeList()

ShapeList * Isis::Project::createOrRetrieveShapeList ( QString name,
QString path = "" )
private

Definition at line 691 of file Project.cpp.

◆ deleteAllProjectFiles()

void Isis::Project::deleteAllProjectFiles ( )

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

Definition at line 2250 of file Project.cpp.

References cnetRoot(), imageDataRoot(), resultsRoot(), shapeDataRoot(), and templateRoot().

Referenced by save().

◆ directory()

◆ 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 2744 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 2714 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 1508 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 2801 of file Project.cpp.

References Isis::ImageList::removeAt().

Referenced by imagesReady().

◆ imageDataRoot() [1/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 2076 of file Project.cpp.

References imageDataRoot().

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

◆ imageDataRoot() [2/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 2066 of file Project.cpp.

References projectRoot().

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

◆ imageList()

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

Return an imagelist given its name.

Parameters
QStringname
Returns
Imagelist matching name

Definition at line 1519 of file Project.cpp.

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

Referenced by activeImageList(), Isis::Project::XmlHandler::endElement(), 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 2821 of file Project.cpp.

◆ images() [1/2]

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

Return projects imagelist.

Returns
Imagelist

Definition at line 2114 of file Project.cpp.

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

◆ images() [2/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 893 of file Project.cpp.

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

◆ 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 2665 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 1583 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 1574 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 1566 of file Project.cpp.

◆ lastNotUndoneWorkOrder() [1/2]

WorkOrder * Isis::Project::lastNotUndoneWorkOrder ( )

Return the last not undone workorder.

Returns
WorkOrder

Definition at line 1604 of file Project.cpp.

References 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 1633 of file Project.cpp.

References Isis::WorkOrder::previous().

◆ loadBundleSolutionInfo()

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

Loads bundle solution info into project.

Parameters
BundleSolutionInfo

Definition at line 1209 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 2155 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 1657 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 1674 of file Project.cpp.

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

◆ nextImageListGroupName()

QString Isis::Project::nextImageListGroupName ( )
private

Definition at line 1698 of file Project.cpp.

◆ 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 1344 of file Project.cpp.

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

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

◆ progress()

QProgressBar * Isis::Project::progress ( )

Definition at line 1498 of file Project.cpp.

◆ 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

Referenced by save().

◆ regTemplates()

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

Return registration template FileNames.

Returns
QList of FileName

Definition at line 2165 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 2304 of file Project.cpp.

References newProjectRoot(), and projectRelocated().

Referenced by save().

◆ removeImages()

void Isis::Project::removeImages ( ImageList & imageList)

Definition at line 2785 of file Project.cpp.

◆ resultsRoot() [1/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 2213 of file Project.cpp.

References resultsRoot().

Referenced by createFolders(), deleteAllProjectFiles(), and resultsRoot().

◆ resultsRoot() [2/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 2203 of file Project.cpp.

References projectRoot().

◆ 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 2323 of file Project.cpp.

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

Referenced by Isis::SaveProjectAsWorkOrder::execute(), save(), save(), 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.

@startsalt{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 } } @endsalt

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

Definition at line 2471 of file Project.cpp.

References Isis::IException::Io, projectSaved(), save(), saveHistory(), and saveWarnings().

◆ 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 725 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 850 of file Project.cpp.

Referenced by 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 873 of file Project.cpp.

Referenced by save().

◆ 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 1818 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 1954 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 1683 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 1538 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 2953 of file Project.cpp.

References Isis::ShapeList::removeAt().

◆ shapeDataRoot() [1/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 2096 of file Project.cpp.

References shapeDataRoot().

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

◆ shapeDataRoot() [2/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 2086 of file Project.cpp.

References projectRoot().

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

◆ shapeList()

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

Return a shapelist given its name.

Parameters
QStringname
Returns
Shapelist matching name

Definition at line 1548 of file Project.cpp.

References name(), and Isis::ShapeList::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 2855 of file Project.cpp.

◆ shapes()

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

Return the projects shapelist.

Returns
Qlist of Shapelist

Definition at line 2105 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

◆ shapesReady

void Isis::Project::shapesReady ( ShapeList shapes)
privateslot

Definition at line 2912 of file Project.cpp.

◆ storeWarning()

void Isis::Project::storeWarning ( QString text)
private

Definition at line 2656 of file Project.cpp.

◆ targetBodies()

TargetBodyList Isis::Project::targetBodies ( )

Return TargetBodyList in Project.

Definition at line 2193 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 2892 of file Project.cpp.

◆ targetBodyRoot() [1/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 2185 of file Project.cpp.

References targetBodyRoot().

Referenced by targetBodyRoot().

◆ targetBodyRoot() [2/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 2175 of file Project.cpp.

References projectRoot().

◆ 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 ( ) const

Accessor for the root directory of the template data.

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

Definition at line 2134 of file Project.cpp.

References templateRoot().

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

◆ templateRoot() [2/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 2124 of file Project.cpp.

References projectRoot().

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

◆ templates()

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

Return all template FileNames.

Returns
QList of FileName

Definition at line 2144 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 915 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 1731 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 1739 of file Project.cpp.

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

◆ warn() [1/2]

void Isis::Project::warn ( QString text)

Definition at line 2648 of file Project.cpp.

◆ warn() [2/2]

template<typename Data >
void Isis::Project::warn ( QString text,
Data relevantData )

Definition at line 2642 of file Project.cpp.

◆ 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 1747 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 2985 of file Project.cpp.

◆ workOrderStarting

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

Emitted when work order starts.

Referenced by addToProject().

◆ writeSettings()

void Isis::Project::writeSettings ( )
private

Definition at line 1233 of file Project.cpp.

Member Data Documentation

◆ m_activeControl

QPointer<Control> Isis::Project::m_activeControl
private

Definition at line 636 of file Project.h.

◆ m_activeImageList

QPointer<ImageList> Isis::Project::m_activeImageList
private

Definition at line 637 of file Project.h.

◆ m_bundleSettings

BundleSettings* Isis::Project::m_bundleSettings
private

Definition at line 641 of file Project.h.

◆ m_bundleSolutionInfo

QList<BundleSolutionInfo *>* Isis::Project::m_bundleSolutionInfo
private

Definition at line 634 of file Project.h.

◆ 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_cnetRoot

QDir* Isis::Project::m_cnetRoot
private

Definition at line 624 of file Project.h.

◆ m_controls

QList<ControlList *>* Isis::Project::m_controls
private

Definition at line 628 of file Project.h.

◆ m_currentCnetFolder

QDir Isis::Project::m_currentCnetFolder
private

Definition at line 625 of file Project.h.

◆ m_directory

QPointer<Directory> Isis::Project::m_directory
private

Definition at line 626 of file Project.h.

◆ m_guiCameras

GuiCameraList* Isis::Project::m_guiCameras
private

Definition at line 633 of file Project.h.

◆ m_idToBundleSolutionInfoMap

QMap<QString, BundleSolutionInfo *>* Isis::Project::m_idToBundleSolutionInfoMap
private

Definition at line 654 of file Project.h.

◆ 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_idToGuiCameraMap

QMap<QString, GuiCamera *>* Isis::Project::m_idToGuiCameraMap
private

Definition at line 656 of file Project.h.

◆ m_idToImageMap

QMap<QString, Image *>* Isis::Project::m_idToImageMap
private

Definition at line 652 of file Project.h.

◆ m_idToShapeMap

QMap<QString, Shape *>* Isis::Project::m_idToShapeMap
private

Definition at line 653 of file Project.h.

◆ m_idToTargetBodyMap

QMap<QString, TargetBody *>* Isis::Project::m_idToTargetBodyMap
private

Definition at line 655 of file Project.h.

◆ m_imageReader

QPointer<ImageReader> Isis::Project::m_imageReader
private

Definition at line 662 of file Project.h.

◆ m_imageReadingMutex

QMutex* Isis::Project::m_imageReadingMutex
private

Definition at line 672 of file Project.h.

◆ m_images

QList<ImageList *>* Isis::Project::m_images
private

Definition at line 627 of file Project.h.

◆ 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_isOpen

bool Isis::Project::m_isOpen
private

Definition at line 665 of file Project.h.

◆ m_isTemporaryProject

bool Isis::Project::m_isTemporaryProject
private

Definition at line 664 of file Project.h.

◆ m_mapTemplates

QList<TemplateList *>* Isis::Project::m_mapTemplates
private

Definition at line 631 of file Project.h.

◆ m_maxRecentProjects

const int Isis::Project::m_maxRecentProjects = 5
staticprivate

Definition at line 621 of file Project.h.

◆ m_mutex

QMutex* Isis::Project::m_mutex
private

Definition at line 670 of file Project.h.

◆ m_name

QString Isis::Project::m_name
private

Definition at line 658 of file Project.h.

◆ m_newProjectRoot

QString Isis::Project::m_newProjectRoot
private

Definition at line 623 of file Project.h.

◆ 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().

◆ m_numShapesCurrentlyReading

int Isis::Project::m_numShapesCurrentlyReading
private

Definition at line 674 of file Project.h.

◆ m_projectRoot

QDir* Isis::Project::m_projectRoot
private

Definition at line 622 of file Project.h.

◆ m_regTemplates

QList<TemplateList *>* Isis::Project::m_regTemplates
private

Definition at line 632 of file Project.h.

◆ m_shapeMutex

QMutex* Isis::Project::m_shapeMutex
private

Definition at line 675 of file Project.h.

◆ m_shapeReader

QPointer<ShapeReader> Isis::Project::m_shapeReader
private

Definition at line 676 of file Project.h.

◆ m_shapeReadingMutex

QMutex* Isis::Project::m_shapeReadingMutex
private

Definition at line 677 of file Project.h.

◆ m_shapes

QList<ShapeList *>* Isis::Project::m_shapes
private

Definition at line 629 of file Project.h.

◆ m_targets

TargetBodyList* Isis::Project::m_targets
private

Definition at line 630 of file Project.h.

◆ m_undoStack

QUndoStack Isis::Project::m_undoStack
private

Definition at line 679 of file Project.h.

◆ m_warnings

QStringList* Isis::Project::m_warnings
private

Definition at line 659 of file Project.h.

◆ m_workOrderHistory

QList< QPointer<WorkOrder> >* Isis::Project::m_workOrderHistory
private

Definition at line 660 of file Project.h.

◆ m_workOrderMutex

QMutex* Isis::Project::m_workOrderMutex
private

Definition at line 671 of file Project.h.


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