9#include "Footprint2DView.h"
13#include <QDragEnterEvent>
14#include <QDragMoveEvent>
16#include <QItemSelectionModel>
27#include <QWidgetAction>
28#include <QXmlStreamWriter>
30#include "ControlNetTool.h"
31#include "ControlPoint.h"
35#include "ImageFileListWidget.h"
36#include "MosaicGraphicsView.h"
37#include "MosaicSceneWidget.h"
38#include "MosaicControlNetTool.h"
40#include "ProjectItem.h"
41#include "ProjectItemModel.h"
44#include "XmlStackedHandlerReader.h"
55 QStatusBar *statusBar =
new QStatusBar(
this);
60 graphicsView->installEventFilter(
this);
61 graphicsView->setAcceptDrops(
false);
81 connect(
m_sceneWidget, SIGNAL(createControlPoint(
double,
double)),
82 this, SIGNAL(createControlPoint(
double,
double)));
90 connect(
this, SIGNAL(redrawMeasures()),
m_sceneWidget->getScene(), SLOT(update()));
92 setStatusBar(statusBar);
102 imageFileListdock->setObjectName(imageFileListdock->windowTitle());
103 imageFileListdock->setFeatures( QDockWidget::DockWidgetFloatable |
104 QDockWidget::DockWidgetMovable);
106 imageFileListdock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
110 addDockWidget(Qt::LeftDockWidgetArea, imageFileListdock, Qt::Vertical);
123 addToolBar(Qt::RightToolBarArea,
m_toolPad);
130 foreach (
QAction *action, findChildren<QAction *>()) {
177 if (event->type() == QEvent::DragEnter) {
181 else if (event->type() == QEvent::DragMove) {
185 else if (event->type() == QEvent::Drop) {
186 dropEvent(
static_cast<QDropEvent *
>(event) );
190 return AbstractProjectItemView::eventFilter(watched, event);
212 image = item->
image();
292 if (selectedImages.isEmpty() ) {
296 Image *currentImage = selectedImages.first();
301 internalModel()->selectionModel()->setCurrentIndex(item->index(), QItemSelectionModel::Select);
304 foreach (
Image *image, selectedImages) {
306 internalModel()->selectionModel()->select(item->index(), QItemSelectionModel::Select);
320 if (action->toolTip() ==
"Control Net (c)") {
321 action->setEnabled(value);
336 foreach (
QAction *action, actions()) {
340 action->setEnabled(
true);
350 xmlReader->pushContentHandler(
new XmlHandler(
this) );
367 stream.writeStartElement(
"footprint2DView");
368 stream.writeAttribute(
"objectName", objectName());
373 stream.writeEndElement();
410 const QString &qName,
const QXmlAttributes &atts) {
411 bool result = XmlStackedHandler::startElement(namespaceURI, localName, qName, atts);
414 if (localName ==
"mosaicScene") {
415 m_footprintView->mosaicSceneWidget()->load(reader());
417 if (localName ==
"imageFileList") {
418 m_footprintView->m_fileListWidget->load(reader());
425 bool Footprint2DView::XmlHandler::endElement(
const QString &namespaceURI,
426 const QString &localName,
const QString &qName) {
427 bool result = XmlStackedHandler::endElement(namespaceURI, localName, qName);
AbstractProjectItemView is a base class for views of a ProjectItemModel in Qt's model-view framework.
virtual void dropEvent(QDropEvent *event)
Drops the data into the internal model if it can accept the data.
virtual void dragEnterEvent(QDragEnterEvent *event)
Accepts the drag enter event if the internal model can accept the mime data.
virtual void dragMoveEvent(QDragMoveEvent *event)
Accepts the drag event if the internal model can accept the mime data.
virtual void disableActions()
Disables toolbars and toolpad actions.
virtual ProjectItemModel * internalModel()
Returns the internal model of the view.
Project * project() const
Gets the Project for this directory.
File name manipulation and expansion.
This represents a cube in a project-based GUI interface.
Internalizes a list of images and allows for operations on the entire list.
void append(Image *const &value)
Appends an image to the image list.
A graphics view that resizes in a more friendly way.
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.
Shape * shape() const
Returns the Shape 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.
QString id() const
Get a unique, identifying string associated with this shape.
Cube * cube()
Get the Cube * associated with this display property.
geos::geom::MultiPolygon * footprint()
Get the footprint of this shape (if available).
Manage a stack of content handlers for reading XML files.
This is free and unencumbered software released into the public domain.