Isis 3 Programmer Reference
Isis::Workspace Class Reference

#include <Workspace.h>

Inheritance diagram for Isis::Workspace:
Inheritance graph
Collaboration diagram for Isis::Workspace:
Collaboration graph

Public Slots

void addCubeViewport (QString cubename)
 Method adds the name of a cube into Workspace as a CubeViewport. More...
 
void addCubeViewportFromList (QString cubelist)
 Method adds cubes into Workspace as a CubeViewport from a list of cubes. More...
 
MdiCubeViewportaddCubeViewport (Cube *cube)
 Method adds a cube into the Workspace as a CubeViewport. More...
 
void addBrowseView (QString cube)
 Method is called to add a Cube from BrowseView. More...
 

Signals

void cubeViewportAdded (MdiCubeViewport *)
 Signal triggered when a Cube is added to the Workspace. More...
 
void cubeViewportActivated (MdiCubeViewport *)
 Signal triggered when a Cube is activated in the Workspace. More...
 

Public Member Functions

 Workspace (bool selfContained, QWidget *parent=0)
 Constructor for Workspace. More...
 
 Workspace (const Workspace &other)
 Constructor for Workspace. More...
 
virtual ~Workspace ()
 Deconstructor. More...
 
QVector< MdiCubeViewport * > * cubeViewportList ()
 This method returns a Vector of MdiCubeViewports. More...
 
Workspaceoperator= (Workspace other)
 Is equal to comparsion. More...
 
void addImages (ImageList *images)
 Adds a list of Images to a viewport. More...
 
bool confirmClose ()
 Confirms that the user wishes toc lose the Workspace. More...
 
QWidgetcubeToMdiWidget (Cube *cube)
 Converts a cube to an MdiWidget. More...
 
QMdiArea * mdiArea ()
 This method returns the QMdiArea. More...
 

Protected Slots

void activateViewport (QMdiSubWindow *w)
 This method activates the Viewport. More...
 

Private Attributes

QPointer< QMdiArea > m_mdi
 The mdi area. More...
 
QVector< MdiCubeViewport * > * m_cubeViewportList
 List of cube viewports. More...
 
ToolListm_tools
 List of all of the tools. More...
 

Detailed Description

Author
????-??-?? Jeff Anderson
History:
2007-03-21 Tracie Sucharski - Changed call from fitScale to fitScaleMinDimension so that the minimum cube dimension is displayed in its entirety.
History:
2008-05-27 Noah Hilt - Now allows cubes to be opened with additional arguments read by the CubeAttributeInput class, specifically to open certain bands as well as open 3 bands in RGB mode.
History:
2008-12-04 Jeannie Walldren - Fixed bug in addCubeViewport(cubename). Added exception catch to addCubeViewport(cube) to close the CubeViewport from the ViewportMainWindow if it cannot be shown.
History:
2009-03-27 Noah Hilt, Steven Lambright - Changed parent class from QWorkspace to QMdiArea since QWorkspace is now an obsolete class. Also changed how CubeViewports are created.
History:
2010-04-08 Steven Lambright and Eric Hyer - Added progress bar
History:
2010-06-26 Eric Hyer - Now uses MdiCubeViewport instead of CubeViewport. Also fixed include issues.
History:
2010-11-18 Eric Hyer - addBrowseView now deletes the last viewport in the subWindowList instead of the first one
History:
2011-09-19 Steven Lambright - Fixed addBrowseView to actually close the old viewports instead of hiding them. Fixes #418
History:
2012-05-29 Steven Lambright - Now utilizes ViewportMdiSubWindow instead of QMdiSubWindow. References #854.
History:
2012-09-18 Steven Lambright - Added the selfContained option to the constructor. This allows us to show a work space without handling the tool and status areas externally. No longer inherits from QMdiArea because of the need to place widgets around the mdi area.
History:
2015-05-13 Ian Humphrey - Modified addCubeViewport(QString) to handle any exceptions that are thrown within the slot. This prevents undefined behavior when an exception is not handled within a connected slot. References #2210.
History:
2016-09-08 Tracie Sucharski - Changed imageToMdiWidget to cubeToMdiWidget. Workspace deals with cubes. Since Image contains a cube, simply pass in cube instead of Image. This was done to handle the new IPCE container class, Shape, which also contains a cube, but not an Image.
History:
2017-09-11 Adam Goins - Added the ability to accept cubelists under any file format. Fixes #5099.
History:
2018-04-13 Christopher Combs - Added .lbl files to the list of single-cube file-extensions to check before reading a cube list in addCubeViewport. Fixes #5350.
History:
2018-09-12 Adam Goins - Modified logic to attempt to open the file as a cube or detached label first, if that fails attempt to open it as a cube list and if that fails, throw an error to the user. This allows cubes and cube lists to be saved under any extension and opened. Fixes #5439, Fixes #5476.

Definition at line 78 of file Workspace.h.

Constructor & Destructor Documentation

◆ Workspace() [1/2]

Isis::Workspace::Workspace ( bool  selfContained,
QWidget parent = 0 
)

Constructor for Workspace.

Workspace constructor.

Parameters
selfContainedif this Workspace should be self contained or note
parentThe parent QWidget, defaults to 0
parent

Definition at line 58 of file Workspace.cpp.

References Isis::Tool::activate(), activateViewport(), Isis::Tool::addTo(), Isis::Tool::addToActive(), Isis::Tool::addToPermanent(), m_cubeViewportList, m_mdi, m_tools, and Isis::Tool::menuName().

◆ Workspace() [2/2]

Isis::Workspace::Workspace ( const Workspace other)

Constructor for Workspace.

Parameters
otherThe other Workspace to load from.

Definition at line 202 of file Workspace.cpp.

References m_cubeViewportList.

◆ ~Workspace()

Isis::Workspace::~Workspace ( )
virtual

Deconstructor.

Definition at line 208 of file Workspace.cpp.

References m_cubeViewportList, and m_tools.

Member Function Documentation

◆ activateViewport

void Isis::Workspace::activateViewport ( QMdiSubWindow w)
protectedslot

This method activates the Viewport.

This gets called when a window is activated or the workspace loses focus.

Parameters
wThe subwindow to activate
w

Definition at line 222 of file Workspace.cpp.

References cubeViewportActivated(), and m_mdi.

Referenced by Workspace().

◆ addBrowseView

void Isis::Workspace::addBrowseView ( QString  cube)
slot

Method is called to add a Cube from BrowseView.

Parameters
cubeThe cube being browsed

Definition at line 490 of file Workspace.cpp.

References addCubeViewport(), and m_mdi.

◆ addCubeViewport [1/2]

MdiCubeViewport * Isis::Workspace::addCubeViewport ( Cube cube)
slot

Method adds a cube into the Workspace as a CubeViewport.

Add a cubeViewport to the workspace.

Parameters
cubeThe cube to be added into the Workspace.
cube(Cube *) cube information
History:
2007-04-13 Tracie Sucharski - Load entire image instead of fitting smallest dimension.
History:
2008-05-27 Noah Hilt - Now returns a MdiCubeViewport in order for the addCubeViewport(QString cubename) method to modify the MdiCubeViewport.
History:
2008-08-20 Stacy Alley - Changed the setScale call to match the zoomTool's fit in view
History:
2008-12-04 Jeannie Walldren - Added try/catch to close the MdiCubeViewport if showCube() is not successful.

Definition at line 464 of file Workspace.cpp.

References cubeViewportAdded(), Isis::Cube::fileName(), m_mdi, Isis::IException::Programmer, and Isis::ViewportMdiSubWindow::viewport().

◆ addCubeViewport [2/2]

void Isis::Workspace::addCubeViewport ( QString  filename)
slot

Method adds the name of a cube into Workspace as a CubeViewport.

Add a cubeViewport to the workspace, open the cube.

Parameters
cubenameThe cube to be added to the Workspace
cubename(QString) cubename
History:
2006-06-12 Tracie Sucharski, Clear errors after catching when attempting to open cube.
History:
2007-02-13 Tracie Sucharski, Open cube read, not read/write. Opening read/write was done to accomodate the EditTool. EditTool will now reopen the cube read/write.
History:
2008-05-27 Noah Hilt, When opening a cube now if a user specifies extra arguments to the cube name, the cube will be opened using a CubeAttributeInput specifically for the number and index of bands to be opened. Additionally, if a cube is opened with 3 bands it will be opened in RGB mode with red, green, and blue set to the 3 bands respectively.
History:
2008-12-04 Jeannie Walldren - Removed "delete cube" since this was causing a segfault and this deallocation is already taking place in addCubeViewport(cube).
History:
2015-05-13 Ian Humphrey - Caught exception now handled by sending a QMessageBox to the Workspace. This prevents undefined behavior caused by not handling an exception within a connected slot.
History:
2017-08-17 Adam Goins - Added the ability for this method to receive a cubelist file as input to qview, parse out the .cub files from the cubelist and then attempt to add each one into their own viewport.
History:
2017-10-12 Kristin Berry - Reverted to using relative instead of full file paths, as this caused errors when working with cubelists that contained relative paths. Fixes # 5177
History:
2018-09-12 Adam Goins - Modified logic to attempt to open the file as a cube or detached label first, if that fails attempt to open it as a cube list and if that fails, throw an error to the user. This allows cubes and cube lists to be saved under any extension and opened. Fixes #5439, Fixes #5476.

Definition at line 339 of file Workspace.cpp.

References addCubeViewportFromList(), Isis::CubeAttributeInput::bands(), Isis::Cube::open(), Isis::Cube::setVirtualBands(), Isis::IString::ToInteger(), Isis::IException::toString(), and Isis::IException::User.

Referenced by addBrowseView(), addCubeViewportFromList(), addImages(), and Isis::CubeDnView::onItemAdded().

◆ addCubeViewportFromList

void Isis::Workspace::addCubeViewportFromList ( QString  cubelist)
slot

Method adds cubes into Workspace as a CubeViewport from a list of cubes.

Parameters
cubenameThe name of the cube list file.
History:
2018-09-12 Adam Goins - Added this method to attempt to open a file as a cube list. It's called by addCubeViewport() when that method attempts to open a file as a cube but fails. Fixes #5439, Fixes #5476.

Definition at line 391 of file Workspace.cpp.

References addCubeViewport(), Isis::CubeAttributeInput::bands(), Isis::Cube::open(), Isis::Cube::setVirtualBands(), Isis::IString::ToInteger(), and Isis::IException::User.

Referenced by addCubeViewport().

◆ addImages()

void Isis::Workspace::addImages ( ImageList images)

Adds a list of Images to a viewport.

Parameters
imagesThe ImageList of images to add to the Workspace

Definition at line 260 of file Workspace.cpp.

References addCubeViewport(), and Isis::Image::cube().

◆ confirmClose()

bool Isis::Workspace::confirmClose ( )

Confirms that the user wishes toc lose the Workspace.

Returns
True of False if the user wishes to close the Workspace

Definition at line 267 of file Workspace.cpp.

References cubeViewportList().

Referenced by Isis::ViewportMainWindow::closeEvent().

◆ cubeToMdiWidget()

QWidget * Isis::Workspace::cubeToMdiWidget ( Cube cube)

Converts a cube to an MdiWidget.

Parameters
cubeThe cube to reference
Returns
QWidget The widget associated with the cube

Definition at line 280 of file Workspace.cpp.

References Isis::CubeViewport::cube(), and m_cubeViewportList.

Referenced by Isis::CubeDnView::onItemAdded(), and Isis::CubeDnView::setWorkspaceActiveCube().

◆ cubeViewportActivated

void Isis::Workspace::cubeViewportActivated ( MdiCubeViewport )
signal

Signal triggered when a Cube is activated in the Workspace.

Referenced by activateViewport().

◆ cubeViewportAdded

void Isis::Workspace::cubeViewportAdded ( MdiCubeViewport )
signal

Signal triggered when a Cube is added to the Workspace.

Referenced by addCubeViewport().

◆ cubeViewportList()

QVector< MdiCubeViewport * > * Isis::Workspace::cubeViewportList ( )

This method returns a Vector of MdiCubeViewports.

Repopulates the list of MdiCubeViewports and returns a pointer to this list.

Returns
QVector a vector of MdiCubeViewports

Ownership is not given to the caller.

Returns
std::vector<MdiCubeViewport*>*

Definition at line 238 of file Workspace.cpp.

References m_cubeViewportList, and m_mdi.

Referenced by confirmClose(), Isis::Tool::cubeViewportList(), Isis::QnetFileTool::loadImage(), Isis::ScatterPlotConfigDialog::refreshWidgetStates(), Isis::ScatterPlotConfigDialog::xAxisCubeViewport(), and Isis::ScatterPlotConfigDialog::yAxisCubeViewport().

◆ mdiArea()

QMdiArea * Isis::Workspace::mdiArea ( )

This method returns the QMdiArea.

Returns
QMdiArea the Area of the mdi

Definition at line 295 of file Workspace.cpp.

References m_mdi.

Referenced by Isis::FileTool::addTo(), Isis::WindowTool::addTo(), Isis::CubeDnView::CubeDnView(), Isis::QnetFileTool::loadImage(), and Isis::CubeDnView::workspaceActiveCube().

◆ operator=()

Workspace & Isis::Workspace::operator= ( Workspace  other)

Is equal to comparsion.

Parameters
otherThe Workspace to compare against
Returns
bool True of False if they're equal to eachother .

Definition at line 250 of file Workspace.cpp.

References m_cubeViewportList.

Member Data Documentation

◆ m_cubeViewportList

QVector< MdiCubeViewport * >* Isis::Workspace::m_cubeViewportList
private

List of cube viewports.

Definition at line 204 of file Workspace.h.

Referenced by cubeToMdiWidget(), cubeViewportList(), operator=(), Workspace(), and ~Workspace().

◆ m_mdi

QPointer<QMdiArea> Isis::Workspace::m_mdi
private

The mdi area.

Definition at line 202 of file Workspace.h.

Referenced by activateViewport(), addBrowseView(), addCubeViewport(), cubeViewportList(), mdiArea(), and Workspace().

◆ m_tools

ToolList* Isis::Workspace::m_tools
private

List of all of the tools.

Definition at line 206 of file Workspace.h.

Referenced by Workspace(), and ~Workspace().


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