14#include <QKeySequence>
17#include <QMdiSubWindow>
26#include <QWidgetAction>
27#include <QXmlStreamWriter>
29#include "AdvancedTrackTool.h"
33#include "CubeAttribute.h"
36#include "FeatureNomenclatureTool.h"
40#include "HistogramTool.h"
43#include "ControlNetTool.h"
46#include "MdiCubeViewport.h"
47#include "MeasureTool.h"
50#include "ProjectItem.h"
51#include "ProjectItemModel.h"
52#include "ProjectItemProxyModel.h"
53#include "RubberBandTool.h"
54#include "ScatterPlotTool.h"
56#include "SpatialPlotTool.h"
57#include "SpecialPixelTool.h"
58#include "SpectralPlotTool.h"
59#include "StatisticsTool.h"
60#include "StereoTool.h"
61#include "StretchTool.h"
62#include "SunShadowTool.h"
67#include "ViewportMdiSubWindow.h"
69#include "WindowTool.h"
72#include "ProjectItemViewMenu.h"
83 SIGNAL( currentChanged(
const QModelIndex &,
const QModelIndex &) ),
99 createActions(directory);
109 void CubeDnView::createActions(
Directory *directory) {
123 addToolBar(Qt::RightToolBarArea,
m_toolPad);
134 tools->append(controlNetTool);
141 connect(controlNetTool, SIGNAL(modifyControlPoint(
ControlPoint *, QString)),
142 this, SIGNAL(modifyControlPoint(
ControlPoint *, QString)));
144 connect(controlNetTool, SIGNAL(deleteControlPoint(
ControlPoint *)),
147 connect(controlNetTool, SIGNAL(createControlPoint(
double,
double,
Cube *,
bool)),
148 this, SIGNAL(createControlPoint(
double,
double,
Cube *,
bool)));
152 connect(
this, SIGNAL(controlPointAdded(QString)), controlNetTool, SLOT(paintAllViewports()));
156 connect(
this, SIGNAL(redrawMeasures()), controlNetTool, SLOT(paintAllViewports()));
160 tools->append(zoomTool);
161 tools->append(
new PanTool(
this));
178 tools->append(
new TrackTool(statusBar()));
195 for (
int i = 0; i < tools->count(); i++) {
196 Tool *tool = (*tools)[i];
204 if (!tool->menuName().isEmpty()) {
205 QString menuName = tool->menuName();
207 if (menuName ==
"&View") {
210 else if (menuName ==
"&Options") {
213 else if (menuName ==
"&Window") {
224 foreach (
QAction *action, findChildren<QAction *>()) {
227 if (action->toolTip() ==
"Save") {
228 action->setShortcut(QKeySequence());
233 if (QString(action->metaObject()->className()) ==
"QWidgetAction") {
243 if (QString(child->metaObject()->className()).contains(
"ComboBox") ||
244 QString(child->metaObject()->className()).contains(
"Widget")) {
253 zoomTool->activate(
true);
270 foreach (QToolButton *button, findChildren<QToolButton *>()) {
271 if (button->menu() && button->menu()->isVisible()) {
283 foreach (
QAction *action, actions()) {
284 action->setDisabled(
true);
287 widget->setDisabled(
true);
297 foreach (
QAction *action, actions()) {
301 action->setEnabled(
true);
304 widget->setEnabled(
true);
318 if (action->objectName() ==
"ControlNetTool") {
319 action->setEnabled(value);
322 cnetTool->loadNetwork();
406 if ( !isVisible() ) {
420 internalModel()->selectionModel()->setCurrentIndex(item->index(),
421 QItemSelectionModel::SelectCurrent);
433 connect(viewport, SIGNAL( destroyed(
QObject *) ),
496 ViewportMdiSubWindow *subWindow = qobject_cast<ViewportMdiSubWindow *>( mdiArea->currentSubWindow() );
501 return viewport->
cube();
519 QMdiSubWindow *subWindow = qobject_cast<QMdiSubWindow *>( mdiWidget->parent() );
532 void CubeDnView::save(QXmlStreamWriter &stream,
Project *,
FileName)
const {
533 stream.writeStartElement(
"cubeDnView");
534 stream.writeAttribute(
"objectName", objectName());
539 stream.writeStartElement(
"image");
540 stream.writeAttribute(
"id", item->
image()->
id());
543 stream.writeStartElement(
"shape");
544 stream.writeAttribute(
"id", item->
shape()->
id());
546 stream.writeEndElement();
548 stream.writeEndElement();
AbstractProjectItemView is a base class for views of a ProjectItemModel in Qt's model-view framework.
virtual void addItem(ProjectItem *item)
Adds an item to the view.
virtual ProjectItemModel * internalModel()
Returns the internal model of the view.
ControlNet * controlNet()
Open and return a pointer to the ControlNet for this Control.
void onCubeViewportActivated(MdiCubeViewport *)
Slot to connect to the cubeViewportActivated signal from the Workspace.
void disableActions()
Disables toolbars and toolpad actions/widgets.
ProjectItemViewMenu * m_windowMenu
Window menu for storing actions.
ProjectItemViewMenu * m_viewMenu
View menu for storing actions.
void leaveEvent(QEvent *event)
Disables actions when the cursor leaves the view.
QMap< Cube *, ProjectItem * > m_cubeItemMap
Maps cubes to their items.
void onCurrentChanged(const QModelIndex ¤t)
Slot to connect to the currentChanged() signal from a selection model.
QToolBar * m_permToolBar
A tool bar for storing actions.
ProjectItemViewMenu * m_optionsMenu
Options menu for storing actions.
void addItem(ProjectItem *item)
Adds an item to the view.
Directory * m_directory
The directory.
Cube * workspaceActiveCube()
Returns the cube of the active viewport in the Workspace, or a null pointer if no viewports are activ...
ToolPad * m_toolPad
A tool bar for storing actions.
void enableActions()
Enables toolbars and toolpad actions/widgets.
void onItemAdded(ProjectItem *item)
Slot to connect to the itemAdded signal from a ProjectItemModel.
Workspace * m_workspace
The workspace.
QList< QWidget * > m_childWidgets
Child widgets of the active toolbar.
CubeDnView(Directory *directory, QWidget *parent=0)
Constructs the view, initializing the tools.
QToolBar * m_activeToolBar
A tool bar for storing actions.
void onCubeViewportDeleted(QObject *obj)
Slot to connect to the destroyed signal from a viewport.
void onCubeViewportAdded(MdiCubeViewport *viewport)
Slot to connect to the viewportAdded signal from a Workspace.
void setWorkspaceActiveCube(Image *image)
Raises the subwindow corresponding with an image to the top.
QAction * m_separatorAction
A separator action that is reused.
void enableControlNetTool(bool value)
A slot function that is called when directory emits a signal that an active control network is set.
IO Handler for Isis Cubes.
Project * project() const
Gets the Project for this directory.
File name manipulation and expansion.
This represents a cube in a project-based GUI interface.
Cube * cube()
Get the Cube pointer associated with this display property.
QString id() const
Get a unique, identifying string associated with this image.
Cube display widget for certain Isis MDI applications.
The main project for ipce.
Control * activeControl()
Return the Active Control (control network)
Represents an item of a ProjectItemModel in Qt's model-view framework.
bool isShape() const
Returns true if an Shape is stored in the data of the item.
bool isShapeList() const
Returns true if an ShapeList is stored in the data of the item.
Shape * shape() const
Returns the Shape stored in the data of the item.
bool isImageList() const
Returns true if an ImageList is stored in the data of the item.
Image * image() const
Returns the Image stored in the data of the item.
bool isImage() const
Returns true if an Image is stored in the data of the item.
Allows access to items in a ProjectItemModel through a proxy model.
QString id() const
Get a unique, identifying string associated with this shape.
Cube * cube()
Get the Cube * associated with this display property.
This is an actual viewport window in qview/qnet/etc.
QMdiArea * mdiArea()
This method returns the QMdiArea.
void addCubeViewport(QString cubename)
Method adds the name of a cube into Workspace as a CubeViewport.
QWidget * cubeToMdiWidget(Cube *cube)
Converts a cube to an MdiWidget.
QVector< MdiCubeViewport * > * cubeViewportList()
This method returns a Vector of MdiCubeViewports.
This is free and unencumbered software released into the public domain.