te::layout::ItemUtils Class Reference

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...
 

Detailed Description

Utility class for manipulating items in the scene and vectorization of text and legend.

Definition at line 62 of file ItemUtils.h.

Constructor & Destructor Documentation

te::layout::ItemUtils::ItemUtils ( QGraphicsScene *  scene)

Constructor.

Definition at line 57 of file ItemUtils.cpp.

te::layout::ItemUtils::~ItemUtils ( )
virtual

Destructor.

Definition at line 63 of file ItemUtils.cpp.

Member Function Documentation

int te::layout::ItemUtils::countType ( te::layout::EnumType *  type)
virtual

Returns the number of items added to the scene with the type.

Parameters
typetype to search
Returns
number of items

Definition at line 150 of file ItemUtils.cpp.

References te::layout::ItemObserver::getModel(), and te::layout::Observable::getType().

void te::layout::ItemUtils::createLegendChildAsObject ( )
virtual
void te::layout::ItemUtils::createLegendChildItemFromLegend ( std::map< te::gm::Point *, std::string >  map,
MapModel *  visitable 
)
protectedvirtual
void te::layout::ItemUtils::createTextGridAsObject ( )
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().

void te::layout::ItemUtils::createTextMapAsObject ( )
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().

std::vector< te::layout::Properties * > te::layout::ItemUtils::getGridMapProperties ( )
virtual

Get properties of all GridMapItem, children of a MapItem.

Parameters

Definition at line 412 of file ItemUtils.cpp.

References te::layout::Properties::getProperties().

Referenced by te::layout::DialogPropertiesBrowser::onShowGridSettingsDlg().

QList< QGraphicsItem * > te::layout::ItemUtils::getItems ( bool  selected = false)
protectedvirtual

Returns the list of items added to a scene.

Parameters
selectedtrue if only selected items, false otherwise.
Returns
list of items

Definition at line 232 of file ItemUtils.cpp.

std::vector< te::layout::GridMapItem * > te::layout::ItemUtils::getMapChildren ( )
virtual

Get all GridMapItem, children of a MapItem.

Parameters

Definition at line 438 of file ItemUtils.cpp.

te::layout::MapItem * te::layout::ItemUtils::getMapItem ( std::string  name)
virtual
std::vector< te::layout::MapItem * > te::layout::ItemUtils::getMapItemList ( bool  selected = false)
virtual

MVC components list of type te::layout::MapItem.

Parameters
selectedtrue if only selected te::layout::MapItem, false otherwise.
Returns
MVC components list of type te::layout::MapItem

Definition at line 68 of file ItemUtils.cpp.

QGraphicsItem * te::layout::ItemUtils::intersectionSelectionItem ( int  x,
int  y 
)
virtual

Checks whether the coordinated intersects an item and returns.

Parameters
xaxis x coordinate
yaxis y coordinate
Returns

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().

std::vector< std::string > te::layout::ItemUtils::mapNameList ( bool  selected = false)
virtual

List of names te::layout::MapItem.

Parameters
selectedtrue if only selected te::layout::MapItem, false otherwise.
Returns
list of names

Definition at line 122 of file ItemUtils.cpp.

References te::layout::ItemObserver::getModel(), and te::layout::Observable::getName().

Referenced by te::layout::PropertiesUtils::mapNameDynamicProperty().

int te::layout::ItemUtils::maxTypeId ( te::layout::EnumType *  type)
virtual

Search max id for a type.

Parameters
typetype to search
Returns
max id

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().

void te::layout::ItemUtils::setCurrentToolInSelectedMapItems ( EnumType *  mode)
virtual

Member Data Documentation

QGraphicsScene* te::layout::ItemUtils::m_scene
protected

A pointer to scene.

Definition at line 199 of file ItemUtils.h.


The documentation for this class was generated from the following files: