27 #include <QHBoxLayout> 28 #include <QKeySequence> 31 #include <QMdiSubWindow> 34 #include <QModelIndex> 38 #include <QToolButton> 39 #include <QVBoxLayout> 40 #include <QWidgetAction> 41 #include <QXmlStreamWriter> 45 #include "BlinkTool.h" 50 #include "FeatureNomenclatureTool.h" 54 #include "HistogramTool.h" 56 #include "ImageList.h" 57 #include "ControlNetTool.h" 59 #include "MatchTool.h" 61 #include "MeasureTool.h" 67 #include "RubberBandTool.h" 68 #include "ScatterPlotTool.h" 70 #include "SpatialPlotTool.h" 71 #include "SpecialPixelTool.h" 72 #include "SpectralPlotTool.h" 74 #include "StereoTool.h" 76 #include "SunShadowTool.h" 77 #include "TrackTool.h" 81 #include "ViewportMdiSubWindow.h" 83 #include "WindowTool.h" 84 #include "XmlStackedHandlerReader.h" 98 SIGNAL( currentChanged(
const QModelIndex &,
const QModelIndex &) ),
114 createActions(directory);
124 void CubeDnView::createActions(
Directory *directory) {
138 addToolBar(Qt::RightToolBarArea,
m_toolPad);
149 tools->append(controlNetTool);
156 connect(controlNetTool, SIGNAL(modifyControlPoint(
ControlPoint *, QString)),
157 this, SIGNAL(modifyControlPoint(
ControlPoint *, QString)));
159 connect(controlNetTool, SIGNAL(deleteControlPoint(
ControlPoint *)),
162 connect(controlNetTool, SIGNAL(createControlPoint(
double,
double,
Cube *,
bool)),
163 this, SIGNAL(createControlPoint(
double,
double,
Cube *,
bool)));
167 connect(
this, SIGNAL(controlPointAdded(QString)), controlNetTool, SLOT(paintAllViewports()));
171 connect(
this, SIGNAL(redrawMeasures()), controlNetTool, SLOT(paintAllViewports()));
175 tools->append(zoomTool);
176 tools->append(
new PanTool(
this));
193 tools->append(
new TrackTool(statusBar()));
210 for (
int i = 0; i < tools->count(); i++) {
211 Tool *tool = (*tools)[i];
220 QString menuName = tool->
menuName();
222 if (menuName ==
"&View") {
225 else if (menuName ==
"&Options") {
228 else if (menuName ==
"&Window") {
239 foreach (
QAction *action, findChildren<QAction *>()) {
242 if (action->toolTip() ==
"Save") {
243 action->setShortcut(QKeySequence());
248 if (QString(action->metaObject()->className()) ==
"QWidgetAction") {
258 if (QString(child->metaObject()->className()).contains(
"ComboBox") ||
259 QString(child->metaObject()->className()).contains(
"Widget")) {
285 foreach (QToolButton *button, findChildren<QToolButton *>()) {
286 if (button->menu() && button->menu()->isVisible()) {
298 foreach (
QAction *action, actions()) {
299 action->setDisabled(
true);
302 widget->setDisabled(
true);
312 foreach (
QAction *action, actions()) {
316 action->setEnabled(
true);
319 widget->setEnabled(
true);
333 if (action->objectName() ==
"ControlNetTool") {
334 action->setEnabled(value);
337 cnetTool->loadNetwork();
421 if ( !isVisible() ) {
436 QItemSelectionModel::SelectCurrent);
448 connect(viewport, SIGNAL( destroyed(
QObject *) ),
516 return viewport->
cube();
552 void CubeDnView::save(QXmlStreamWriter &stream,
Project *,
FileName)
const {
553 stream.writeStartElement(
"cubeDnView");
554 stream.writeAttribute(
"objectName", objectName());
559 stream.writeStartElement(
"image");
560 stream.writeAttribute(
"id", item->
image()->
id());
563 stream.writeStartElement(
"shape");
564 stream.writeAttribute(
"id", item->
shape()->
id());
566 stream.writeEndElement();
568 stream.writeEndElement();
579 CubeDnView::XmlHandler::~XmlHandler() {
583 bool CubeDnView::XmlHandler::startElement(
const QString &namespaceURI,
584 const QString &localName,
const QString &qName,
const QXmlAttributes &atts) {
585 bool result = XmlStackedHandler::startElement(namespaceURI, localName, qName, atts);
590 QString
id = atts.value(
"id");
593 if (localName ==
"image") {
594 Image *image = m_project->image(
id);
600 else if (localName ==
"shape") {
601 Shape *shape = m_project->shape(
id);
615 bool CubeDnView::XmlHandler::endElement(
const QString &namespaceURI,
616 const QString &localName,
const QString &qName) {
617 bool result = XmlStackedHandler::endElement(namespaceURI, localName, qName);
Cube display widget for certain Isis MDI applications.
void setWorkspaceActiveCube(Image *image)
Raises the subwindow corresponding with an image to the top.
CubeDnView * m_cubeDnView
The view we are working with.
bool isImageList() const
Returns true if an ImageList is stored in the data of the item.
virtual void addItem(ProjectItem *item)
Adds an item to the view.
bool isShapeList() const
Returns true if an ShapeList is stored in the data of the item.
void onItemAdded(ProjectItem *item)
Slot to connect to the itemAdded signal from a ProjectItemModel.
The main project for ipce.
bool isImage() const
Returns true if an Image is stored in the data of the item.
Workspace * m_workspace
The workspace.
ProjectItemViewMenu * m_viewMenu
View menu for storing actions.
File name manipulation and expansion.
ProjectItem * itemFromIndex(const QModelIndex &index)
Returns the ProjectItem corresponding to a given QModelIndex.
void onCubeViewportActivated(MdiCubeViewport *)
Slot to connect to the cubeViewportActivated signal from the Workspace.
QToolBar * m_activeToolBar
A tool bar for storing actions.
void onCubeViewportDeleted(QObject *obj)
Slot to connect to the destroyed signal from a viewport.
QAction * m_separatorAction
A separator action that is reused.
QMap< Cube *, ProjectItem * > m_cubeItemMap
Maps cubes to their items.
QList< QWidget * > m_childWidgets
Child widgets of the active toolbar.
ProjectItemViewMenu * m_optionsMenu
Options menu for storing actions.
QVector< MdiCubeViewport *> * cubeViewportList()
This method returns a Vector of MdiCubeViewports.
Control * activeControl()
Return the Active Control (control network)
void disableActions()
Disables toolbars and toolpad actions/widgets.
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...
AbstractProjectItemView is a base class for views of a ProjectItemModel in Qt's model-view framework...
Provides access to data stored in a Project through Qt's model-view framework.
ProjectItem * addItem(ProjectItem *sourceItem)
Adds an item and its children to the proxy model.
ProjectItem * findItemData(const QVariant &data, int role=Qt::UserRole+1)
Returns the first item found that contains the given data in the given role or a null pointer if no i...
virtual ProjectItemModel * internalModel()
Returns the internal model of the view.
CubeDnView(Directory *directory, QWidget *parent=0)
Constructs the view, initializing the tools.
Allows access to items in a ProjectItemModel through a proxy model.
void enableControlNetTool(bool value)
A slot function that is called when directory emits a signal that an active control network is set...
QItemSelectionModel * selectionModel()
Returns the internal selection model.
Cube * cube()
Get the Cube * associated with this display property.
Project * m_project
The current project.
virtual void pushContentHandler(XmlStackedHandler *newHandler)
Push a contentHandler and maybe continue parsing...
This represents a cube in a project-based GUI interface.
ToolPad * m_toolPad
A tool bar for storing actions.
Image * image() const
Returns the Image stored in the data of the item.
This is an actual viewport window in qview/qnet/etc.
QString id() const
Get a unique, identifying string associated with this shape.
ControlNet * controlNet()
Open and return a pointer to the ControlNet for this Control.
ProjectItemModel * sourceModel()
Returns the source model.
void onCubeViewportAdded(MdiCubeViewport *viewport)
Slot to connect to the viewportAdded signal from a Workspace.
QWidget * cubeToMdiWidget(Cube *cube)
Converts a cube to an MdiWidget.
MdiCubeViewport * viewport()
Grabs the viewport.
void addItem(ProjectItem *item)
Adds an item to the view.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
This represents a shape in a project-based GUI interface.
void addCubeViewport(QString cubename)
Method adds the name of a cube into Workspace as a CubeViewport.
void leaveEvent(QEvent *event)
Disables actions when the cursor leaves the view.
Shape * shape() const
Returns the Shape stored in the data of the item.
View that displays cubes in a QView-like way.
QString id() const
Get a unique, identifying string associated with this image.
QToolBar * m_permToolBar
A tool bar for storing actions.
Represents an item of a ProjectItemModel in Qt's model-view framework.
Namespace for ISIS/Bullet specific routines.
Project * project() const
Gets the Project for this directory.
Cube * cube()
Get the Cube pointer associated with this display property.
QMdiArea * mdiArea()
This method returns the QMdiArea.
bool isShape() const
Returns true if an Shape is stored in the data of the item.
void onCurrentChanged(const QModelIndex ¤t)
Slot to connect to the currentChanged() signal from a selection model.
void enableActions()
Enables toolbars and toolpad actions/widgets.
Manage a stack of content handlers for reading XML files.
ProjectItemViewMenu * m_windowMenu
Window menu for storing actions.
IO Handler for Isis Cubes.