All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::layout::BuildGraphicsItem Class Reference

Class responsible for creating or building graphics objects. All objects are children of QGraphicsItem and ItemObserver. An object of a type is created from a coordinated. Also an object of a type can be built from the properties saved in a template. Only place where the model and the controller is instantiated and the MVC component is created. More...

#include <BuildGraphicsItem.h>

Inheritance diagram for te::layout::BuildGraphicsItem:
te::layout::AbstractBuildGraphicsItem

Signals

void addChildFinalized (QGraphicsItem *parent, QGraphicsItem *child)
 

Public Member Functions

virtual bool addChild (QGraphicsItem *child, int x, int y)
 Checks whether the coordinated intersects an item and adds a child. Checks ItemModelObservable::isEnableChildren(). More...
 
 BuildGraphicsItem ()
 Constructor. More...
 
virtual void clear ()
 Clear all configuration for create or build a graphic object. More...
 
QGraphicsItem * createItem (te::layout::EnumType *mode, const te::gm::Coord2D &coordinate, bool draw=true)
 Method to create a graphic object from the properties. More...
 
QGraphicsItem * createItem (te::layout::EnumType *type, bool draw=true)
 Method to create a graphic object from the type. More...
 
QGraphicsItem * rebuildItem (te::layout::Properties *props, bool draw=true)
 Method to build a graphics object from the properties. More...
 
virtual ~BuildGraphicsItem ()
 Destructor. More...
 

Protected Member Functions

virtual void afterBuild (QGraphicsItem *item, bool draw=true)
 After component construction, this method checks and adds a child, position and zValue. If necessary, also redraws. More...
 
QGraphicsItem * createArrow ()
 Create graphic object of type ArrowItem. More...
 
QGraphicsItem * createBalloon ()
 Create graphic object of type Balloon. More...
 
QGraphicsItem * createBarCode ()
 Create graphic object of type BarCode. More...
 
QGraphicsItem * createEllipse ()
 Create graphic object of type EllipseItem. More...
 
QGraphicsItem * createGridGeodesic ()
 Create graphic object of type GridGeodesicItem. More...
 
QGraphicsItem * createGridMap ()
 Create graphic object of type GridMapItem. More...
 
QGraphicsItem * createGridPlanar ()
 Create graphic object of type GridPlanarItem. More...
 
QGraphicsItem * createImage ()
 Create graphic object of type ImageItem. More...
 
QGraphicsItem * createItemGroup ()
 Create graphic object of type ItemGroup. More...
 
QGraphicsItem * createLegend ()
 Create graphic object of type LegendItem. More...
 
QGraphicsItem * createLegendChild ()
 Create graphic object of type LegendChildItem. More...
 
QGraphicsItem * createLine ()
 Create graphic object of type LineItem. More...
 
QGraphicsItem * createMap ()
 Create graphic object of type MapItem. More...
 
QGraphicsItem * createMapLocation ()
 Create graphic object of type MapLocationItem. More...
 
QGraphicsItem * createMovingItemGroup ()
 Create graphic object of type MovingItemGroup. More...
 
QGraphicsItem * createNorth ()
 Create graphic object of type NorthItem. More...
 
QGraphicsItem * createPaper ()
 Create graphic object of type PaperItem. More...
 
QGraphicsItem * createPoint ()
 Create graphic object of type PointItem. More...
 
QGraphicsItem * createPolygon ()
 Create graphic object of type PolygonItem. More...
 
QGraphicsItem * createRectangle ()
 Create graphic object of type RectangleItem. More...
 
QGraphicsItem * createScale ()
 Create graphic object of type ScaleItem. More...
 
QGraphicsItem * createText ()
 Create graphic object of type TextItem. More...
 
QGraphicsItem * createTextGrid ()
 Create graphic object of type TextGridItem. More...
 
QGraphicsItem * createTitle ()
 Create graphic object of type TitleItem. More...
 
virtual te::gm::Coord2D findCoordinate (te::layout::Properties *props)
 Search for property of a graphic object that represent the x,y coordinate. More...
 
virtual int findZValue (te::layout::Properties *props)
 Search for property of a graphic object that represent Z Value. More...
 
std::string nameItem (te::layout::EnumType *type)
 Creates the name of the new graphic object. Adds the number that corresponds to how many objects of this type have already been created. More...
 

Protected Attributes

te::gm::Coord2D m_coord
 Coordinate of a graphic object. More...
 
int m_id
 Id of a graphic object. More...
 
te::layout::Propertiesm_props
 Properties of a graphic object. More...
 
SharedPropertiesm_sharedProps
 Default properties of all graphics objects. More...
 
int m_zValue
 Z Value of a graphic object. More...
 

Detailed Description

Class responsible for creating or building graphics objects. All objects are children of QGraphicsItem and ItemObserver. An object of a type is created from a coordinated. Also an object of a type can be built from the properties saved in a template. Only place where the model and the controller is instantiated and the MVC component is created.

See also
te::layout::AbstractBuildGraphicsItem

Definition at line 57 of file BuildGraphicsItem.h.

Constructor & Destructor Documentation

te::layout::BuildGraphicsItem::BuildGraphicsItem ( )

Constructor.

Definition at line 116 of file BuildGraphicsItem.cpp.

te::layout::BuildGraphicsItem::~BuildGraphicsItem ( )
virtual

Destructor.

Definition at line 121 of file BuildGraphicsItem.cpp.

Member Function Documentation

bool te::layout::BuildGraphicsItem::addChild ( QGraphicsItem *  child,
int  x,
int  y 
)
virtual
void te::layout::BuildGraphicsItem::addChildFinalized ( QGraphicsItem *  parent,
QGraphicsItem *  child 
)
signal
void te::layout::BuildGraphicsItem::afterBuild ( QGraphicsItem *  item,
bool  draw = true 
)
protectedvirtual

After component construction, this method checks and adds a child, position and zValue. If necessary, also redraws.

Parameters
itembuilt item
drawif true the component will be redraw, false otherwise

Definition at line 452 of file BuildGraphicsItem.cpp.

References te::layout::ItemObserver::redraw().

void te::layout::AbstractBuildGraphicsItem::clear ( )
virtualinherited

Clear all configuration for create or build a graphic object.

Definition at line 91 of file AbstractBuildGraphicsItem.cpp.

QGraphicsItem * te::layout::BuildGraphicsItem::createItem ( te::layout::EnumType mode,
const te::gm::Coord2D coordinate,
bool  draw = true 
)

Method to create a graphic object from the properties.

Parameters
modetype of the object will created
coordinaterepresent the x,y coordinate
drawgraphics object has or not to be drawing
Returns
z value

Definition at line 148 of file BuildGraphicsItem.cpp.

References te::layout::EnumObjectType::getArrowItem(), te::layout::EnumObjectType::getBalloonItem(), te::layout::EnumObjectType::getBarCodeItem(), te::layout::EnumObjectType::getEllipseItem(), te::layout::Enums::getEnumModeType(), te::layout::Enums::getEnumObjectType(), te::layout::EnumObjectType::getGridGeodesicItem(), te::layout::EnumObjectType::getGridMapItem(), te::layout::EnumObjectType::getGridPlanarItem(), te::layout::EnumObjectType::getImageItem(), te::common::Singleton< Enums >::getInstance(), te::layout::EnumObjectType::getItemGroup(), te::layout::EnumObjectType::getLegendChildItem(), te::layout::EnumObjectType::getLegendItem(), te::layout::EnumObjectType::getLineItem(), te::layout::EnumObjectType::getMapItem(), te::layout::EnumObjectType::getMapLocationItem(), te::layout::EnumModeType::getModeCreateArrow(), te::layout::EnumModeType::getModeCreateBalloon(), te::layout::EnumModeType::getModeCreateBarCode(), te::layout::EnumModeType::getModeCreateEllipse(), te::layout::EnumModeType::getModeCreateGridGeodesic(), te::layout::EnumModeType::getModeCreateGridMap(), te::layout::EnumModeType::getModeCreateGridPlanar(), te::layout::EnumModeType::getModeCreateImage(), te::layout::EnumModeType::getModeCreateItemGroup(), te::layout::EnumModeType::getModeCreateLegend(), te::layout::EnumModeType::getModeCreateLegendChild(), te::layout::EnumModeType::getModeCreateLine(), te::layout::EnumModeType::getModeCreateMap(), te::layout::EnumModeType::getModeCreateMapLocation(), te::layout::EnumModeType::getModeCreateNorth(), te::layout::EnumModeType::getModeCreatePoint(), te::layout::EnumModeType::getModeCreatePolygon(), te::layout::EnumModeType::getModeCreateRectangle(), te::layout::EnumModeType::getModeCreateScale(), te::layout::EnumModeType::getModeCreateText(), te::layout::EnumModeType::getModeCreateTextGrid(), te::layout::EnumModeType::getModeCreateTitle(), te::layout::EnumObjectType::getNorthItem(), te::layout::EnumObjectType::getPointItem(), te::layout::EnumObjectType::getPolygonItem(), te::layout::EnumObjectType::getRectangleItem(), te::layout::EnumObjectType::getScaleItem(), te::layout::EnumObjectType::getTextGridItem(), te::layout::EnumObjectType::getTextItem(), and te::layout::EnumObjectType::getTitleItem().

Referenced by te::layout::Scene::createItem(), te::layout::Scene::createItemGroup(), and te::layout::Scene::createMovingItemGroup().

te::gm::Coord2D te::layout::AbstractBuildGraphicsItem::findCoordinate ( te::layout::Properties props)
protectedvirtualinherited

Search for property of a graphic object that represent the x,y coordinate.

Parameters
propsproperties
Returns
coordinate

Definition at line 52 of file AbstractBuildGraphicsItem.cpp.

References te::layout::Properties::contains(), te::layout::Property::getValue(), te::layout::Property::isNull(), and te::layout::Variant::toDouble().

int te::layout::AbstractBuildGraphicsItem::findZValue ( te::layout::Properties props)
protectedvirtualinherited

Search for property of a graphic object that represent Z Value.

Parameters
propsproperties
Returns
z value

Definition at line 77 of file AbstractBuildGraphicsItem.cpp.

References te::layout::Properties::contains(), te::layout::Property::getValue(), te::layout::Property::isNull(), and te::layout::Variant::toInt().

std::string te::layout::BuildGraphicsItem::nameItem ( te::layout::EnumType type)
protectedvirtual

Creates the name of the new graphic object. Adds the number that corresponds to how many objects of this type have already been created.

Parameters
nameof the class type of the graphic object
typeof the object
Returns
name

Implements te::layout::AbstractBuildGraphicsItem.

Definition at line 358 of file BuildGraphicsItem.cpp.

References te::common::Singleton< Context >::getInstance(), te::layout::Context::getItemUtils(), te::layout::EnumType::getName(), te::layout::Context::getScene(), and te::layout::ItemUtils::maxTypeId().

QGraphicsItem * te::layout::BuildGraphicsItem::rebuildItem ( te::layout::Properties props,
bool  draw = true 
)

Method to build a graphics object from the properties.

Parameters
propsproperties
drawgraphics object has or not to be drawing
Returns
z value

Definition at line 126 of file BuildGraphicsItem.cpp.

References te::layout::Enums::getEnumObjectType(), te::common::Singleton< Enums >::getInstance(), and te::layout::Properties::getTypeObj().

Referenced by te::layout::Scene::buildTemplate().

Member Data Documentation

te::gm::Coord2D te::layout::AbstractBuildGraphicsItem::m_coord
protectedinherited

Coordinate of a graphic object.

Definition at line 108 of file AbstractBuildGraphicsItem.h.

int te::layout::AbstractBuildGraphicsItem::m_id
protectedinherited

Id of a graphic object.

Definition at line 110 of file AbstractBuildGraphicsItem.h.

te::layout::Properties* te::layout::AbstractBuildGraphicsItem::m_props
protectedinherited

Properties of a graphic object.

Definition at line 107 of file AbstractBuildGraphicsItem.h.

SharedProperties* te::layout::AbstractBuildGraphicsItem::m_sharedProps
protectedinherited

Default properties of all graphics objects.

Definition at line 106 of file AbstractBuildGraphicsItem.h.

Referenced by te::layout::AbstractBuildGraphicsItem::AbstractBuildGraphicsItem().

int te::layout::AbstractBuildGraphicsItem::m_zValue
protectedinherited

Z Value of a graphic object.

Definition at line 109 of file AbstractBuildGraphicsItem.h.


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