Utility class for manipulating items in the scene and vectorization of text and legend. More...
#include <ItemUtils.h>
Public Member Functions | |
virtual int | countType (te::layout::EnumType *type) |
Returns the number of items added to the scene with the type. More... | |
virtual void | createLegendChildAsObject () |
Vectorizes selected LegendItem. (generates te::layout::TextItem objects) More... | |
virtual void | createTextGridAsObject () |
Vectorizes grid text of selected MapItem. (generates te::layout::TextItem objects) More... | |
virtual void | createTextMapAsObject () |
Vectorizes inside text of selected MapItem. (generates te::layout::TextItem objects) More... | |
virtual std::vector< Properties * > | getGridMapProperties () |
Get properties of all GridMapItem, children of a MapItem. More... | |
virtual std::vector< GridMapItem * > | getMapChildren () |
Get all GridMapItem, children of a MapItem. More... | |
virtual MapItem * | getMapItem (std::string name) |
Search for te::layout::MapItem by name. More... | |
virtual std::vector< MapItem * > | getMapItemList (bool selected=false) |
MVC components list of type te::layout::MapItem. More... | |
virtual QGraphicsItem * | intersectionSelectionItem (int x, int y) |
Checks whether the coordinated intersects an item and returns. More... | |
virtual bool | isCurrentMapTools () |
Indicates whether there is a tool active for object te::layout::MapItem. More... | |
ItemUtils (QGraphicsScene *scene) | |
Constructor. More... | |
virtual std::vector< std::string > | mapNameList (bool selected=false) |
List of names te::layout::MapItem. More... | |
virtual int | maxTypeId (te::layout::EnumType *type) |
Search max id for a type. More... | |
virtual void | setCurrentToolInSelectedMapItems (EnumType *mode) |
Changes the active tool of te::layout::MapItem. More... | |
virtual | ~ItemUtils () |
Destructor. More... | |
Protected Member Functions | |
virtual void | createLegendChildItemFromLegend (std::map< te::gm::Point *, std::string > map, MapModel *visitable) |
Vectorizes grid text of selected MapItem. (generates te::layout::TextItem objects) More... | |
virtual void | createTextItemFromObject (std::map< te::gm::Point *, std::string > map, QFont *ft=0) |
Vectorizes grid text of selected MapItem. (generates te::layout::TextItem objects) More... | |
virtual QList< QGraphicsItem * > | getItems (bool selected=false) |
Returns the list of items added to a scene. More... | |
Protected Attributes | |
QGraphicsScene * | m_scene |
A pointer to scene. More... | |
Utility class for manipulating items in the scene and vectorization of text and legend.
Definition at line 62 of file ItemUtils.h.
te::layout::ItemUtils::ItemUtils | ( | QGraphicsScene * | scene | ) |
Constructor.
Definition at line 57 of file ItemUtils.cpp.
|
virtual |
Destructor.
Definition at line 63 of file ItemUtils.cpp.
|
virtual |
Returns the number of items added to the scene with the type.
type | type to search |
Definition at line 150 of file ItemUtils.cpp.
References te::layout::ItemObserver::getModel(), and te::layout::Observable::getType().
|
virtual |
Vectorizes selected LegendItem. (generates te::layout::TextItem objects)
Definition at line 303 of file ItemUtils.cpp.
References te::layout::LegendModel::getCoordChildren(), te::layout::ItemObserver::getModel(), te::layout::AbstractVisitor::getVisitable(), and te::layout::ItemObserver::redraw().
Referenced by te::layout::View::outsideAreaChangeContext().
|
protectedvirtual |
Vectorizes grid text of selected MapItem. (generates te::layout::TextItem objects)
map | coordinate and text |
visitable | MapItem model associated |
Definition at line 373 of file ItemUtils.cpp.
References te::layout::Scene::createItem(), te::layout::Enums::getEnumModeType(), te::common::Singleton< Enums >::getInstance(), te::common::Singleton< T >::getInstance(), te::common::Singleton< Context >::getInstance(), te::layout::EnumModeType::getModeCreateLegendChild(), te::layout::EnumModeType::getModeNone(), te::gm::Point::getX(), te::gm::Point::getY(), and te::layout::Context::setMode().
|
virtual |
Vectorizes grid text of selected MapItem. (generates te::layout::TextItem objects)
Definition at line 279 of file ItemUtils.cpp.
Referenced by te::layout::View::outsideAreaChangeContext().
|
protectedvirtual |
Vectorizes grid text of selected MapItem. (generates te::layout::TextItem objects)
map | coordinate and text |
ft | font |
Definition at line 325 of file ItemUtils.cpp.
References te::layout::Scene::createItem(), te::layout::Enums::getEnumModeType(), te::layout::TextModel::getFont(), te::common::Singleton< Enums >::getInstance(), te::common::Singleton< Context >::getInstance(), te::layout::EnumModeType::getModeCreateText(), te::layout::ItemObserver::getModel(), te::layout::EnumModeType::getModeNone(), te::gm::Point::getX(), te::gm::Point::getY(), te::layout::Font::setFamily(), te::layout::TextModel::setFont(), te::layout::Context::setMode(), te::layout::Font::setPointSize(), and te::layout::TextModel::setText().
|
virtual |
Vectorizes inside text of selected MapItem. (generates te::layout::TextItem objects)
Definition at line 284 of file ItemUtils.cpp.
References te::layout::ItemObserver::getModel(), and te::layout::MapModel::getTextMapAsObjectInfo().
Referenced by te::layout::View::outsideAreaChangeContext().
|
virtual |
Get properties of all GridMapItem, children of a MapItem.
Definition at line 412 of file ItemUtils.cpp.
References te::layout::Properties::getProperties().
Referenced by te::layout::DialogPropertiesBrowser::onShowGridSettingsDlg().
|
protectedvirtual |
Returns the list of items added to a scene.
selected | true if only selected items, false otherwise. |
Definition at line 232 of file ItemUtils.cpp.
|
virtual |
Get all GridMapItem, children of a MapItem.
Definition at line 438 of file ItemUtils.cpp.
|
virtual |
Search for te::layout::MapItem by name.
name | of te::layout::MapItem |
Definition at line 92 of file ItemUtils.cpp.
References te::layout::ItemObserver::getModel(), and te::layout::Observable::getName().
Referenced by te::layout::PropertiesOutside::changeMapVisitable(), and te::layout::PropertiesOutside::getMapModel().
|
virtual |
MVC components list of type te::layout::MapItem.
selected | true if only selected te::layout::MapItem, false otherwise. |
Definition at line 68 of file ItemUtils.cpp.
|
virtual |
Checks whether the coordinated intersects an item and returns.
x | axis x coordinate |
y | axis y coordinate |
Definition at line 472 of file ItemUtils.cpp.
References te::common::Singleton< Context >::getInstance(), and te::layout::Context::getScene().
Referenced by te::layout::BuildGraphicsItem::addChild(), and te::layout::View::contextMenuEvent().
|
virtual |
Indicates whether there is a tool active for object te::layout::MapItem.
Definition at line 210 of file ItemUtils.cpp.
References te::layout::Enums::getEnumModeType(), te::common::Singleton< Context >::getInstance(), te::common::Singleton< Enums >::getInstance(), te::layout::Context::getMode(), te::layout::EnumModeType::getModeMapPan(), te::layout::EnumModeType::getModeMapZoomIn(), and te::layout::EnumModeType::getModeMapZoomOut().
Referenced by te::layout::MapItem::mouseMoveEvent(), te::layout::MapItem::mousePressEvent(), and te::layout::MapItem::mouseReleaseEvent().
|
virtual |
List of names te::layout::MapItem.
selected | true if only selected te::layout::MapItem, false otherwise. |
Definition at line 122 of file ItemUtils.cpp.
References te::layout::ItemObserver::getModel(), and te::layout::Observable::getName().
Referenced by te::layout::PropertiesUtils::mapNameDynamicProperty().
|
virtual |
Search max id for a type.
type | type to search |
Definition at line 173 of file ItemUtils.cpp.
References te::layout::ItemModelObservable::getId(), te::layout::ItemObserver::getModel(), and te::layout::Observable::getType().
Referenced by te::layout::BuildGraphicsItem::nameItem().
|
virtual |
Changes the active tool of te::layout::MapItem.
type | of tool |
Definition at line 248 of file ItemUtils.cpp.
References te::layout::MapItem::changeCurrentTool(), te::layout::Enums::getEnumModeType(), te::common::Singleton< Enums >::getInstance(), and te::layout::EnumModeType::getModeNone().
Referenced by te::layout::View::outsideAreaChangeContext().
|
protected |
A pointer to scene.
Definition at line 199 of file ItemUtils.h.