Class representing the view. This view is child of QGraphicsView, part of Graphics View Framework. The View object is a widget where the items in the scene are drawn. It is responsible for presentation and interaction between the screen events and the scene. Manages interactive functions and intercepts all mouse or keyboard events. The coordinate system of this representation is pixel and your point 0.0 is in the top left(Screen coordinate system). The default settings of the layout module are in the object Context (singleton). More...
#include <View.h>
Public Slots | |
virtual void | onChangeConfig () |
Notifies View object that some configuration was modified in the Page Settings Window. More... | |
virtual void | onMainMenuChangeContext (bool change) |
Notifies View object that some action on the Menu has been thrown. More... | |
virtual void | onSelectionChanged () |
Notifies View object that the selection of objects in the scene changed. More... | |
virtual void | onSelectionItem (std::string name) |
virtual void | onSystematicApply (double scale, SystematicScaleType type) |
virtual void | onToolbarChangeContext (bool change) |
Notifies View object that some action on the toolbar has been thrown. More... | |
Signals | |
void | changeContext () |
This signal is emitted when context change. More... | |
void | changeSceneCoordMouse (QPointF pos) |
This signal is emitted when the mouse move changed. More... | |
void | changeZoom (double currentFactor) |
This signal is emitted when View object changes the zoom factor internally. More... | |
void | closeView () |
This signal is emitted when close View object. More... | |
void | hideView () |
This signal is emitted when hide View object. More... | |
void | reloadProperties () |
This signal is emitted when selection change and mouse release. More... | |
void | showView () |
This signal is emitted when show View object. More... | |
Public Member Functions | |
virtual void | addZoomFactor (double factor, std::string text) |
Method that adds new zoom factor. Ex.: 0.5 - 50%. More... | |
virtual void | changeZoomFactor (double currentZoom) |
Method that change rulers visibility state. More... | |
virtual void | clearZoomFactors () |
Method that clears the zoom factor list. More... | |
virtual void | closeOutsideWindows () |
Close all windows that have been instantiated by this View. Ex .: Page Settings. More... | |
virtual void | config () |
Initialization method that configures the View and sets the transformation matrix of the scene in the View object. More... | |
virtual QImage | createImage () |
Create snapshot of the View current state. More... | |
virtual void | exportToPDF () |
Method that sets View object for the Print function. More... | |
virtual bool | isVisibleRulers () |
Method that return rulers visibility state. More... | |
virtual double | nextFactor (double currentFactor) |
Method that returns the next zoom factor in the list. More... | |
virtual void | pan () |
Method that sets View object for the Pan function. More... | |
virtual double | previousFactor (double currentFactor) |
Method that returns the previous zoom factor in the list. More... | |
virtual void | print () |
Method that sets View object for the Print function. More... | |
virtual void | recompose () |
Reset to initial configuration made in the config() method. Reset to default zoom factor. More... | |
virtual void | resetView () |
Reset to initial configuration made in the config() method. More... | |
virtual void | setVisibleRulers (bool visible) |
Method that change rulers visibility state. More... | |
View (QWidget *widget=(QWidget *) 0) | |
Constructor. More... | |
virtual void | zoomArea () |
Method that sets View object for the Zoom Area function. More... | |
virtual void | zoomOut () |
Method that sets View object for the Zoom Out function. More... | |
virtual void | zoomPercentage () |
Method that applies current zoom defined in the Context. More... | |
virtual | ~View () |
Destructor. More... | |
Protected Member Functions | |
virtual void | closeEvent (QCloseEvent *event) |
Reimplemented from QGraphicsView. More... | |
virtual void | contextMenuEvent (QContextMenuEvent *event) |
Reimplemented from QGraphicsView. More... | |
virtual QCursor | createCursor (std::string pathIcon) |
virtual void | createItemGroup () |
Groups selected objects. More... | |
virtual void | destroyItemGroup () |
Method that delete Grouping object selected, but the individual objects continue to exist. More... | |
virtual void | drawForeground (QPainter *painter, const QRectF &rect) |
Reimplemented from QGraphicsView. More... | |
virtual void | exportItemsToImage () |
Saves each item in the scene as image. Ex .: .png. More... | |
virtual bool | exportProperties (EnumType *type) |
Method that exports all the objects in the scene to a template. Ex.: JSON. More... | |
virtual void | hideEvent (QHideEvent *event) |
Reimplemented from QGraphicsView. More... | |
virtual bool | importTemplate (EnumType *type) |
Method that import a template and build all objects. Ex.: JSON. More... | |
virtual bool | isExceededLimit (double currentScale, double factor, double oldFactor) |
virtual void | keyPressEvent (QKeyEvent *keyEvent) |
Reimplemented from QGraphicsView. More... | |
virtual void | mouseMoveEvent (QMouseEvent *event) |
Reimplemented from QGraphicsView. More... | |
virtual void | mousePressEvent (QMouseEvent *event) |
Reimplemented from QGraphicsView. Call method createItem() of the scene. More... | |
virtual void | mouseReleaseEvent (QMouseEvent *event) |
Reimplemented from QGraphicsView. More... | |
virtual void | outsideAreaChangeContext (bool change) |
Responsible method for verifying changes made in Context outside the View object and call corresponding actions. Ex.: Action Pan called in toolbar changed Context to Pan mode, then View object call method to do it. More... | |
virtual void | resetDefaultConfig () |
virtual void | resizeEvent (QResizeEvent *event) |
Reimplemented from QGraphicsView. More... | |
virtual void | showEvent (QShowEvent *event) |
Reimplemented from QGraphicsView. More... | |
virtual void | showPageSetup () |
Method that instantiates and shows the Page Setup window. More... | |
virtual void | showSystematicScale () |
virtual void | wheelEvent (QWheelEvent *event) |
Reimplemented from QGraphicsView. More... | |
Protected Attributes | |
te::gm::Coord2D | m_coordSystematic |
AbstractViewTool * | m_currentTool |
bool | m_flag |
double | m_height |
HorizontalRuler * | m_horizontalRuler |
bool | m_isMoving |
double | m_maxZoomLimit |
MenuBuilder * | m_menuBuilder |
double | m_minZoomLimit |
te::layout::MovingItemGroup * | m_movingItemGroup |
EnumType * | m_oldMode |
PageSetupOutside * | m_pageSetupOutside |
bool | m_selectionChange |
SystematicScaleOutside * | m_systematicOutside |
bool | m_updateItemPos |
VerticalRuler * | m_verticalRuler |
bool | m_visibleRulers |
rulers visibility state More... | |
VisualizationArea * | m_visualizationArea |
WaitView * | m_wait |
double | m_width |
std::map< double, std::string > | m_zoomFactors |
zoom factor list More... | |
Class representing the view. This view is child of QGraphicsView, part of Graphics View Framework. The View object is a widget where the items in the scene are drawn. It is responsible for presentation and interaction between the screen events and the scene. Manages interactive functions and intercepts all mouse or keyboard events. The coordinate system of this representation is pixel and your point 0.0 is in the top left(Screen coordinate system). The default settings of the layout module are in the object Context (singleton).
te::layout::View::View | ( | QWidget * | widget = (QWidget*)0 | ) |
Constructor.
Definition at line 61 of file View.cpp.
References te::common::Singleton< Enums >::getInstance(), m_horizontalRuler, m_oldMode, m_verticalRuler, and m_wait.
|
virtualinherited |
Method that adds new zoom factor. Ex.: 0.5 - 50%.
factor | factor |
text | percentage |
Definition at line 53 of file AbstractView.cpp.
|
signal |
This signal is emitted when context change.
|
signal |
This signal is emitted when the mouse move changed.
pos | current position |
|
signal |
|
virtual |
Method that change rulers visibility state.
visible | visibility state |
Definition at line 1076 of file View.cpp.
References te::common::Singleton< Context >::getInstance(), te::layout::Context::getZoomFactor(), te::layout::Context::setOldZoomFactor(), and te::layout::Context::setZoomFactor().
|
virtualinherited |
Method that clears the zoom factor list.
Definition at line 58 of file AbstractView.cpp.
|
protectedvirtual |
|
virtual |
|
virtual |
Initialization method that configures the View and sets the transformation matrix of the scene in the View object.
Implements te::layout::AbstractView.
Definition at line 375 of file View.cpp.
References te::layout::Context::getDefaultZoomFactor(), te::common::Singleton< Context >::getInstance(), te::layout::AbstractScene::getSceneBox(), te::layout::Scene::init(), te::gm::Envelope::m_llx, te::gm::Envelope::m_ury, and te::layout::Scene::sceneTransform().
|
protectedvirtual |
Reimplemented from QGraphicsView.
Definition at line 742 of file View.cpp.
References te::common::Singleton< Context >::getInstance(), te::layout::Context::getItemUtils(), and te::layout::ItemUtils::intersectionSelectionItem().
|
protectedvirtual |
|
virtual |
Create snapshot of the View current state.
Definition at line 770 of file View.cpp.
References te::layout::AbstractScene::getSceneBox(), te::gm::Envelope::m_llx, te::gm::Envelope::m_lly, te::gm::Envelope::m_urx, and te::gm::Envelope::m_ury.
|
protectedvirtual |
Groups selected objects.
Definition at line 437 of file View.cpp.
References te::layout::Scene::createItemGroup(), and te::layout::ItemObserver::redraw().
|
protectedvirtual |
Method that delete Grouping object selected, but the individual objects continue to exist.
Definition at line 464 of file View.cpp.
References te::layout::Scene::destroyItemGroup().
|
protectedvirtual |
Reimplemented from QGraphicsView.
Definition at line 943 of file View.cpp.
References te::map::SolidLine.
|
protectedvirtual |
Saves each item in the scene as image. Ex .: .png.
Definition at line 1043 of file View.cpp.
References te::layout::Scene::exportItemsToImage().
|
protectedvirtual |
Method that exports all the objects in the scene to a template. Ex.: JSON.
type | type of template. Ex .: JSON type |
Definition at line 980 of file View.cpp.
References te::layout::Scene::exportPropertiesToTemplate().
|
virtual |
Method that sets View object for the Print function.
Definition at line 908 of file View.cpp.
References te::layout::PrintScene::exportToPDF(), and te::layout::Scene::getPrintScene().
|
protectedvirtual |
|
protectedvirtual |
Method that import a template and build all objects. Ex.: JSON.
Definition at line 1018 of file View.cpp.
References te::layout::Scene::buildTemplate().
|
protectedvirtual |
|
virtualinherited |
Method that return rulers visibility state.
Definition at line 43 of file AbstractView.cpp.
|
protectedvirtual |
Reimplemented from QGraphicsView.
Definition at line 326 of file View.cpp.
References te::layout::Enums::getEnumModeType(), te::common::Singleton< Enums >::getInstance(), te::common::Singleton< Context >::getInstance(), te::layout::EnumModeType::getModeNone(), te::layout::EnumModeType::getModePrinter(), te::layout::Scene::removeSelectedItems(), and te::layout::Context::setMode().
|
protectedvirtual |
Reimplemented from QGraphicsView.
Definition at line 210 of file View.cpp.
References te::common::Singleton< Context >::getInstance(), and te::layout::Context::getMode().
|
protectedvirtual |
Reimplemented from QGraphicsView. Call method createItem() of the scene.
Definition at line 125 of file View.cpp.
References EnumCreate, te::layout::Enums::getEnumModeType(), te::common::Singleton< Context >::getInstance(), te::common::Singleton< Enums >::getInstance(), te::layout::Context::getItem(), te::layout::Context::getMode(), te::layout::EnumModeType::getModeCoordWait(), te::layout::ItemObserver::getModel(), te::layout::EnumModeType::getModeNone(), te::layout::EnumType::getType(), te::layout::ItemObserver::isInvertedMatrix(), te::layout::LineModel::setCoords(), te::layout::Context::setItem(), and te::layout::Context::setWait().
|
protectedvirtual |
Reimplemented from QGraphicsView.
Definition at line 244 of file View.cpp.
References te::layout::Scene::destroyItemGroup(), te::layout::Scene::selectItems(), and te::layout::Scene::updateSelectedItemsPositions().
|
virtualinherited |
Method that returns the next zoom factor in the list.
currentFactor | current factor |
Definition at line 63 of file AbstractView.cpp.
|
virtualslot |
Notifies View object that some configuration was modified in the Page Settings Window.
Definition at line 692 of file View.cpp.
References te::layout::AbstractScene::getSceneBox(), and te::layout::Scene::reset().
|
virtualslot |
|
virtualslot |
|
virtualslot |
Definition at line 1094 of file View.cpp.
References te::layout::Scene::selectItem().
|
virtualslot |
|
virtualslot |
|
protectedvirtual |
Responsible method for verifying changes made in Context outside the View object and call corresponding actions. Ex.: Action Pan called in toolbar changed Context to Pan mode, then View object call method to do it.
Definition at line 509 of file View.cpp.
References te::layout::AlignItems::alignBottom(), te::layout::AlignItems::alignCenterHorizontal(), te::layout::AlignItems::alignCenterVertical(), te::layout::AlignItems::alignLeft(), te::layout::AlignItems::alignRight(), te::layout::AlignItems::alignTop(), te::layout::AlignItems::bringToFront(), te::layout::ItemUtils::createLegendChildAsObject(), te::layout::ItemUtils::createTextGridAsObject(), te::layout::ItemUtils::createTextMapAsObject(), te::layout::Scene::getAlignItems(), te::layout::Enums::getEnumModeType(), te::layout::Enums::getEnumTemplateType(), te::common::Singleton< Enums >::getInstance(), te::common::Singleton< Context >::getInstance(), te::layout::Context::getItemUtils(), te::layout::EnumTemplateType::getJsonType(), te::layout::Context::getMode(), te::layout::EnumModeType::getModeAlignBottom(), te::layout::EnumModeType::getModeAlignCenterHorizontal(), te::layout::EnumModeType::getModeAlignCenterVertical(), te::layout::EnumModeType::getModeAlignLeft(), te::layout::EnumModeType::getModeAlignRight(), te::layout::EnumModeType::getModeAlignTop(), te::layout::EnumModeType::getModeArrowCursor(), te::layout::EnumModeType::getModeBringToFront(), te::layout::EnumModeType::getModeDrawSelectionMap(), te::layout::EnumModeType::getModeExit(), te::layout::EnumModeType::getModeExportPropsJSON(), te::layout::EnumModeType::getModeExportToPDF(), te::layout::EnumModeType::getModeGroup(), te::layout::EnumModeType::getModeImportJSONProps(), te::layout::EnumModeType::getModeLegendChildAsObject(), te::layout::EnumModeType::getModeMapCreateTextGrid(), te::layout::EnumModeType::getModeMapCreateTextMap(), te::layout::EnumModeType::getModeMapPan(), te::layout::EnumModeType::getModeMapZoomIn(), te::layout::EnumModeType::getModeMapZoomOut(), te::layout::EnumModeType::getModeNewTemplate(), te::layout::EnumModeType::getModeObjectToImage(), te::layout::EnumModeType::getModePageConfig(), te::layout::EnumModeType::getModePan(), te::layout::EnumModeType::getModePrinter(), te::layout::EnumModeType::getModeRecompose(), te::layout::EnumModeType::getModeRemoveObject(), te::layout::EnumModeType::getModeSceneZoom(), te::layout::EnumModeType::getModeSendToBack(), te::layout::EnumModeType::getModeUngroup(), te::layout::EnumModeType::getModeUnitsMetricsChange(), te::layout::EnumModeType::getModeZoomIn(), te::layout::EnumModeType::getModeZoomOut(), te::layout::Scene::redrawSelectionMap(), te::layout::Scene::removeSelectedItems(), te::layout::Scene::reset(), te::layout::AlignItems::sendToBack(), and te::layout::ItemUtils::setCurrentToolInSelectedMapItems().
|
virtual |
|
virtualinherited |
Method that returns the previous zoom factor in the list.
currentFactor | current factor |
Definition at line 83 of file AbstractView.cpp.
|
virtual |
Method that sets View object for the Print function.
Definition at line 857 of file View.cpp.
References te::layout::Scene::getPrintScene(), and te::layout::PrintScene::printPreview().
|
virtual |
Reset to initial configuration made in the config() method. Reset to default zoom factor.
Definition at line 874 of file View.cpp.
References te::layout::Context::getDefaultZoomFactor(), and te::common::Singleton< Context >::getInstance().
|
signal |
This signal is emitted when selection change and mouse release.
|
protectedvirtual |
|
virtual |
Reset to initial configuration made in the config() method.
Definition at line 801 of file View.cpp.
References te::layout::Context::getDefaultZoomFactor(), te::common::Singleton< Context >::getInstance(), te::layout::AbstractScene::getSceneBox(), te::gm::Envelope::m_llx, te::gm::Envelope::m_ury, and te::layout::Scene::sceneTransform().
|
protectedvirtual |
|
virtualinherited |
Method that change rulers visibility state.
visible | visibility state |
Definition at line 48 of file AbstractView.cpp.
|
protectedvirtual |
|
protectedvirtual |
Method that instantiates and shows the Page Setup window.
Definition at line 677 of file View.cpp.
References te::layout::OutsideController::getView().
|
protectedvirtual |
Definition at line 710 of file View.cpp.
References te::layout::OutsideController::getView().
|
protectedvirtual |
Reimplemented from QGraphicsView.
Definition at line 287 of file View.cpp.
References te::common::Singleton< Context >::getInstance(), te::layout::Context::getZoomFactor(), te::layout::Context::setOldZoomFactor(), and te::layout::Context::setZoomFactor().
|
virtual |
|
virtual |
|
virtual |
Method that applies current zoom defined in the Context.
Definition at line 883 of file View.cpp.
References te::common::Singleton< Context >::getInstance(), te::layout::Context::getOldZoomFactor(), te::layout::Context::getZoomFactor(), and te::layout::Scene::sceneTransform().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protectedinherited |
rulers visibility state
Definition at line 111 of file AbstractView.h.
|
protected |
|
protected |
|
protectedinherited |
zoom factor list
Definition at line 112 of file AbstractView.h.
Referenced by te::layout::AbstractView::AbstractView().