Isis 3.0 Developer's Reference (API) |
Home |
The main project for cnetsuite. More...
#include <Project.h>
Inherits QObject.
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) |
Control * | control (QString id) |
Directory * | directory () const |
Returns the directory associated with this Project. | |
Image * | image (QString id) |
ImageList * | imageList (QString name) |
bool | isTemporaryProject () const |
WorkOrder * | lastNotUndoneWorkOrder () |
const WorkOrder * | lastNotUndoneWorkOrder () 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 () |
ControlList * | controlList (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. | |
QProgressBar * | progress () |
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 . |
The main project for cnetsuite.
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().
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]
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.
Referenced by addCnetFolder(), deleteAllProjectFiles(), and Isis::ControlList::save().
QString Isis::Project::cnetRoot | ( | QString | projectRoot | ) | [static] |
Appends the root directory name 'cnets' to the project.
Referenced by Isis::Control::copyToNewProjectRoot(), Isis::ControlList::deleteFromDisk(), and Isis::Control::updateFileName().
Control * Isis::Project::control | ( | QString | id | ) |
Referenced by Isis::ExportControlNetWorkOrder::asyncRedo(), and ~Project().
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 | ( | ) |
Referenced by Isis::ImportControlNetWorkOrder::syncUndo().
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 |
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.
Referenced by Isis::WorkOrder::directory(), Isis::ImageFileListViewWorkOrder::execute(), Isis::Footprint2DViewWorkOrder::execute(), Isis::CubeViewportViewWorkOrder::execute(), Isis::ImageFileListViewWorkOrder::syncRedo(), Isis::Footprint2DViewWorkOrder::syncRedo(), Isis::CubeViewportViewWorkOrder::syncRedo(), Isis::CnetEditorViewWorkOrder::syncRedo(), Isis::ImageFileListViewWorkOrder::syncUndo(), Isis::Footprint2DViewWorkOrder::syncUndo(), Isis::CubeViewportViewWorkOrder::syncUndo(), Isis::CnetEditorViewWorkOrder::syncUndo(), and warn().
Image * Isis::Project::image | ( | QString | id | ) |
Referenced by Isis::WorkOrder::imageList(), and ~Project().
QString Isis::Project::imageDataRoot | ( | ) | const |
Accessor for 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 .
Referenced by Isis::ImageList::deleteFromDisk(), and Isis::Image::updateFileName().
ImageList * Isis::Project::imageList | ( | QString | name | ) |
References Isis::ImageList::name().
Referenced by Isis::ExportImagesWorkOrder::asyncRedo(), and ~Project().
QStringList Isis::Project::images | ( | QStringList | fileNames | ) | [static] |
Verify that the input fileNames are image files.
fileNames | names of files on disk |
Referenced by Isis::ImportImagesWorkOrder::asyncUndo(), and Isis::ImportImagesWorkOrder::postSyncUndo().
void Isis::Project::imagesAdded | ( | ImageList * | images | ) | [signal] |
bool Isis::Project::isTemporaryProject | ( | ) | const |
Referenced by Isis::ImportImagesWorkOrder::execute().
const WorkOrder * Isis::Project::lastNotUndoneWorkOrder | ( | ) | const |
References Isis::WorkOrder::isUndoing(), and Isis::WorkOrder::isUndone().
WorkOrder * Isis::Project::lastNotUndoneWorkOrder | ( | ) |
References Isis::WorkOrder::isUndoing(), and Isis::WorkOrder::isUndone().
Referenced by addToProject().
QMutex * Isis::Project::mutex | ( | ) |
Return mutex used for Naif calls.
This method is thread-safe.
QString Isis::Project::name | ( | ) | const |
Get the project's GUI name.
Referenced by Isis::RenameProjectWorkOrder::execute(), and Isis::RenameProjectWorkOrder::RenameProjectWorkOrder().
void Isis::Project::nameChanged | ( | QString | newName | ) | [signal] |
Referenced by setName().
void Isis::Project::open | ( | QString | projectPathStr | ) | [slot] |
Open the project at the given path.
References _FILEINFO_, Isis::FileName::expanded(), Isis::IException::Io, Isis::FileName::original(), projectLoaded(), Isis::XmlStackedHandlerReader::pushContentHandler(), Isis::FileName::toString(), and warn().
Referenced by Isis::OpenProjectWorkOrder::execute().
QProgressBar * Isis::Project::progress | ( | ) |
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.
newProjectRoot | The new root directory for the project. |
References projectRelocated().
Referenced by save().
void Isis::Project::save | ( | FileName | newPath, | |
bool | verifyPathDoesntExist = true | |||
) |
References _FILEINFO_, Isis::IException::Io, Isis::FileName::original(), Isis::ReadWrite, save(), and Isis::FileName::toString().
void Isis::Project::save | ( | ) |
References deleteAllProjectFiles(), and relocateProjectRoot().
Referenced by Isis::SaveProjectWorkOrder::execute(), Isis::SaveProjectAsWorkOrder::execute(), and 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 | ( | ) |
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 | ( | ) |
Referenced by Isis::ImportImagesWorkOrder::asyncUndo().
void Isis::Project::warn | ( | QString | text | ) |
References directory(), and Isis::Directory::showWarning().
void Isis::Project::warn | ( | QString | text, | |
Data | relevantData | |||
) | [inline] |
void Isis::Project::workOrderFinished | ( | WorkOrder * | _t1 | ) | [signal] |
Referenced by addToProject().
Get the entire list of work orders that have executed.
void Isis::Project::workOrderStarting | ( | WorkOrder * | _t1 | ) | [signal] |
Referenced by addToProject().