Abstract class to represent an observer. "View" part of MVC component. All classes representing the graphics component must inherit from this class. More...
#include <ItemObserver.h>
Public Member Functions | |
virtual void | changeZoomFactor (double currentZoomFactor) |
It is called immediately by the Scene when the zoom factor is changed in the Context. More... | |
virtual ItemController * | getController () |
Returns the "Controller" part of the MVC. More... | |
virtual Observable * | getModel () |
Returns the "Model" part of the MVC. More... | |
virtual std::string | getNameClass () |
Method that returns the class name. More... | |
virtual te::gm::Coord2D | getPosition ()=0 |
Method that returns the position llx, lly Reimplement this function in a ItemObserver subclass to provide the item's getPosition implementation. More... | |
virtual te::color::RGBAColor ** | getRGBAColorImage (int &w, int &h)=0 |
Returns a image of the graphic component. Reimplement this function in a ItemObserver subclass to provide the item's getImage implementation. 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... | |
ItemObserver (ItemController *controller=0, Observable *o=0) | |
Constructor. More... | |
virtual void | recalculateBoundingRect () |
The default implementation does nothing. 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... | |
virtual void | setPrintable (bool print) |
Modifies the state of the graphic component to be or not printable. More... | |
virtual void | updateObserver (ContextItem context)=0 |
Reimplemented from Observer. More... | |
virtual | ~ItemObserver () |
Destructor. More... | |
Protected Member Functions | |
virtual void | applyRotation ()=0 |
Rotates the graphic component. Reimplement this function in a ItemObserver subclass to provide the item's applyImage implementation. More... | |
virtual int | getZValueItem ()=0 |
Return the Z value. Reimplement this function in a ItemObserver subclass to provide the item's getZValueItem implementation. More... | |
virtual void | setZValueItem (int z) |
The Z value decides the stacking order of drawing. More... | |
Protected Attributes | |
bool | m_canChangeGraphicOrder |
Define if item can send to back or bring to front. More... | |
te::layout::ItemController * | m_controller |
"Controller" part of MVC component. More... | |
bool | m_invertedMatrix |
true if inverted, false otherwise the matrix scene More... | |
te::layout::Observable * | m_model |
"Model" part of MVC component. More... | |
std::string | m_nameClass |
Class name. More... | |
bool | m_printable |
State of the graphic component to be or not printable. More... | |
Abstract class to represent an observer. "View" part of MVC component. All classes representing the graphics component must inherit from this class.
Definition at line 52 of file ItemObserver.h.
te::layout::ItemObserver::ItemObserver | ( | ItemController * | controller = 0 , |
Observable * | o = 0 |
||
) |
Constructor.
controller | "Controller" part of MVC component |
o | "Model" part of MVC component |
Definition at line 37 of file ItemObserver.cpp.
References te::layout::Observable::addObserver(), and m_model.
|
virtual |
Destructor.
Definition at line 48 of file ItemObserver.cpp.
|
protectedpure virtual |
Rotates the graphic component. Reimplement this function in a ItemObserver subclass to provide the item's applyImage implementation.
Implemented in te::layout::ParentItem< T >, te::layout::ParentItem< QGraphicsTextItem >, te::layout::ParentItem< QGraphicsObject >, te::layout::ParentItem< QGraphicsProxyWidget >, and te::layout::ItemGroup.
|
virtual |
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 in te::layout::MapItem.
Definition at line 134 of file ItemObserver.cpp.
Referenced by te::layout::Scene::onChangeZoomFactor().
|
virtual |
Returns the "Controller" part of the MVC.
Definition at line 99 of file ItemObserver.cpp.
|
virtual |
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().
|
virtual |
Method that returns the class name.
Definition at line 124 of file ItemObserver.cpp.
Referenced by te::layout::ObjectInspectorOutside::createProperty().
|
pure virtual |
Method that returns the position llx, lly Reimplement this function in a ItemObserver subclass to provide the item's getPosition implementation.
Implemented in te::layout::MapItem, te::layout::TextItem, te::layout::ParentItem< T >, te::layout::ParentItem< QGraphicsTextItem >, te::layout::ParentItem< QGraphicsObject >, te::layout::ParentItem< QGraphicsProxyWidget >, and te::layout::ItemGroup.
|
pure virtual |
Returns a image of the graphic component. Reimplement this function in a ItemObserver subclass to provide the item's getImage implementation.
image | width |
image | height |
Implemented in te::layout::ParentItem< T >, te::layout::ParentItem< QGraphicsTextItem >, te::layout::ParentItem< QGraphicsObject >, te::layout::ParentItem< QGraphicsProxyWidget >, te::layout::TextItem, te::layout::MapItem, and te::layout::ItemGroup.
Referenced by te::layout::Scene::exportItemsToImage().
|
protectedpure virtual |
Return the Z value. Reimplement this function in a ItemObserver subclass to provide the item's getZValueItem implementation.
Implemented in te::layout::ParentItem< T >, te::layout::ParentItem< QGraphicsTextItem >, te::layout::ParentItem< QGraphicsObject >, te::layout::ParentItem< QGraphicsProxyWidget >, and te::layout::ItemGroup.
|
virtual |
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().
|
virtual |
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().
|
virtual |
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().
|
virtual |
The default implementation does nothing.
Reimplemented in te::layout::MapItem, and te::layout::GridMapItem.
Definition at line 139 of file ItemObserver.cpp.
|
virtual |
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().
|
virtual |
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().
|
virtual |
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.
|
virtual |
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.
|
protectedvirtual |
The Z value decides the stacking order of drawing.
drawing | order |
Definition at line 109 of file ItemObserver.cpp.
|
pure virtual |
Reimplemented from Observer.
Implements te::layout::Observer.
Implemented in te::layout::ParentItem< T >, te::layout::ParentItem< QGraphicsTextItem >, te::layout::ParentItem< QGraphicsObject >, te::layout::ParentItem< QGraphicsProxyWidget >, te::layout::MapItem, te::layout::TextItem, te::layout::LegendItem, te::layout::ItemGroup, te::layout::TitleItem, and te::layout::LineItem.
|
protected |
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().
|
protected |
"Controller" part of MVC component.
Definition at line 197 of file ItemObserver.h.
|
protected |
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().
|
protected |
"Model" part of MVC component.
Definition at line 198 of file ItemObserver.h.
Referenced by te::layout::BarCodeItem::BarCodeItem(), ItemObserver(), te::layout::MapItem::MapItem(), and te::layout::ParentItem< T >::ParentItem().
|
protected |
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().
|
protected |
State of the graphic component to be or not printable.
Definition at line 199 of file ItemObserver.h.