This class is a proxy MapDisplay. This makes it possible to add a MapDisplay as item of a scene. This object is of type QGraphicsProxyWidget. He have a directly interaction by user. His transformation matrix is inverted, that is, the inverse of the matrix of the scene, so its coordinate system is screen (pixel), but its position in the scene remains in millimeters. Drawing starting point is llx, lly. He is also the son of ItemObserver, so it can become observer of a model (Observable). "View" part of MVC component. More...
#include <MapLocationItem.h>
Public Member Functions | |
virtual QRectF | boundingRect () const |
Reimplemented from ParentItem. More... | |
virtual void | changeCurrentTool (EnumType *mode) |
virtual void | changeZoomFactor (double currentZoomFactor) |
It is called immediately by the Scene when the zoom factor is changed in the Context. More... | |
void | clearCurrentTool () |
virtual bool | contains (const QPointF &point) const |
virtual ItemController * | getController () |
Returns the "Controller" part of the MVC. More... | |
virtual QImage | getImage () |
Reimplemented from ItemObserver. More... | |
virtual Observable * | getModel () |
Returns the "Model" part of the MVC. More... | |
virtual std::string | getNameClass () |
Method that returns the class name. More... | |
virtual QPixmap | getPixmap () |
virtual te::color::RGBAColor ** | getRGBAColorImage (int &w, int &h) |
Reimplemented from ItemObserver. More... | |
virtual bool | isCanChangeGraphicOrder () |
Returns whether the graphic component to be or not send to back or bring to front. More... | |
virtual bool | isInvertedMatrix () |
Returns whether the graph component has the inverted matrix, otherwise the matrix scene. More... | |
virtual bool | isPrintable () |
Returns whether the graphic component is printable. More... | |
MapLocationItem (ItemController *controller, Observable *o) | |
Constructor. More... | |
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) |
Reimplemented from QGraphicsProxyWidget. More... | |
virtual void | redraw (bool bRefresh=true) |
Redraws the graphic component. More... | |
virtual void | refresh (bool pos=true) |
Updated model state. More... | |
virtual void | setCanChangeGraphicOrder (bool canChange) |
Change the state of the graphic component to be or not send to back or bring to front. More... | |
void | setPixmap (const QPixmap &pixmap) |
virtual void | setPrintable (bool print) |
Modifies the state of the graphic component to be or not printable. More... | |
virtual void | setRect (QRectF rect) |
void | setZValue (qreal z) |
The Z value decides the stacking order of drawing. More... | |
virtual void | updateObserver (ContextItem context) |
Reimplemented from ItemObserver. More... | |
virtual void | updateProperties (te::layout::Properties *properties) |
Reimplemented from ItemObserver. More... | |
virtual | ~MapLocationItem () |
Destructor. More... | |
Protected Slots | |
void | onDrawLayersFinished (const QMap< QString, QString > &errors) |
Protected Member Functions | |
virtual void | applyRotation () |
Reimplemented from ItemObserver. More... | |
virtual void | calculateFrameMargin () |
virtual QPixmap | calculateNewPixmap (const double &x, const double &y) |
virtual bool | checkTouchesCorner (const double &x, const double &y) |
virtual te::gm::Envelope | createNewBoxInCoordScene (const double &x, const double &y) |
virtual void | createResizePixmap () |
virtual void | dragEnterEvent (QGraphicsSceneDragDropEvent *event) |
Reimplemented from QGraphicsProxyWidget. More... | |
virtual void | dragLeaveEvent (QGraphicsSceneDragDropEvent *event) |
Reimplemented from QGraphicsProxyWidget. More... | |
virtual void | dragMoveEvent (QGraphicsSceneDragDropEvent *event) |
Reimplemented from QGraphicsProxyWidget. More... | |
virtual void | drawBackground (QPainter *painter) |
virtual void | drawBorder (QPainter *painter) |
virtual void | drawMap (QPainter *painter) |
virtual void | drawSelection (QPainter *painter) |
virtual void | drawText (QPointF point, QPainter *painter, std::string text) |
Draw a text. Converts boundingRect item coordinates (local coordinates) in pixel coordinates (screen coordinates) of the current device. More... | |
virtual void | dropEvent (QGraphicsSceneDragDropEvent *event) |
Reimplemented from QGraphicsProxyWidget. More... | |
virtual QImage | generateImage () |
virtual void | generateMapPixmap () |
te::map::AbstractLayerPtr | getLayer () |
virtual void | getMimeData (const QMimeData *mime) |
virtual te::gm::Coord2D | getPosition () |
Reimplemented from ItemObserver. More... | |
std::list< te::map::AbstractLayerPtr > | getVisibleLayers () |
virtual int | getZValueItem () |
Reimplemented from ItemObserver. More... | |
virtual void | hoverEnterEvent (QGraphicsSceneHoverEvent *event) |
Reimplemented from QGraphicsItem. More... | |
virtual void | hoverLeaveEvent (QGraphicsSceneHoverEvent *event) |
Reimplemented from QGraphicsItem. More... | |
virtual void | hoverMoveEvent (QGraphicsSceneHoverEvent *event) |
Reimplemented from QGraphicsItem. More... | |
virtual QVariant | itemChange (QGraphicsItem::GraphicsItemChange change, const QVariant &value) |
Reimplemented from QGraphicsItem. More... | |
virtual void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) |
Reimplemented from QGraphicsProxyWidget. More... | |
virtual void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
Reimplemented from QGraphicsProxyWidget. More... | |
virtual void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
Reimplemented from QGraphicsProxyWidget. More... | |
virtual void | recalculateBoundingRect () |
The default implementation does nothing. More... | |
void | setCurrentTool (te::qt::widgets::AbstractTool *tool) |
virtual void | setZValueItem (int z) |
The Z value decides the stacking order of drawing. More... | |
Protected Attributes | |
te::gm::Envelope | m_boxCopy |
box with resize More... | |
bool | m_canChangeGraphicOrder |
Define if item can send to back or bring to front. More... | |
bool | m_changeLayer |
QPixmap | m_clonePixmap |
te::layout::ItemController * | m_controller |
"Controller" part of MVC component. More... | |
LayoutAlign | m_enumSides |
QPointF | m_finalCoord |
bool | m_grabbedByWidget |
double | m_hMargin |
QPointF | m_initialCoord |
bool | m_invertedMatrix |
true if inverted, false otherwise the matrix scene More... | |
te::map::AbstractLayerPtr | m_layer |
te::qt::widgets::MultiThreadMapDisplay * | m_mapDisplay |
QPixmap | m_mapPixmap |
QSize | m_mapSize |
The size of the map display in a zoom of 100%. This size is in pixels and is calculated based on the size of the GraphicItem in millimeters. More... | |
QMimeData * | m_mime |
te::layout::Observable * | m_model |
"Model" part of MVC component. More... | |
bool | m_mousePressedAlt |
mouse and active alt key More... | |
std::string | m_nameClass |
Class name. More... | |
QPixmap | m_pixmap |
bool | m_printable |
State of the graphic component to be or not printable. More... | |
QRectF | m_rect |
bool | m_resizeMode |
pixmap to perform the resize is already built More... | |
te::qt::widgets::AbstractTool * | m_tool |
bool | m_toResizeItem |
pixmap to perform the resize is not yet built More... | |
te::qt::widgets::AbstractTreeItem * | m_treeItem |
double | m_wMargin |
te::qt::widgets::ZoomWheel * | m_zoomWheel |
This class is a proxy MapDisplay. This makes it possible to add a MapDisplay as item of a scene. This object is of type QGraphicsProxyWidget. He have a directly interaction by user. His transformation matrix is inverted, that is, the inverse of the matrix of the scene, so its coordinate system is screen (pixel), but its position in the scene remains in millimeters. Drawing starting point is llx, lly. He is also the son of ItemObserver, so it can become observer of a model (Observable). "View" part of MVC component.
Definition at line 55 of file MapLocationItem.h.
te::layout::MapLocationItem::MapLocationItem | ( | ItemController * | controller, |
Observable * | o | ||
) |
Constructor.
controller | "Controller" part of MVC component |
o | "Model" part of MVC component |
Definition at line 31 of file MapLocationItem.cpp.
References te::layout::MapItem::m_mapDisplay.
|
virtual |
Destructor.
Definition at line 38 of file MapLocationItem.cpp.
|
protectedvirtualinherited |
Reimplemented from ItemObserver.
Implements te::layout::ItemObserver.
|
virtualinherited |
Reimplemented from ParentItem.
Reimplemented from te::layout::ParentItem< QGraphicsProxyWidget >.
Definition at line 726 of file MapItem.cpp.
References te::layout::ItemModelObservable::getBox(), te::gm::Envelope::getHeight(), and te::gm::Envelope::getWidth().
|
protectedvirtualinherited |
Definition at line 619 of file MapItem.cpp.
References te::gm::Envelope::getHeight(), te::common::Singleton< Context >::getInstance(), te::layout::MapModel::getMapBox(), te::layout::Context::getUtils(), te::gm::Envelope::getWidth(), and te::layout::Utils::viewportBox().
Referenced by te::layout::MapItem::MapItem().
|
protectedvirtualinherited |
|
virtualinherited |
Definition at line 544 of file MapItem.cpp.
References te::layout::Enums::getEnumModeType(), te::common::Singleton< Enums >::getInstance(), te::common::Singleton< Context >::getInstance(), te::layout::EnumModeType::getModeMapPan(), te::layout::EnumModeType::getModeMapZoomIn(), te::layout::EnumModeType::getModeMapZoomOut(), te::qt::widgets::Zoom::Out, and te::layout::Context::setMode().
Referenced by te::layout::ItemUtils::setCurrentToolInSelectedMapItems().
|
virtualinherited |
It is called immediately by the Scene when the zoom factor is changed in the Context.
currentZoomFactor | current zoom factor of the layout module |
Reimplemented from te::layout::ItemObserver.
Definition at line 694 of file MapItem.cpp.
|
protectedvirtualinherited |
|
inherited |
Definition at line 533 of file MapItem.cpp.
|
virtualinherited |
|
protectedvirtualinherited |
|
protectedvirtualinherited |
|
protectedvirtualinherited |
Reimplemented from QGraphicsProxyWidget.
Definition at line 308 of file MapItem.cpp.
|
protectedvirtualinherited |
Reimplemented from QGraphicsProxyWidget.
Definition at line 323 of file MapItem.cpp.
|
protectedvirtualinherited |
Reimplemented from QGraphicsProxyWidget.
Definition at line 327 of file MapItem.cpp.
|
protectedvirtualinherited |
|
protectedvirtualinherited |
|
protectedvirtualinherited |
Definition at line 257 of file MapItem.cpp.
|
protectedvirtualinherited |
|
protectedvirtualinherited |
Draw a text. Converts boundingRect item coordinates (local coordinates) in pixel coordinates (screen coordinates) of the current device.
point | initial text coordinate (local coordinates from boundingRect) |
painter | low-level painting on widgets and other paint devices |
text |
|
protectedvirtualinherited |
Reimplemented from QGraphicsProxyWidget.
Definition at line 289 of file MapItem.cpp.
|
protectedvirtualinherited |
Definition at line 593 of file MapItem.cpp.
|
protectedvirtualinherited |
Definition at line 637 of file MapItem.cpp.
|
virtualinherited |
Returns the "Controller" part of the MVC.
Definition at line 99 of file ItemObserver.cpp.
|
virtualinherited |
Reimplemented from ItemObserver.
|
protectedinherited |
Definition at line 487 of file MapItem.cpp.
|
protectedvirtualinherited |
Definition at line 446 of file MapItem.cpp.
|
virtualinherited |
Returns the "Model" part of the MVC.
Definition at line 104 of file ItemObserver.cpp.
Referenced by te::layout::BuildGraphicsItem::addChild(), te::layout::ItemModelObservable::addChildren(), te::layout::VisitorUtils::changeMapVisitable(), te::layout::PropertiesOutside::changeMapVisitable(), te::layout::MenuBuilder::changePropertyValue(), te::layout::ChangePropertyCommand::checkItem(), te::layout::ItemUtils::countType(), te::layout::AddCommand::createCommandString(), te::layout::MoveCommand::createCommandString(), te::layout::ChangePropertyCommand::createCommandString(), te::layout::ItemUtils::createLegendChildAsObject(), te::layout::ObjectInspectorOutside::createProperty(), te::layout::ItemUtils::createTextItemFromObject(), te::layout::ItemUtils::createTextMapAsObject(), te::layout::Scene::deleteItems(), te::layout::PropertiesUtils::equalsHashCode(), te::layout::Scene::exportItemsToImage(), te::layout::PropertiesUtils::getAllProperties(), te::layout::Scene::getItemsProperties(), te::layout::ItemUtils::getMapItem(), te::layout::PropertiesOutside::getMapModel(), te::layout::ObjectInspectorOutside::hasMoveItemGroup(), te::layout::PropertiesUtils::intersection(), te::layout::GridMapItem::itemChange(), te::layout::ParentItem< T >::itemChange(), te::layout::ObjectInspectorOutside::itemsInspector(), te::layout::ItemUtils::mapNameList(), te::layout::ItemUtils::maxTypeId(), te::layout::View::mousePressEvent(), te::layout::Scene::removeSelectedItems(), te::layout::PropertiesUtils::sameProperties(), te::layout::Scene::selectItem(), te::layout::ObjectInspectorOutside::selectItems(), te::layout::PropertiesOutside::sendPropertyToSelectedItem(), and te::layout::PropertiesOutside::sendPropertyToSelectedItems().
|
virtualinherited |
Method that returns the class name.
Definition at line 124 of file ItemObserver.cpp.
Referenced by te::layout::ObjectInspectorOutside::createProperty().
|
virtualinherited |
|
protectedvirtualinherited |
Reimplemented from ItemObserver.
Reimplemented from te::layout::ParentItem< QGraphicsProxyWidget >.
Definition at line 337 of file MapItem.cpp.
References te::layout::MapModel::getDisplacementX(), te::layout::MapModel::getDisplacementY(), te::layout::MapModel::getMapBox(), te::gm::Coord2D::x, and te::gm::Coord2D::y.
|
virtualinherited |
Reimplemented from ItemObserver.
Reimplemented from te::layout::ParentItem< QGraphicsProxyWidget >.
Definition at line 574 of file MapItem.cpp.
References te::qt::widgets::GetImage().
|
protectedinherited |
Definition at line 458 of file MapItem.cpp.
References te::map::GetVisibleLayers().
|
protectedvirtualinherited |
Reimplemented from ItemObserver.
Implements te::layout::ItemObserver.
|
protectedvirtualinherited |
Reimplemented from QGraphicsItem.
|
protectedvirtualinherited |
Reimplemented from QGraphicsItem.
|
protectedvirtualinherited |
Reimplemented from QGraphicsItem.
|
virtualinherited |
Returns whether the graphic component to be or not send to back or bring to front.
Definition at line 119 of file ItemObserver.cpp.
Referenced by te::layout::AlignItems::bringToFront(), te::layout::Scene::createItem(), and te::layout::AlignItems::sendToBack().
|
virtualinherited |
Returns whether the graph component has the inverted matrix, otherwise the matrix scene.
Definition at line 129 of file ItemObserver.cpp.
Referenced by te::layout::Scene::insertItem(), and te::layout::View::mousePressEvent().
|
virtualinherited |
Returns whether the graphic component is printable.
Definition at line 94 of file ItemObserver.cpp.
Referenced by te::layout::Scene::getItemsProperties(), and te::layout::Scene::redrawItems().
|
protectedvirtualinherited |
Reimplemented from QGraphicsItem.
|
protectedvirtualinherited |
Reimplemented from QGraphicsProxyWidget.
Reimplemented from te::layout::ParentItem< QGraphicsProxyWidget >.
Definition at line 367 of file MapItem.cpp.
References te::common::Singleton< Context >::getInstance(), te::layout::Context::getItemUtils(), te::layout::ItemUtils::isCurrentMapTools(), te::layout::ParentItem< T >::mouseMoveEvent(), and remapPointToViewport().
|
protectedvirtualinherited |
Reimplemented from QGraphicsProxyWidget.
Reimplemented from te::layout::ParentItem< QGraphicsProxyWidget >.
Definition at line 393 of file MapItem.cpp.
References te::common::Singleton< Context >::getInstance(), te::layout::Context::getItemUtils(), te::layout::ItemUtils::isCurrentMapTools(), te::layout::ParentItem< T >::mousePressEvent(), and remapPointToViewport().
|
protectedvirtualinherited |
Reimplemented from QGraphicsProxyWidget.
Reimplemented from te::layout::ParentItem< QGraphicsProxyWidget >.
Definition at line 419 of file MapItem.cpp.
References te::common::Singleton< Context >::getInstance(), te::layout::Context::getItemUtils(), te::layout::ItemUtils::isCurrentMapTools(), te::layout::ParentItem< T >::mouseReleaseEvent(), and remapPointToViewport().
|
protectedslotinherited |
Definition at line 499 of file MapItem.cpp.
References te::layout::MapController::refreshLayer().
Referenced by te::layout::MapItem::MapItem().
|
virtualinherited |
Reimplemented from QGraphicsProxyWidget.
Reimplemented from te::layout::ParentItem< QGraphicsProxyWidget >.
Definition at line 235 of file MapItem.cpp.
|
protectedvirtualinherited |
The default implementation does nothing.
Reimplemented from te::layout::ItemObserver.
Definition at line 707 of file MapItem.cpp.
References te::layout::ItemModelObservable::getBox(), te::gm::Envelope::getHeight(), te::gm::Envelope::getWidth(), and te::gm::Envelope::m_urx.
|
virtualinherited |
Redraws the graphic component.
Definition at line 54 of file ItemObserver.cpp.
References te::layout::ContextItem::setChangePos(), and te::layout::ContextItem::setPos().
Referenced by te::layout::BuildGraphicsItem::afterBuild(), te::layout::MenuBuilder::changePropertyValue(), te::layout::ChangePropertyCommand::checkItem(), te::layout::View::createItemGroup(), te::layout::ItemUtils::createLegendChildAsObject(), te::layout::VisualizationArea::createPaper(), te::layout::Scene::redrawItems(), te::layout::Scene::redrawSelectionMap(), te::layout::PropertiesOutside::sendPropertyToSelectedItem(), and te::layout::PropertiesOutside::sendPropertyToSelectedItems().
|
virtualinherited |
Updated model state.
true | if refresh the current position, false otherwise |
Definition at line 78 of file ItemObserver.cpp.
References te::gm::Coord2D::x, and te::gm::Coord2D::y.
Referenced by te::layout::ItemController::contains(), te::layout::Scene::insertItem(), and te::layout::Scene::updateSelectedItemsPositions().
|
virtualinherited |
Change the state of the graphic component to be or not send to back or bring to front.
canChange | true if send to back or bring to front, false otherwise |
Definition at line 114 of file ItemObserver.cpp.
|
protectedinherited |
Definition at line 526 of file MapItem.cpp.
|
virtualinherited |
Reimplemented from te::layout::ParentItem< QGraphicsProxyWidget >.
Definition at line 332 of file MapItem.cpp.
|
virtualinherited |
Modifies the state of the graphic component to be or not printable.
true if printable, false otherwise |
Definition at line 89 of file ItemObserver.cpp.
|
virtualinherited |
|
inherited |
The Z value decides the stacking order of drawing.
drawing | order |
|
protectedvirtualinherited |
The Z value decides the stacking order of drawing.
drawing | order |
Definition at line 109 of file ItemObserver.cpp.
|
virtualinherited |
Reimplemented from ItemObserver.
Reimplemented from te::layout::ParentItem< QGraphicsProxyWidget >.
Definition at line 150 of file MapItem.cpp.
References te::common::Free(), te::color::RGBAColor::getAlpha(), te::color::RGBAColor::getBlue(), te::color::RGBAColor::getGreen(), te::gm::Envelope::getHeight(), te::qt::widgets::GetImage(), te::common::Singleton< Context >::getInstance(), te::layout::MapModel::getMapBackgroundColor(), te::layout::MapModel::getMapBox(), te::layout::ContextItem::getPixmap(), te::color::RGBAColor::getRed(), te::layout::ContextItem::getUtils(), te::gm::Envelope::getWidth(), te::layout::Context::getZoomFactor(), te::gm::Envelope::isValid(), and te::layout::Utils::viewportBox().
|
virtualinherited |
Reimplemented from ItemObserver.
Definition at line 652 of file MapItem.cpp.
References te::layout::AbstractProxyProject::contains(), te::common::Singleton< Context >::getInstance(), te::layout::MapModel::getNameLayer(), te::layout::Context::getProxyProject(), te::layout::MapModel::isLoadedLayer(), te::layout::MapController::refreshLayer(), and te::layout::MapModel::updateProperties().
|
protectedinherited |
box with resize
Definition at line 223 of file ParentItem.h.
|
protectedinherited |
Define if item can send to back or bring to front.
Definition at line 200 of file ItemObserver.h.
Referenced by te::layout::PaperItem::PaperItem().
|
protectedinherited |
|
protectedinherited |
Definition at line 224 of file ParentItem.h.
|
protectedinherited |
"Controller" part of MVC component.
Definition at line 197 of file ItemObserver.h.
|
protectedinherited |
Definition at line 229 of file ParentItem.h.
|
protectedinherited |
Definition at line 227 of file ParentItem.h.
|
protectedinherited |
|
protectedinherited |
Definition at line 200 of file MapItem.h.
Referenced by te::layout::MapItem::MapItem().
|
protectedinherited |
Definition at line 226 of file ParentItem.h.
|
protectedinherited |
true if inverted, false otherwise the matrix scene
Definition at line 202 of file ItemObserver.h.
Referenced by te::layout::BarCodeItem::BarCodeItem(), and te::layout::ParentItem< T >::ParentItem().
|
protectedinherited |
|
protectedinherited |
Definition at line 195 of file MapItem.h.
Referenced by te::layout::MapItem::MapItem(), and MapLocationItem().
|
protectedinherited |
|
protectedinherited |
The size of the map display in a zoom of 100%. This size is in pixels and is calculated based on the size of the GraphicItem in millimeters.
Definition at line 192 of file MapItem.h.
Referenced by te::layout::MapItem::MapItem().
|
protectedinherited |
"Model" part of MVC component.
Definition at line 198 of file ItemObserver.h.
Referenced by te::layout::BarCodeItem::BarCodeItem(), te::layout::ItemObserver::ItemObserver(), te::layout::MapItem::MapItem(), and te::layout::ParentItem< T >::ParentItem().
|
protectedinherited |
mouse and active alt key
Definition at line 225 of file ParentItem.h.
|
protectedinherited |
Class name.
Definition at line 201 of file ItemObserver.h.
Referenced by te::layout::ArrowItem::ArrowItem(), te::layout::BalloonItem::BalloonItem(), te::layout::BarCodeItem::BarCodeItem(), te::layout::EllipseItem::EllipseItem(), te::layout::GridGeodesicItem::GridGeodesicItem(), te::layout::GridMapItem::GridMapItem(), te::layout::GridPlanarItem::GridPlanarItem(), te::layout::ImageItem::ImageItem(), te::layout::ItemGroup::ItemGroup(), te::layout::LegendChildItem::LegendChildItem(), te::layout::LegendItem::LegendItem(), te::layout::LineItem::LineItem(), te::layout::MapItem::MapItem(), te::layout::NorthItem::NorthItem(), te::layout::PaperItem::PaperItem(), te::layout::PointItem::PointItem(), te::layout::PolygonItem::PolygonItem(), te::layout::RectangleItem::RectangleItem(), te::layout::ScaleItem::ScaleItem(), and te::layout::TextItem::TextItem().
|
protectedinherited |
Definition at line 219 of file ParentItem.h.
|
protectedinherited |
State of the graphic component to be or not printable.
Definition at line 199 of file ItemObserver.h.
|
protectedinherited |
Definition at line 220 of file ParentItem.h.
|
protectedinherited |
pixmap to perform the resize is already built
Definition at line 230 of file ParentItem.h.
|
protectedinherited |
|
protectedinherited |
pixmap to perform the resize is not yet built
Definition at line 228 of file ParentItem.h.
|
protectedinherited |
|
protectedinherited |
Definition at line 199 of file MapItem.h.
Referenced by te::layout::MapItem::MapItem().
|
protectedinherited |
Definition at line 202 of file MapItem.h.
Referenced by te::layout::MapItem::MapItem().