USGS

Isis 3.0 Developer's Reference (API)

Home

Isis::Project Class Reference

The main project for cnetsuite. More...

#include <Project.h>

Inherits QObject.

List of all members.

Classes

class  XmlHandler

Public Slots

void open (QString)
 Open the project at the given path.

Signals

void allImagesClosed ()
void controlListAdded (ControlList *controls)
void controlAdded (Control *control)
void imagesAdded (ImageList *images)
void nameChanged (QString newName)
void projectLoaded (Project *)
void projectRelocated (Project *)
void workOrderStarting (WorkOrder *)
void workOrderFinished (WorkOrder *)

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.
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)
Controlcontrol (QString id)
Directorydirectory () const
 Returns the directory associated with this Project.
Imageimage (QString id)
ImageListimageList (QString name)
bool isTemporaryProject () const
WorkOrderlastNotUndoneWorkOrder ()
const WorkOrderlastNotUndoneWorkOrder () const
QString name () const
 Get the project's GUI name.
QMutex * mutex ()
 Return mutex used for Naif calls.
QString projectRoot () const
 Get the top-level folder of the project.
void setName (QString newName)
 Change the project's name (GUI only, doesn't affect location on disk).
QUndoStack * undoStack ()
void waitForImageReaderFinished ()
QList< WorkOrder * > workOrderHistory ()
 Get the entire list of work orders that have executed.
QString cnetRoot () const
 Get where control networks ought to be stored inside the project.
QList< ControlList * > controls ()
ControlListcontrolList (QString name)
QString imageDataRoot () const
 Accessor for the root directory of the image data.
QList< ImageList * > images ()
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.
QProgressBarprogress ()
void save ()
void save (FileName newPath, bool verifyPathDoesntExist=true)
void addToProject (WorkOrder *)
 Run the work order 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 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 .

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_, 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 control(), controlList(), deleteAllProjectFiles(), image(), imageList(), and Isis::WorkOrder::modifiesDiskState().


Member Function Documentation

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 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 ( ImageList  newImages  ) 
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::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:
workOrder The 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().

void Isis::Project::allImagesClosed (  )  [signal]
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().

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(), and Isis::Control::updateFileName().

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

Referenced by addControl().

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

References Isis::ControlList::name().

Referenced by ~Project().

void Isis::Project::controlListAdded ( ControlList controls  )  [signal]
QList< ControlList * > Isis::Project::controls (  ) 
void Isis::Project::deleteAllProjectFiles (  ) 

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

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

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

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

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

ImageList * Isis::Project::imageList ( QString  name  ) 
QList< ImageList * > Isis::Project::images (  ) 
QStringList Isis::Project::images ( QStringList  fileNames  )  [static]

Verify that the input fileNames are image files.

Parameters:
fileNames names of files on disk
Returns:
the files that are images.

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

void Isis::Project::imagesAdded ( ImageList images  )  [signal]
bool Isis::Project::isTemporaryProject (  )  const
const WorkOrder * Isis::Project::lastNotUndoneWorkOrder (  )  const
WorkOrder * Isis::Project::lastNotUndoneWorkOrder (  ) 
QMutex * Isis::Project::mutex (  ) 

Return mutex used for Naif calls.

This method is thread-safe.

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

Referenced by setName().

void Isis::Project::open ( QString  projectPathStr  )  [slot]
QProgressBar * Isis::Project::progress (  ) 
void Isis::Project::projectLoaded ( Project _t1  )  [signal]

Referenced by open().

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

Referenced by 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::Image::copyToNewProjectRoot(), and Isis::Control::copyToNewProjectRoot().

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

This is called when the project is moved.

Parameters:
newProjectRoot The new root directory for the project.

References projectRelocated().

Referenced by save().

void Isis::Project::save ( FileName  newPath,
bool  verifyPathDoesntExist = true 
)
void Isis::Project::save (  ) 
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().

QUndoStack * Isis::Project::undoStack (  ) 
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::warn ( QString  text  ) 
template<typename Data >
void Isis::Project::warn ( QString  text,
Data  relevantData 
) [inline]
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: