32 #include "../../core/pattern/singleton/Context.h"
33 #include "../../core/property/SharedProperties.h"
34 #include "../../item/RectangleModel.h"
35 #include "../../item/RectangleController.h"
36 #include "../item/RectangleItem.h"
37 #include "../../item/MapModel.h"
38 #include "../../item/MapController.h"
39 #include "../item/MapItem.h"
40 #include "../../item/LegendModel.h"
41 #include "../../item/LegendController.h"
42 #include "../item/LegendItem.h"
43 #include "../../item/PaperModel.h"
44 #include "../../item/PaperController.h"
45 #include "../item/PaperItem.h"
46 #include "../../item/ScaleModel.h"
47 #include "../../item/ScaleController.h"
48 #include "../item/ScaleItem.h"
49 #include "../../item/ItemGroupModel.h"
50 #include "../../item/ItemGroupController.h"
51 #include "../item/ItemGroup.h"
52 #include "../../item/ImageModel.h"
53 #include "../../item/ImageController.h"
54 #include "../item/ImageItem.h"
55 #include "../../item/ArrowModel.h"
56 #include "../../item/ArrowController.h"
57 #include "../item/ArrowItem.h"
58 #include "../../item/EllipseModel.h"
59 #include "../../item/EllipseController.h"
60 #include "../item/EllipseItem.h"
61 #include "../../item/PointModel.h"
62 #include "../../item/PointController.h"
63 #include "../item/PointItem.h"
64 #include "../../item/TitleModel.h"
65 #include "../../item/TitleController.h"
66 #include "../item/TitleItem.h"
67 #include "../../item/TextGridModel.h"
68 #include "../../item/TextGridController.h"
69 #include "../item/TextGridItem.h"
70 #include "../../core/enum/Enums.h"
71 #include "../../item/LegendChildModel.h"
72 #include "../../item/LegendChildController.h"
73 #include "../item/LegendChildItem.h"
74 #include "../../item/TextController.h"
75 #include "../item/TextItem.h"
76 #include "../../item/TextModel.h"
77 #include "../../core/property/Properties.h"
78 #include "../item/MovingItemGroup.h"
79 #include "../../item/MovingItemGroupController.h"
80 #include "../../item/MovingItemGroupModel.h"
81 #include "../../item/LineModel.h"
82 #include "../../item/LineController.h"
83 #include "../item/LineItem.h"
84 #include "../../item/PolygonModel.h"
85 #include "../../item/PolygonController.h"
86 #include "../item/PolygonItem.h"
87 #include "../../item/BalloonModel.h"
88 #include "../../item/BalloonController.h"
89 #include "../item/BalloonItem.h"
90 #include "../../item/BarCodeModel.h"
91 #include "../../item/BarCodeController.h"
92 #include "../item/BarCodeItem.h"
93 #include "../../item/GridMapModel.h"
94 #include "../../item/GridMapController.h"
95 #include "../item/GridMapItem.h"
96 #include "../../item/GridPlanarModel.h"
97 #include "../../item/GridPlanarController.h"
98 #include "../item/GridPlanarItem.h"
99 #include "../../item/GridGeodesicModel.h"
100 #include "../../item/GridGeodesicController.h"
101 #include "../item/GridGeodesicItem.h"
102 #include "../../item/NorthModel.h"
103 #include "../../item/NorthController.h"
104 #include "../item/NorthItem.h"
105 #include "../../item/MapLocationModel.h"
106 #include "../../item/MapLocationController.h"
107 #include "../item/MapLocationItem.h"
110 #include <QGraphicsItem>
128 QGraphicsItem* item = 0;
136 m_coord = findCoordinate(props);
137 m_zValue = findZValue(props);
143 item = createItem(type, draw);
150 QGraphicsItem* item = 0;
152 m_coord = coordinate;
160 item = createItem(enumObj->
getMapItem(), draw);
252 QGraphicsItem* item = 0;
258 item = createMovingItemGroup();
266 item = createGridMap();
274 item = createImage();
278 item = createRectangle();
282 item = createLegend();
286 item = createPaper();
290 item = createScale();
294 item = createItemGroup();
298 item = createArrow();
302 item = createEllipse();
306 item = createPoint();
310 item = createTextGrid();
314 item = createTitle();
318 item = createLegendChild();
326 item = createPolygon();
330 item = createBalloon();
334 item = createBarCode();
338 item = createGridPlanar();
342 item = createGridGeodesic();
346 item = createNorth();
350 item = createMapLocation();
353 afterBuild(item, draw);
360 std::string name =
"";
364 QList<QGraphicsItem*> graphicsItems;
365 std::stringstream ss;
372 graphicsItems = sc->items();
421 if(!parentItem->isSelected())
442 child->setParentItem(parentItem);
447 emit addChildFinalized(parentItem, child);
459 bool result = addChild(item, m_coord.x, m_coord.y);
462 item->setPos(QPointF(m_coord.x, m_coord.y));
467 item->setZValue(m_zValue);
508 std::string name = nameItem(enumObj->
getMapItem());
554 std::string name = nameItem(enumObj->
getTextItem());
857 std::string name = nameItem(enumObj->
getLineItem());
virtual void updateProperties(te::layout::Properties *properties)
Reimplemented from ItemModelObservable.
virtual EnumType * getLineItem() const
Returns value that represents line (MVC Component) type belonging to enumeration. ...
Class that represents a "Controller" part of Arrow MVC component. Its coordinate system is the same o...
QGraphicsItem * createItemGroup()
Create graphic object of type ItemGroup.
virtual EnumType * getModeCreateTextGrid() const
Returns value that represents create text grid mode type belonging to enumeration.
virtual EnumType * getEllipseItem() const
Returns value that represents ellipse (MVC Component) type belonging to enumeration.
BuildGraphicsItem()
Constructor.
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.
Class to represent a graphic object (MVC component) and widget object (MVC widget) type enumeration...
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 t...
Class that represents a "Controller" part of Legend MVC component. Its coordinate system is the same ...
Class that represents a "Model" part of Paper MVC component. Its coordinate system is the same of sce...
Class that represents a "Model" part of Legend MVC component. Its coordinate system is the same of sc...
Class that represents a "Model" part of GridMap MVC component. Its coordinate system is the same of s...
Class that represents a graphic sheet of paper. Its coordinate system is the same of scene (millimete...
std::string getName()
Returns name.
QGraphicsItem * createLegendChild()
Create graphic object of type LegendChildItem.
virtual EnumModeType * getEnumModeType()
Returns mode type enumeration.
virtual EnumType * getTitleItem() const
Returns value that represents title (MVC Component) type belonging to enumeration.
Class that represents the grouping of objects of type QGraphicsItem, MVC components. Its coordinate system is the same of scene (millimeters). He is also the son of ItemObserver and ObjectItem, so it can become observer of a model (Observable).
QGraphicsItem * createMapLocation()
Create graphic object of type MapLocationItem.
virtual EnumType * getMapLocationItem() const
Returns value that represents map location (MVC Component) type belonging to enumeration.
virtual EnumType * getModeCreateRectangle() const
Returns value that represents create rectangle mode type belonging to enumeration.
virtual EnumType * getModeCreateText() const
Returns value that represents create text mode type belonging to enumeration.
virtual ~BuildGraphicsItem()
Destructor.
virtual EnumType * getPaperItem() const
Returns value that represents paper (MVC Component) type belonging to enumeration.
Class that represents a "Controller" part of Rectangle MVC component. Its coordinate system is the sa...
QGraphicsItem * createLine()
Create graphic object of type LineItem.
const Observer * getView()
Returns the "View" part of the MVC component.
virtual void updateProperties(te::layout::Properties *properties)
Reimplemented from Observable.
virtual void updateProperties(te::layout::Properties *properties)
Reimplemented from Observable.
virtual void updateProperties(te::layout::Properties *properties)
Reimplemented from Observable.
virtual EnumType * getGridGeodesicItem() const
Returns value that represents grid geodesic type belonging to enumeration.
Class that represents a graphic Arrow. Its coordinate system is the same of scene (millimeters)...
Utility class for manipulating items in the scene and vectorization of text and legend.
virtual EnumType * getModeCreateLegendChild() const
Returns value that represents create legend child mode type belonging to enumeration.
Abstract class to represent an observable. "Model" part of MVC component. All classes representing th...
Class representing the scene. This scene is child of QGraphicsScene, part of Graphics View Framework...
virtual EnumType * getBarCodeItem() const
Returns value that represents barcode (MVC Component) type belonging to enumeration.
Class that represents a graphic Point. Its coordinate system is the same of scene (millimeters)...
virtual EnumType * getNorthItem() const
Returns value that represents north (MVC Component) type belonging to enumeration.
The Properties class represents a persistent set of properties. The Properties can be saved to a file...
Abstract class to represent an observer. "View" part of MVC component. All classes representing the g...
An utility struct for representing 2D coordinates.
QGraphicsItem * createText()
Create graphic object of type TextItem.
QGraphicsItem * createItem(te::layout::EnumType *mode, const te::gm::Coord2D &coordinate, bool draw=true)
Method to create a graphic object from the properties.
QGraphicsItem * createScale()
Create graphic object of type ScaleItem.
virtual EnumObjectType * getEnumObjectType()
Returns graphic object (MVC component) and widget object (MVC widget) type enumeration.
Class that represents a "Model" part of TextGrid MVC component. Its coordinate system is the same of ...
Class that represents a "Controller" part of Paper MVC component. Its coordinate system is the same o...
virtual void updateProperties(te::layout::Properties *properties)
Reimplemented from Observable.
Class that represents a "Model" part of ItemGroup MVC component. Its coordinate system is the same of...
virtual EnumType * getPointItem() const
Returns value that represents point (MVC Component) type belonging to enumeration.
Class that represents a "Controller" part of Rectangle MVC component. Its coordinate system is the sa...
Class that represents a "Model" part of Text MVC component. Its coordinate system is the same of scen...
QGraphicsItem * createArrow()
Create graphic object of type ArrowItem.
virtual void redraw(bool bRefresh=true)
Redraws the graphic component.
QGraphicsItem * createBarCode()
Create graphic object of type BarCode.
virtual void updateProperties(te::layout::Properties *properties)
Reimplemented from Observable.
Class daughter of te::layout::TitleItem representing a grid with cells which can be inserted texts...
Class that represents a "Controller" part of Image MVC component. Its coordinate system is the same o...
virtual EnumType * getModeCreateLegend() const
Returns value that represents create legend mode type belonging to enumeration.
virtual void updateProperties(te::layout::Properties *properties)
Reimplemented from Observable.
virtual EnumType * getGridPlanarItem() const
Returns value that represents grid planar type belonging to enumeration.
Class that represents a graphic legend of a map. Its coordinate system is the same of scene (millimet...
virtual EnumType * getModeCreateItemGroup() const
Returns value that represents create item group mode type belonging to enumeration.
virtual bool addChild(QGraphicsItem *child, int x, int y)
Checks whether the coordinated intersects an item and adds a child. Checks ItemModelObservable::isEna...
virtual EnumType * getBalloonItem() const
Returns value that represents balloon (MVC Component) type belonging to enumeration.
virtual EnumType * getImageItem() const
Returns value that represents image (MVC Component) type belonging to enumeration.
virtual QGraphicsItem * intersectionSelectionItem(int x, int y)
Checks whether the coordinated intersects an item and returns.
Class that represents a "Controller" part of Title MVC component. Its coordinate system is the same o...
virtual bool isEnableChildren()
Returns true if MVC component can have children, false otherwise.
QGraphicsItem * createPolygon()
Create graphic object of type PolygonItem.
virtual EnumType * getItemGroup() const
Returns value that represents item group (MVC Component) type belonging to enumeration.
Class that represents a "Controller" part of TextGrid MVC component. Its coordinate system is the sam...
virtual EnumType * getModeCreateTitle() const
Returns value that represents create title mode type belonging to enumeration.
static Enums & getInstance()
It returns a reference to the singleton instance.
Class to represent a mode type enumeration. Ex.: select, pan, create text, etc. The type of mode is u...
virtual EnumType * getTextItem() const
Returns value that represents text (MVC Component) type belonging to enumeration. ...
QGraphicsItem * createLegend()
Create graphic object of type LegendItem.
virtual EnumType * getTypeObj()
Returns object type that owns these properties.
QGraphicsItem * createMovingItemGroup()
Create graphic object of type MovingItemGroup.
virtual EnumType * getModeCreateMapLocation() const
Returns value that represents create map location mode type belonging to enumeration.
Class that represents a "Model" part of Map MVC component. Its coordinate system is the same of scene...
Class that represents a "Controller" part of Ellipse MVC component. Its coordinate system is the same...
virtual EnumType * getModeCreatePolygon() const
Returns value that represents create polygon mode type belonging to enumeration.
virtual EnumType * getPolygonItem() const
Returns value that represents polygon (MVC Component) type belonging to enumeration.
QGraphicsItem * createPoint()
Create graphic object of type PointItem.
ItemUtils * getItemUtils()
Returns pointer for manipulating items in the scene and vectorization of text and legend...
Class that represents a graphic Image. Its coordinate system is the same of scene (millimeters)...
virtual EnumType * getModeCreateGridMap() const
Returns value that represents wait coordinate mode type belonging to enumeration. ...
Class that represents a "Controller" part of ItemGroup MVC component. Its coordinate system is the sa...
QGraphicsItem * rebuildItem(te::layout::Properties *props, bool draw=true)
Method to build a graphics object from the properties.
Class that represents a "Controller" part of Point MVC component. Its coordinate system is the same o...
QGraphicsItem * createGridGeodesic()
Create graphic object of type GridGeodesicItem.
QGraphicsItem * createMap()
Create graphic object of type MapItem.
Class that represents a "Model" part of Rectangle MVC component. Its coordinate system is the same of...
virtual void updateProperties(te::layout::Properties *properties)
Reimplemented from Observable.
virtual EnumType * getTextGridItem() const
Returns value that represents text grid (MVC Component) type belonging to enumeration.
QGraphicsItem * createRectangle()
Create graphic object of type RectangleItem.
Utility class for manipulating items in the scene and vectorization of text and legend.
virtual void setName(std::string name)
Change the name of the MVC component.
Class representing the scene. This scene is child of QGraphicsScene, part of Graphics View Framework...
virtual EnumType * getModeCreateLine() const
Returns value that represents create line mode type belonging to enumeration.
virtual EnumType * getMovingItemGroup() const
Returns value that represents moving item group (MVC Component) type belonging to enumeration...
Class that represents a "Model" part of Map MVC component. Its coordinate system is the same of scene...
Class that represents a "Model" part of Ellipse MVC component. Its coordinate system is the same of s...
Abstract scene for Scene, a QGraphicsScene class, part of Graphics View Framework.
Class that represents a "Controller" part of Scale MVC component. Its coordinate system is the same o...
Class that represents a graphic GridMap. Its coordinate system is the same of scene (millimeters)...
virtual EnumType * getArrowItem() const
Returns value that represents arrow (MVC Component) type belonging to enumeration.
Class that represents a graphic scale of a map. Its coordinate system is the same of scene (millimete...
Class that represents a "Model" part of Title MVC component. Its coordinate system is the same of sce...
virtual EnumType * getLegendItem() const
Returns value that represents legend (MVC Component) type belonging to enumeration.
Class that represents a "Controller" part of Map MVC component. Its coordinate system is the same of ...
Class that represents a graphic Rectangle. Its coordinate system is the same of scene (millimeters)...
Class that represents a "Model" part of Point MVC component. Its coordinate system is the same of sce...
Class that represents a "Controller" part of Map MVC component. Its coordinate system is the same of ...
Class that represents a "Model" part of Rectangle MVC component. Its coordinate system is the same of...
virtual void setId(int id)
Reimplemented from Observable.
QGraphicsItem * createGridMap()
Create graphic object of type GridMapItem.
virtual EnumType * getModeCreateEllipse() const
Returns value that represents create ellipse mode type belonging to enumeration.
Class that represents a "Controller" part of Text MVC component. Its coordinate system is the same of...
This class is a proxy MapDisplay. This makes it possible to add a MapDisplay as item of a scene...
virtual EnumType * getRectangleItem() const
Returns value that represents rectangle (MVC Component) type belonging to enumeration.
Class that represents the value of an enumeration. An enumeration is made of "1..n" objects EnumType...
QGraphicsItem * createEllipse()
Create graphic object of type EllipseItem.
Class that represents a "Model" part of Image MVC component. Its coordinate system is the same of sce...
QGraphicsItem * createPaper()
Create graphic object of type PaperItem.
Class that represents a graphic Ellipse. Its coordinate system is the same of scene (millimeters)...
virtual Observable * getModel()
Returns the "Model" part of the MVC.
Class daughter of te::layout::TextItem representing a grid with two cells which can be inserted texts...
virtual EnumType * getModeCreatePoint() const
Returns value that represents create point mode type belonging to enumeration.
Class that represents a "Model" part of Arrow MVC component. Its coordinate system is the same of sce...
virtual EnumType * getModeCreateNorth() const
Returns value that represents create north mode type belonging to enumeration.
Class that represents a graphic GridMap. Its coordinate system is the same of scene (millimeters)...
virtual EnumType * getGridMapItem() const
Returns value that represents gridmapitem (MVC Component) type belonging to enumeration.
virtual EnumType * getMapItem() const
Returns value that represents map (MVC Component) type belonging to enumeration.
virtual EnumType * getModeCreateBarCode() const
Returns value that represents wait coordinate mode type belonging to enumeration. ...
QGraphicsItem * createGridPlanar()
Create graphic object of type GridPlanarItem.
AbstractScene * getScene()
Returns abstract scene for QGraphicsScene class, part of Graphics View Framework. ...
virtual EnumType * getModeCreateBalloon() const
Returns value that represents create balloon mode type belonging to enumeration.
virtual EnumType * getModeCreateGridPlanar() const
Returns value that represents create grid planar mode type belonging to enumeration.
virtual EnumType * getModeCreateScale() const
Returns value that represents create scale mode type belonging to enumeration.
QGraphicsItem * createBalloon()
Create graphic object of type Balloon.
virtual EnumType * getModeCreateArrow() const
Returns value that represents create arrow mode type belonging to enumeration.
QGraphicsItem * createImage()
Create graphic object of type ImageItem.
Class that represents a "Controller" part of Rectangle MVC component. Its coordinate system is the sa...
Class that represents a graphic Rectangle. Its coordinate system is the same of scene (millimeters)...
QGraphicsItem * createNorth()
Create graphic object of type NorthItem.
virtual void updateProperties(te::layout::Properties *properties)
Reimplemented from Observable.
virtual EnumType * getModeCreateMap() const
Returns value that represents create map mode type belonging to enumeration.
QGraphicsItem * createTextGrid()
Create graphic object of type TextGridItem.
Class responsible for creating or building graphics objects. All objects are children of QGraphicsIte...
virtual EnumType * getScaleItem() const
Returns value that represents scale (MVC Component) type belonging to enumeration.
Class that represents a "Controller" part of Rectangle MVC component. Its coordinate system is the sa...
Class that represents a "Controller" part of Rectangle MVC component. Its coordinate system is the sa...
This class is a proxy MapDisplay. This makes it possible to add a MapDisplay as item of a scene...
virtual EnumType * getModeCreateImage() const
Returns value that represents create image mode type belonging to enumeration.
virtual int maxTypeId(te::layout::EnumType *type)
Search max id for a type.
virtual EnumType * getModeCreateGridGeodesic() const
Returns value that represents create grid geodesic mode type belonging to enumeration.
virtual void updateProperties(te::layout::Properties *properties)
Reimplemented from Observable.
QGraphicsItem * createTitle()
Create graphic object of type TitleItem.
Class that represents text. This object is of type QGraphicsTextItem. He is directly editable via use...
virtual EnumType * getLegendChildItem() const
Returns value that represents legend child (MVC Component) type belonging to enumeration.
Class that represents a "Model" part of Scale MVC component. Its coordinate system is the same of sce...
Class that represents a graphic GridMap. Its coordinate system is the same of scene (millimeters)...