Isis 3.0
Back | Home
Isis::Project Class Reference

The main project for cnetsuite. More...

#include <Project.h>

Inherits QObject.

Public Slots

void open (QString)
 Open the project at the given path. 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 imagesAdded (ImageList *images)
 Emitted when new images are available. 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: CNetSuiteMainWindow, Directory, HistoryTreeWidget. More...
 
void projectRelocated (Project *)
 Emitted when project location moved receivers: Control, BundleSolutionInfo, Image, TargetBody. More...
 
void workOrderStarting (WorkOrder *)
 
void workOrderFinished (WorkOrder *)
 

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...
 
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)
 
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)
 
void addBundleSolutionInfo (BundleSolutionInfo *bundleSolutionInfo)
 Add the given BundleSolutionInfo to the current project. More...
 
void loadBundleSolutionInfo (BundleSolutionInfo *bundleSolutionInfo)
 
Controlcontrol (QString id)
 
Directorydirectory () const
 Returns the directory associated with this Project. More...
 
Imageimage (QString id)
 
ImageListimageList (QString name)
 
Shapeshape (QString id)
 
ShapeListshapeList (QString name)
 
bool isTemporaryProject () const
 
WorkOrderlastNotUndoneWorkOrder ()
 
const WorkOrderlastNotUndoneWorkOrder () const
 
QString name () const
 Get the project's GUI name. More...
 
QMutex * mutex ()
 Return mutex used for Naif calls. More...
 
QString projectRoot () const
 Get the top-level folder of the project. More...
 
void setName (QString newName)
 Change the project's name (GUI only, doesn't affect location on disk). More...
 
QUndoStack * undoStack ()
 
void waitForImageReaderFinished ()
 
void waitForShapeReaderFinished ()
 
QList< WorkOrder * > workOrderHistory ()
 Get the entire list of work orders that have executed. More...
 
void setActiveControl (Control *)
 Set the Active Control (control network) More...
 
ControlactiveControl ()
 Return the Active Control (control network) More...
 
void setActiveImageList (ImageList *)
 Set the Active ImageList. More...
 
ImageListactiveImageList ()
 Returns the active ImageList. More...
 
QString cnetRoot () const
 Get where control networks ought to be stored inside the project. More...
 
QList< ControlList * > controls ()
 
ControlListcontrolList (QString name)
 
QString imageDataRoot () const
 Accessor for the root directory of the image data. More...
 
QList< ImageList * > images ()
 
QString shapeDataRoot () const
 Accessor for the root directory of the shape model data. More...
 
QList< ShapeList * > shapes ()
 
QString targetBodyRoot () const
 Accessor for the root directory of the target body data. More...
 
TargetBodyList targetBodies ()
 
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 ()
 
void deleteAllProjectFiles ()
 Delete all of the files, that this project stores, from disk. More...
 
void relocateProjectRoot (QString newRoot)
 This is called when the project is moved. More...
 
BundleSettingsbundleSettings ()
 
QProgressBarprogress ()
 
void removeImages (ImageList &imageList)
 
void save ()
 
void save (FileName newPath, bool verifyPathDoesntExist=true)
 
void addToProject (WorkOrder *)
 Run the work order 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...
 

Detailed Description

The main project for cnetsuite.

Author
2012-??-?? ???

Constructor & Destructor Documentation

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

Create a new Project.

This creates a project on disk at /tmp/username_appname_pid.

References _FILEINFO_, directory(), Isis::FileName::expanded(), imagesAdded(), Isis::IException::Programmer, 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.

References bundleSolutionInfo(), control(), controlList(), deleteAllProjectFiles(), image(), imageList(), Isis::WorkOrder::modifiesDiskState(), shape(), and shapeList().

Member Function Documentation

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.

Referenced by Isis::Directory::addControlPointEditView(), Isis::CubeDnView::CubeDnView(), Isis::SetActiveControlWorkOrder::execute(), and Isis::SetActiveControlWorkOrder::isExecutable().

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.

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.

References addBundleSolutionInfoFolder(), Isis::BundleSolutionInfo::bundleSettings(), Isis::BundleSolutionInfo::createH5File(), loadBundleSolutionInfo(), projectRelocated(), and Isis::BundleSolutionInfo::runTime().

Referenced by Isis::JigsawDialog::bundleFinished().

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.

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

Referenced by addBundleSolutionInfo().

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.

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

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

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.

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

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.

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

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

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

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

void Isis::Project::addImages ( ImageList  newImages)
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.

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

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

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

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

void Isis::Project::addShapes ( ShapeList  newShapes)
void Isis::Project::addToProject ( WorkOrder workOrder)

Run the work order and stores it in the project.

If WorkOrder::execute() returns true then the work order's redo is called. This takes ownership of workOrder.

The order of events is: 1) WorkOrder::execute() 2) emit workOrderStarting() 3) WorkOrder::redo() [optional - see WorkOrder]

Parameters
workOrderThe work order to be executed. This work order must not already be in the project.

References Isis::WorkOrder::createsCleanState(), Isis::WorkOrder::execute(), lastNotUndoneWorkOrder(), Isis::WorkOrder::previous(), Isis::WorkOrder::setNext(), Isis::WorkOrder::setPrevious(), workOrderFinished(), and workOrderStarting().

Referenced by Isis::WorkOrder::addCloneToProject().

BundleSettings* Isis::Project::bundleSettings ( )
inline
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().

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.
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.

Referenced by addBundleSolutionInfoFolder(), and open().

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.

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.

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

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

Control * Isis::Project::control ( QString  id)
void Isis::Project::controlAdded ( Control control)
signal

Emitted when new Control added to Project receivers: ProjectTreeWidget.

Referenced by addControl().

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

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

Referenced by ~Project().

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

apparently not used?

Emitted when new ControlList added to Project receivers: ProjectTreeWidget

void Isis::Project::deleteAllProjectFiles ( )

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

References cnetRoot(), Isis::ImageList::deleteFromDisk(), imageDataRoot(), resultsRoot(), shapeDataRoot(), and warn().

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

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

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

Image * Isis::Project::image ( QString  id)
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.

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

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.

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

ImageList * Isis::Project::imageList ( QString  name)
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.

Referenced by Isis::ImportImagesWorkOrder::asyncUndo(), Isis::ImportImagesWorkOrder::postSyncUndo(), and Isis::ProjectItem::ProjectItem().

QList< ImageList * > Isis::Project::images ( )
void Isis::Project::imagesAdded ( ImageList images)
signal

Emitted when new images are available.

receivers: Directory, Project, WorkOrder

Referenced by Project().

bool Isis::Project::isTemporaryProject ( ) const
WorkOrder * Isis::Project::lastNotUndoneWorkOrder ( )
const WorkOrder * Isis::Project::lastNotUndoneWorkOrder ( ) const
void Isis::Project::loadBundleSolutionInfo ( BundleSolutionInfo bundleSolutionInfo)
QMutex * Isis::Project::mutex ( )

Return mutex used for Naif calls.

This method is thread-safe.

Author
2012-09-11 Tracie Sucharski
Returns
QMutex*
void Isis::Project::nameChanged ( QString  newName)
signal

Emitted when project name is changed receivers: ProjectTreeWidget.

Referenced by setName().

QProgressBar * Isis::Project::progress ( )
void Isis::Project::projectLoaded ( Project _t1)
signal

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

Referenced by open().

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

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

Referenced by addBundleSolutionInfo(), addControl(), 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.

Referenced by Isis::Control::copyToNewProjectRoot(), Isis::Shape::copyToNewProjectRoot(), Isis::Image::copyToNewProjectRoot(), and Isis::Directory::updateRecentProjects().

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

This is called when the project is moved.

Parameters
newProjectRootThe new root directory for the project.

References projectRelocated().

Referenced by save().

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

References image().

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.
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.

Referenced by deleteAllProjectFiles().

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

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.

References control().

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

void Isis::Project::setActiveImageList ( ImageList imageList)

Set the Active ImageList.

Set the active ImageList for views which need to operate on the same list of images, ie. Footprint2dView, CubeDnView, ControlPointEditView.

References imageList().

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

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

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

References nameChanged().

Referenced by Isis::RenameProjectWorkOrder::syncRedo(), and Isis::RenameProjectWorkOrder::syncUndo().

Shape * Isis::Project::shape ( QString  id)
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.

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

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.

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

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

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

Referenced by ~Project().

QList< ShapeList * > Isis::Project::shapes ( )
void Isis::Project::shapesAdded ( ShapeList shapes)
signal

Emitted when new shape model images are available.

receivers: Directory, Project, WorkOrder

TargetBodyList Isis::Project::targetBodies ( )
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.
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.
void Isis::Project::targetsAdded ( TargetBodyList targets)
signal

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

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.

References Isis::ImageDisplayProperties::FootprintViewProperties.

void Isis::Project::waitForImageReaderFinished ( )
void Isis::Project::waitForShapeReaderFinished ( )
void Isis::Project::warn ( QString  text)
void Isis::Project::workOrderFinished ( WorkOrder _t1)
signal

Referenced by addToProject().

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

Get the entire list of work orders that have executed.

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

Referenced by addToProject().


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

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:43:32