5 #include <QProgressBar> 11 #include <QWeakPointer> 15 #include "BlinkTool.h" 19 #include "FeatureNomenclatureTool.h" 24 #include "HistogramTool.h" 26 #include "ImageList.h" 28 #include "MatchTool.h" 30 #include "MeasureTool.h" 32 #include "RubberBandTool.h" 36 #include "ScatterPlotTool.h" 37 #include "SpatialPlotTool.h" 38 #include "SpecialPixelTool.h" 39 #include "SpectralPlotTool.h" 41 #include "StereoTool.h" 43 #include "SunShadowTool.h" 44 #include "TrackTool.h" 47 #include "ViewportMdiSubWindow.h" 48 #include "WindowTool.h" 65 m_mdi =
new QMdiArea(
this);
67 QGridLayout *layout =
new QGridLayout;
71 layout->setContentsMargins(0, 0, 0, 0);
72 layout->addWidget(
m_mdi, 0, 0);
95 QMenuBar *menuBar =
new QMenuBar;
96 layout->addWidget(menuBar, row, 0, 1, 2);
99 QHBoxLayout *permActiveToolBarLayout =
new QHBoxLayout;
102 permToolBar->setObjectName(
"permToolBar");
103 permToolBar->setIconSize(QSize(22, 22));
104 permActiveToolBarLayout->addWidget(permToolBar);
107 activeToolBar->setObjectName(
"activeToolBar");
108 activeToolBar->setIconSize(QSize(22, 22));
109 permActiveToolBarLayout->addWidget(activeToolBar);
111 layout->addLayout(permActiveToolBarLayout, row, 0, 1, 2);
114 layout->addWidget(
m_mdi, row, 0, 1, 1);
117 toolPad->setObjectName(
"toolPad");
118 toolPad->setOrientation(Qt::Vertical);
119 layout->addWidget(toolPad, row, 1, 1, 1);
122 QStatusBar *statusBar =
new QStatusBar(
this);
123 layout->addWidget(statusBar, row, 0, 1, 2);
127 Tool *defaultActiveTool = NULL;
136 defaultActiveTool =
new ZoomTool(
this);
137 m_tools->append(defaultActiveTool);
165 for (
int i = 0; i <
m_tools->count(); i++) {
166 Tool *tool = (*m_tools)[i];
172 tool->
addTo(toolPad);
175 QString menuName = tool->
menuName();
177 QMenu *subMenu = subMenus[menuName];
180 subMenus[menuName] = menuBar->addMenu(menuName);
181 subMenu = subMenus[menuName];
184 tool->
addTo(subMenu);
188 permToolBar->addSeparator();
192 permToolBar->addSeparator();
198 m_mdi->setActivationOrder(QMdiArea::ActivationHistoryOrder);
227 else if(!
m_mdi->currentSubWindow()) {
241 for(
int i = 0; i <
m_mdi->subWindowList().size(); i++) {
261 foreach (
Image *image, *images) {
270 bool confirmed =
true;
272 for (
int viewportIndex = 0; confirmed && viewportIndex < viewports.count(); viewportIndex++) {
273 confirmed = viewports[viewportIndex]->confirmClose();
286 if (viewport->
cube() == cube) {
287 result = qobject_cast<
QWidget *>(viewport->parent());
341 QFileInfo cubeFileName(filename);
343 QString cubename = cubeFileName.filePath();
350 std::vector<QString> bands = inAtt.
bands();
354 cube->
open(cubename);
359 if(bands.size() == 3) {
366 cvp->viewRGB(index_red, index_green, index_blue);
372 QString message(
"Error opening cube [" + cubename +
"]...\n");
373 message +=
"Attempting to open [" + cubename +
"] as a cube list...\n";
393 QFileInfo cubeFileName(cubelist);
397 QFile file(cubeFileName.filePath());
398 file.open(QIODevice::ReadOnly);
400 QTextStream in(&file);
403 while ( !file.atEnd() ) {
404 QString line = file.readLine().replace(
"\n",
"");
405 cubesToOpen.append(line);
410 for (
int i = 0; i < cubesToOpen.size(); i++) {
415 cubename = cubesToOpen.at(i);
419 std::vector<QString> bands = inAtt.
bands();
423 cube->
open(cubename);
428 if(bands.size() == 3) {
435 cvp->viewRGB(index_red, index_green, index_blue);
439 QString message(
"Error attempting to open [" + cubename +
"] from list [" + cubelist +
"]...\n");
469 window->setAttribute(Qt::WA_DeleteOnClose);
471 m_mdi->addSubWindow(window);
481 tr(
"Error when attempting to show cube [%1]")
492 if (
m_mdi->subWindowList().size()) {
493 QPointer<QMdiSubWindow> windowToRemove =
494 m_mdi->subWindowList().last();
496 m_mdi->removeSubWindow(windowToRemove.data());
498 delete windowToRemove.data();
Cube display widget for certain Isis MDI applications.
Internalizes a list of images and allows for operations on the entire list.
Workspace(bool selfContained, QWidget *parent=0)
Constructor for Workspace.
void addBrowseView(QString cube)
Method is called to add a Cube from BrowseView.
QVector< MdiCubeViewport *> * cubeViewportList()
This method returns a Vector of MdiCubeViewports.
int ToInteger() const
Returns the object string as an integer.
virtual ~Workspace()
Deconstructor.
This error is for when a programmer made an API call that was illegal.
ToolList * m_tools
List of all of the tools.
void addImages(ImageList *images)
Adds a list of Images to a viewport.
void addCubeViewportFromList(QString cubelist)
Method adds cubes into Workspace as a CubeViewport from a list of cubes.
QVector< MdiCubeViewport *> * m_cubeViewportList
List of cube viewports.
#define _FILEINFO_
Macro for the filename and line number.
void setVirtualBands(const QList< QString > &vbands)
This allows the programmer to specify a subset of bands to work with.
A type of error that could only have occurred due to a mistake on the user's part (e...
void open(const QString &cfile, QString access="r")
This method will open an isis cube for reading or reading/writing.
This represents a cube in a project-based GUI interface.
This is an actual viewport window in qview/qnet/etc.
Workspace & operator=(Workspace other)
Is equal to comparsion.
QWidget * cubeToMdiWidget(Cube *cube)
Converts a cube to an MdiWidget.
MdiCubeViewport * viewport()
Grabs the viewport.
QString toString() const
Returns a string representation of this exception.
void addCubeViewport(QString cubename)
Method adds the name of a cube into Workspace as a CubeViewport.
bool confirmClose()
Confirms that the user wishes toc lose the Workspace.
virtual QString fileName() const
Returns the opened cube's filename.
Adds specific functionality to C++ strings.
Namespace for ISIS/Bullet specific routines.
Cube * cube()
Get the Cube pointer associated with this display property.
QMdiArea * mdiArea()
This method returns the QMdiArea.
void cubeViewportActivated(MdiCubeViewport *)
Signal triggered when a Cube is activated in the Workspace.
QPointer< QMdiArea > m_mdi
The mdi area.
void activateViewport(QMdiSubWindow *w)
This method activates the Viewport.
void cubeViewportAdded(MdiCubeViewport *)
Signal triggered when a Cube is added to the Workspace.
IO Handler for Isis Cubes.