Isis 3 Programmer Reference
|
The main project for ipce. More...
#include <Project.h>
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 () |
Control * | control (QString id) |
Accessor for if the project is clearing or not. More... | |
Directory * | directory () const |
Returns the directory associated with this Project. More... | |
Image * | image (QString id) |
Return an image given its id. More... | |
ImageList * | imageList (QString name) |
Return an imagelist given its name. More... | |
Shape * | shape (QString id) |
Return a shape given its id. More... | |
ShapeList * | shapeList (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... | |
WorkOrder * | lastNotUndoneWorkOrder () |
Return the last not undone workorder. More... | |
const WorkOrder * | lastNotUndoneWorkOrder () 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... | |
Control * | activeControl () |
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... | |
ImageList * | activeImageList () |
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... | |
ControlList * | controlList (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... | |
BundleSettings * | bundleSettings () |
Return BundleSettings objects in Project. More... | |
QProgressBar * | progress () |
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) | |
Project & | operator= (const Project &rhs) |
void | createFolders () |
This creates the project root, image root, and control net root directories. More... | |
ControlList * | createOrRetrieveControlList (QString name, QString path="") |
ImageList * | createOrRetrieveImageList (QString name, QString path="") |
ShapeList * | createOrRetrieveShapeList (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< Directory > | m_directory |
QList< ImageList * > * | m_images |
QList< ControlList * > * | m_controls |
QList< ShapeList * > * | m_shapes |
TargetBodyList * | m_targets |
QList< TemplateList * > * | m_mapTemplates |
QList< TemplateList * > * | m_regTemplates |
GuiCameraList * | m_guiCameras |
QList< BundleSolutionInfo * > * | m_bundleSolutionInfo |
QPointer< Control > | m_activeControl |
QPointer< ImageList > | m_activeImageList |
BundleSettings * | m_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 |
QStringList * | m_warnings |
QList< QPointer< WorkOrder > > * | m_workOrderHistory |
QPointer< ImageReader > | m_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< ShapeReader > | m_shapeReader |
QMutex * | m_shapeReadingMutex |
QUndoStack | m_undoStack |
Static Private Attributes | |
static const int | m_maxRecentProjects = 5 |
The main project for ipce.
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.
Create a new Project.
This creates a project on disk at /tmp/username_appname_pid.
Definition at line 88 of file Project.cpp.
References _FILEINFO_, checkControlsAndImagesAvailable(), controlListAdded(), createFolders(), directory(), Isis::FileName::expanded(), imagesAdded(), imagesReady(), m_clearing, m_idToControlMap, m_isClean, m_numImagesCurrentlyReading, Isis::IException::Programmer, setClean(), Isis::toString(), and Isis::Environment::userName().
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().
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.
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().
|
signal |
Emitted when both an active control and active image list have been set.
receivers: WorkOrder::enableWorkOrder
Referenced by checkActiveControlAndImageList().
|
signal |
Emmited in cnetModified() when the actice control is modified.
Connected to Directory so that other views can redraw measures.
Referenced by cnetModified().
|
signal |
Emitted when an active control is set.
receivers: Project::checkActiveControlAndImageList
Referenced by setActiveControl().
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.
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().
|
signal |
Emitted when an active image list is set.
receivers: Project::checkActiveControlAndImageList
Referenced by setActiveImageList().
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().
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().
void Isis::Project::addCamera | ( | Camera * | camera | ) |
Adds a new camera to the project.
camera | The camera to be added. |
Definition at line 2761 of file Project.cpp.
References Isis::GuiCameraList::append().
Referenced by Isis::ImportImagesWorkOrder::importConfirmedImages().
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().
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().
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().
void Isis::Project::addImages | ( | QStringList | imageFiles | ) |
Read the given cube file names as Images and add them to the project.
QStringList | names of imageFiles |
Definition at line 1032 of file Project.cpp.
References m_numImagesCurrentlyReading.
Referenced by Isis::ImportImagesWorkOrder::postExecution().
void Isis::Project::addImages | ( | ImageList | newImages | ) |
Read the given cube file names as Images and add them to the project.
ImageList |
Definition at line 1046 of file Project.cpp.
References guiCamerasAdded(), imagesReady(), and targetsAdded().
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.
ImagesList | of images |
Definition at line 2778 of file Project.cpp.
References Isis::Image::id(), image(), and images().
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().
void Isis::Project::addShapes | ( | QStringList | shapeFiles | ) |
Read the given shape model cube file names as Images and add them to the project.
QStringList | of shape Files names |
Definition at line 1089 of file Project.cpp.
Referenced by Isis::ImportShapesWorkOrder::postExecution().
void Isis::Project::addShapes | ( | ShapeList | newShapes | ) |
Read the given shape model cube file names as Images and add them to the project.
ShapeList |
Definition at line 1103 of file Project.cpp.
void Isis::Project::addTarget | ( | Target * | target | ) |
Adds a new target to the project.
target | The target to be added. |
Definition at line 2730 of file Project.cpp.
References Isis::TargetBodyList::append().
Referenced by Isis::ImportImagesWorkOrder::importConfirmedImages().
QDir Isis::Project::addTemplateFolder | ( | QString | prefix | ) |
Create and navigate to the appropriate template type folder in the project directory.
prefix | The 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().
void Isis::Project::addTemplates | ( | TemplateList * | templateList | ) |
Add new templates to m_mapTemplates or m_regTemplates and update project item model.
newFileList | QList 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().
void Isis::Project::addToProject | ( | WorkOrder * | workOrder | ) |
This executes the WorkOrder and stores it in the project.
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()
workOrder | The work order to be executed. This work order must not already be in the project. |
Definition at line 2598 of file Project.cpp.
References Isis::WorkOrder::createsCleanState(), Isis::WorkOrder::execute(), Isis::WorkOrder::isSavedToHistory(), Isis::WorkOrder::isUndoable(), lastNotUndoneWorkOrder(), Isis::WorkOrder::previous(), Isis::WorkOrder::redo(), Isis::WorkOrder::setNext(), Isis::WorkOrder::setPrevious(), Isis::WorkOrder::setupExecution(), workOrderFinished(), and workOrderStarting().
Referenced by Isis::WorkOrder::addCloneToProject(), Isis::Directory::initiateRenameProjectWorkOrder(), Isis::CloseProjectWorkOrder::setupExecution(), and Isis::OpenProjectWorkOrder::setupExecution().
|
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).
Referenced by controlListDeleted().
|
inline |
Return BundleSettings objects in Project.
QList< BundleSolutionInfo * > Isis::Project::bundleSolutionInfo | ( | ) |
Return BundleSolutionInfo objects in Project.
Definition at line 2223 of file Project.cpp.
Referenced by addBundleSolutionInfo(), bundleSolutionInfoClosed(), Isis::JigsawRunWidget::init(), loadBundleSolutionInfo(), Isis::ProjectItem::ProjectItem(), and ~Project().
|
signal |
Emitted when new BundleSolutionInfo available from jigsaw receivers: ProjectTreeWidget (TODO: should this be the Directory?)
Referenced by loadBundleSolutionInfo().
|
privateslot |
A BundleSolutionInfo object is being deleted from the project.
Definition at line 2867 of file Project.cpp.
References bundleSolutionInfo().
Referenced by addBundleSolutionInfo().
|
static |
Appends the root directory name 'bundle' to the project results directory.
Definition at line 2233 of file Project.cpp.
References projectRoot().
Referenced by Isis::JigsawRunWidget::on_JigsawAcceptButton_clicked(), and Isis::BundleSolutionInfo::save().
QString Isis::Project::bundleSolutionInfoRoot | ( | ) | const |
Accessor for the root directory of the results data.
Definition at line 2243 of file Project.cpp.
Referenced by addBundleSolutionInfoFolder(), createFolders(), open(), and Isis::BundleSolutionInfo::save().
|
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.
Definition at line 1767 of file Project.cpp.
References activeControlAndImageListSet().
|
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.
Definition at line 1784 of file Project.cpp.
References controls(), controlsAndImagesAvailable(), and images().
Referenced by Project().
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().
|
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().
|
static |
Appends the root directory name 'cnets' to the project.
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().
QString Isis::Project::cnetRoot | ( | ) | const |
Get where control networks ought to be stored inside the project.
This is a full path.
Definition at line 2029 of file Project.cpp.
Referenced by addCnetFolder(), createFolders(), deleteAllProjectFiles(), and Isis::ControlList::save().
|
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 * Isis::Project::control | ( | QString | id | ) |
Accessor for if the project is clearing or not.
Given the id return the corrsponding control net.
QString | id 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().
|
signal |
Emitted when new Control added to Project receivers: ProjectTreeWidget.
Referenced by addControl().
|
privateslot |
A control is being deleted from the project.
Definition at line 2833 of file Project.cpp.
References m_idToControlMap.
Referenced by addControl().
ControlList * Isis::Project::controlList | ( | QString | name | ) |
Return controlslist matching name in Project.
QString | name of controllist to be returned |
Definition at line 2048 of file Project.cpp.
References Isis::ControlList::name(), and name().
Referenced by save(), and ~Project().
|
signal |
apparently not used?
Emitted when new ControlList added to Project receivers: ProjectTreeWidget
Referenced by Project().
|
privateslot |
An control list is being deleted from the project.
Definition at line 2841 of file Project.cpp.
References allControlsRemoved(), and controls().
QList< ControlList * > Isis::Project::controls | ( | ) |
Return controls in project.
Definition at line 2038 of file Project.cpp.
Referenced by checkControlsAndImagesAvailable(), clear(), Isis::ImportControlNetWorkOrder::cnetReady(), controlListDeleted(), Isis::ProjectItem::ProjectItem(), Isis::ExportControlNetWorkOrder::setupExecution(), and Isis::ControlNetTool::toolPadAction().
|
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().
|
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().
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 * 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.
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().
|
signal |
Emitted when new GuiCamera objects added to project receivers: Directory.
Referenced by addImages().
bool Isis::Project::hasCamera | ( | QString | id | ) |
This method checks for the existence of a camera based on InstrumentId.
id | The instrument string to be compared. |
Definition at line 2745 of file Project.cpp.
bool Isis::Project::hasTarget | ( | QString | id | ) |
This method checks for the existence of a target based on TargetName.
id | The target string to be compared. |
Definition at line 2715 of file Project.cpp.
Image * Isis::Project::image | ( | QString | id | ) |
Return an image given its id.
QString | id |
Definition at line 1509 of file Project.cpp.
Referenced by addImagesToIdMap(), Isis::WorkOrder::imageList(), imagesReady(), and ~Project().
|
privateslot |
An image is being deleted from the project.
QObject | image object to be closed |
Definition at line 2802 of file Project.cpp.
References Isis::ImageList::removeAt().
Referenced by imagesReady().
|
static |
Appends the root directory name 'images' to the project .
Definition at line 2067 of file Project.cpp.
References projectRoot().
Referenced by Isis::ImageList::deleteFromDisk(), and Isis::Image::updateFileName().
QString Isis::Project::imageDataRoot | ( | ) | const |
Accessor for 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 * Isis::Project::imageList | ( | QString | name | ) |
Return an imagelist given its name.
QString | 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().
|
signal |
|
privateslot |
An image list is being deleted from the project.
QObject | list of images to be deleted |
Definition at line 2822 of file Project.cpp.
|
static |
Verify that the input fileNames are image files.
fileNames | names of files on disk |
Definition at line 894 of file Project.cpp.
Referenced by Isis::RemoveImagesWorkOrder::execute(), Isis::ControlHealthMonitorView::openImageEditor(), Isis::ImportImagesWorkOrder::postExecution(), and Isis::ProjectItem::ProjectItem().
Return projects imagelist.
Definition at line 2115 of file Project.cpp.
Referenced by addImagesToIdMap(), checkControlsAndImagesAvailable(), clear(), and imagesReady().
|
signal |
Emitted when new images are available.
receivers: Directory, Project, WorkOrder
Referenced by imagesReady(), and Project().
|
privateslot |
Prepare new images for opening.
Imagelist | of 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().
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().
bool Isis::Project::isOpen | ( | ) |
Accessor to determine whether a current project is Open.
Definition at line 1575 of file Project.cpp.
Referenced by open().
bool Isis::Project::isTemporaryProject | ( | ) | const |
Returns if the project is a temp project or not.
Definition at line 1567 of file Project.cpp.
Referenced by Isis::ImportImagesWorkOrder::setupExecution().
WorkOrder * Isis::Project::lastNotUndoneWorkOrder | ( | ) |
Return the last not undone workorder.
Definition at line 1605 of file Project.cpp.
References Isis::WorkOrder::isUndoing(), Isis::WorkOrder::isUndone(), and Isis::WorkOrder::previous().
Referenced by addToProject().
const WorkOrder * Isis::Project::lastNotUndoneWorkOrder | ( | ) | const |
Return the last not undone workorder.
Definition at line 1634 of file Project.cpp.
References Isis::WorkOrder::isUndoing(), Isis::WorkOrder::isUndone(), and Isis::WorkOrder::previous().
void Isis::Project::loadBundleSolutionInfo | ( | BundleSolutionInfo * | bundleSolutionInfo | ) |
Loads bundle solution info into project.
BundleSolutionInfo |
Definition at line 1210 of file Project.cpp.
References bundleSolutionInfo(), and bundleSolutionInfoAdded().
Referenced by addBundleSolutionInfo().
QList< TemplateList * > Isis::Project::mapTemplates | ( | ) |
|
inlinestatic |
Return max number of recent projects to be displayed.
Definition at line 396 of file Project.h.
Referenced by Isis::Directory::updateRecentProjects().
QMutex * Isis::Project::mutex | ( | ) |
Return mutex used for Naif calls.
This method is thread-safe.
Definition at line 1658 of file Project.cpp.
Referenced by Isis::Control::openControlNet().
QString Isis::Project::name | ( | ) | const |
Get the project's GUI name.
Definition at line 1625 of file Project.cpp.
Referenced by controlList(), imageList(), Isis::RenameProjectWorkOrder::RenameProjectWorkOrder(), setActiveImageList(), Isis::ProjectItem::setProject(), Isis::RenameProjectWorkOrder::setupExecution(), and shapeList().
|
signal |
Emitted when project name is changed receivers: ProjectTreeWidget.
Referenced by setName().
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().
|
slot |
Open the project at the given path.
The | path to the project folder |
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().
|
signal |
Emitted when project loaded receivers: IpceMainWindow, Directory, HistoryTreeWidget.
Referenced by open().
|
signal |
Emitted when project location moved receivers: Control, BundleSolutionInfo, Image, TargetBody.
Referenced by addBundleSolutionInfo(), addControl(), addTemplates(), imagesReady(), and relocateProjectRoot().
QString Isis::Project::projectRoot | ( | ) | const |
Get the top-level folder of the project.
This is where the project is opened from/saved to.
Definition at line 1666 of file Project.cpp.
Referenced by bundleSolutionInfoRoot(), clear(), cnetRoot(), Isis::Control::copyToNewProjectRoot(), Isis::Shape::copyToNewProjectRoot(), Isis::Image::copyToNewProjectRoot(), imageDataRoot(), resultsRoot(), Isis::BundleSolutionInfo::save(), Isis::ProjectItem::setProject(), shapeDataRoot(), targetBodyRoot(), templateRoot(), and Isis::Directory::updateRecentProjects().
|
signal |
Emitted when project is saved.
receivers: IpceMainWindow
QList< TemplateList * > Isis::Project::regTemplates | ( | ) |
Return registration template FileNames.
Definition at line 2166 of file Project.cpp.
Referenced by clear(), and Isis::ControlPointEditWidget::createPointEditor().
void Isis::Project::relocateProjectRoot | ( | QString | newProjectRoot | ) |
This is called when the project is moved.
newProjectRoot | The new root directory for the project. |
Definition at line 2305 of file Project.cpp.
References newProjectRoot(), and projectRelocated().
Referenced by save().
|
static |
Appends the root directory name 'results' to the project.
Definition at line 2204 of file Project.cpp.
References projectRoot().
QString Isis::Project::resultsRoot | ( | ) | const |
Accessor for the root directory of the results data.
Definition at line 2214 of file Project.cpp.
Referenced by createFolders(), and deleteAllProjectFiles().
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.
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().
void Isis::Project::save | ( | FileName | newPath, |
bool | verifyPathDoesntExist = true |
||
) |
Project::save Saves the project state out to an XML file.
projectPath | The path to the project directory. |
verifyPathDoesntExist | A 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().
|
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().
|
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().
|
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.
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.
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().
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.
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().
|
slot |
Function to change the clean state of the project.
This is needed because not every action that changes the project is a workorder. This needs to be called everytime a user would consider an action changing the project. This also explicitely sets the undoStack to the same value passed.
the | boolean value to set the clean state to |
Definition at line 1595 of file Project.cpp.
References m_isClean.
Referenced by clear(), cnetModified(), Isis::ImportControlNetWorkOrder::cnetReady(), Isis::ImportRegistrationTemplateWorkOrder::execute(), Isis::ImportMapTemplateWorkOrder::execute(), Isis::RenameProjectWorkOrder::execute(), Isis::BundleObservationViewWorkOrder::execute(), Isis::CloseProjectWorkOrder::execute(), Isis::MatrixViewWorkOrder::execute(), Isis::ImageFileListViewWorkOrder::execute(), Isis::SaveProjectAsWorkOrder::execute(), Isis::CnetEditorViewWorkOrder::execute(), Isis::OpenProjectWorkOrder::execute(), Isis::RemoveImagesWorkOrder::execute(), Isis::CubeDnViewWorkOrder::execute(), Isis::Footprint2DViewWorkOrder::execute(), Isis::ImportShapesWorkOrder::execute(), Isis::ImportImagesWorkOrder::execute(), Isis::JigsawRunWidget::on_JigsawAcceptButton_clicked(), Isis::ProjectItemModel::onNameChanged(), open(), Project(), and Isis::SaveProjectWorkOrder::setupExecution().
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 * Isis::Project::shape | ( | QString | id | ) |
Return a shape given its id.
QString | id |
Definition at line 1539 of file Project.cpp.
Referenced by Isis::WorkOrder::shapeList(), and ~Project().
|
privateslot |
A shape model is being deleted from the project.
Definition at line 2954 of file Project.cpp.
References Isis::ShapeList::removeAt().
|
static |
Appends the root directory name 'shapes' to the project .
Definition at line 2087 of file Project.cpp.
References projectRoot().
Referenced by Isis::ControlPointEditWidget::checkGroundFileLocation(), Isis::ShapeList::deleteFromDisk(), and Isis::Shape::updateFileName().
QString Isis::Project::shapeDataRoot | ( | ) | const |
Accessor for 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 * Isis::Project::shapeList | ( | QString | name | ) |
Return a shapelist given its name.
QString | name |
Definition at line 1549 of file Project.cpp.
References Isis::ShapeList::name(), and name().
Referenced by Isis::Project::XmlHandler::endElement(), and ~Project().
|
privateslot |
A shape model list is being deleted from the project.
Definition at line 2856 of file Project.cpp.
Return the projects shapelist.
Definition at line 2106 of file Project.cpp.
Referenced by clear().
|
signal |
TargetBodyList Isis::Project::targetBodies | ( | ) |
Return TargetBodyList in Project.
Definition at line 2194 of file Project.cpp.
|
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.
|
static |
Appends the root directory name 'targets' to the project .
Definition at line 2176 of file Project.cpp.
References projectRoot().
QString Isis::Project::targetBodyRoot | ( | ) | const |
Accessor for the root directory of the target body data.
Definition at line 2186 of file Project.cpp.
|
signal |
Emitted when new TargetBody objects added to project receivers: Directory.
Referenced by addImages().
|
static |
Appends the root directory name 'templates' to the project .
Definition at line 2125 of file Project.cpp.
References projectRoot().
Referenced by Isis::TemplateList::deleteFromDisk(), Isis::ControlPointEditWidget::setTemplateFile(), and Isis::Template::updateFileName().
QString Isis::Project::templateRoot | ( | ) | const |
Accessor for the root directory of the template data.
Definition at line 2135 of file Project.cpp.
Referenced by addTemplateFolder(), createFolders(), deleteAllProjectFiles(), and Isis::TemplateList::save().
QList< TemplateList * > Isis::Project::templates | ( | ) |
Return all template FileNames.
Definition at line 2145 of file Project.cpp.
Referenced by Isis::ProjectItem::ProjectItem().
QUndoStack * Isis::Project::undoStack | ( | ) |
Returns the Projects stack of QUndoCommands.
Definition at line 1694 of file Project.cpp.
Referenced by Isis::HistoryTreeWidget::handleUndoIndexChanged(), Isis::HistoryTreeWidget::HistoryTreeWidget(), Isis::ImportShapesWorkOrder::postExecution(), Isis::Directory::redoAction(), and Isis::Directory::undoAction().
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.
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().
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().
|
signal |
Emitted when work order ends.
Referenced by addToProject().
Get the entire list of work orders that have executed.
Definition at line 1748 of file Project.cpp.
Referenced by Isis::HistoryTreeWidget::showHistory().
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.
Definition at line 2986 of file Project.cpp.
|
signal |
Emitted when work order starts.
Referenced by addToProject().
|
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().
|
private |
used to determine whether a project is currently open
Definition at line 666 of file Project.h.
Referenced by isClean(), Project(), and setClean().
|
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().