All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ToolbarOutside.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file ToolbarOutside.cpp
22 
23  \brief
24 
25  \ingroup layout
26 */
27 
28 // TerraLib
29 #include "ToolbarOutside.h"
30 #include "../../core/pattern/singleton/Context.h"
31 #include "../../core/AbstractScene.h"
32 #include "../core/Scene.h"
33 #include "../../core/pattern/mvc/OutsideModelObservable.h"
34 #include "../../core/pattern/mvc/ItemObserver.h"
35 #include "../../core/pattern/mvc/OutsideObserver.h"
36 #include "../../core/pattern/mvc/OutsideController.h"
37 #include "../../../geometry/Envelope.h"
38 #include "../../core/enum/Enums.h"
39 
40 //STL
41 #include <string>
42 
43 // Qt
44 #include <QToolBar>
45 #include <QToolButton>
46 #include <QComboBox>
47 #include <QGroupBox>
48 #include <QVBoxLayout>
49 #include <QLabel>
50 #include <QTextEdit>
51 #include <QMenuBar>
52 #include <QAction>
53 #include <QPushButton>
54 #include <QUndoStack>
55 
57  QToolBar(0),
58  OutsideObserver(controller, o),
59  m_comboZoom(0),
60  m_actionMapDefault("map_default"),
61  m_actionLegendDefault("legend_default"),
62  m_actionScale("scale_object"),
63  m_actionMapZoomIn("map_zoom_in"),
64  m_actionMapZoomOut("map_zoom_out"),
65  m_actionMapPan("map_pan"),
66  m_actionMapSystematicScale("map_systematic_scale"),
67  m_actionMapCreateTextGrid("map_text_grid"),
68  m_actionMapCreateMapText("map_text_map"),
69  m_actionMapCreateLegendChildAsObject("legend_child"),
70  m_actionGridMap("map_grid_map"),
71  m_actionGridPlanar("map_grid_planar"),
72  m_actionGridGeodesic("map_grid_geodesic"),
73  m_actionNorth("map_north"),
74  m_actionMapLocation("map_location"),
75  m_actionRectangle("geometry_rectangle"),
76  m_actionPoint("geometry_point"),
77  m_actionEllipse("geometry_ellipse"),
78  m_actionArrow("geometry_arrow"),
79  m_actionLine("geometry_line"),
80  m_actionPolygon("geometry_polygon"),
81  m_actionViewPan("view_pan"),
82  m_actionViewZoomIn("view_zoom_in"),
83  m_actionViewZoomOut("view_zoom_out"),
84  m_actionGroup("items_group"),
85  m_actionUngroup("items_ungroup"),
86  m_actionLineIntersectionMouse("items_intersection_mouse"),
87  m_actionSceneZoom("scene_zoom"),
88  m_actionRemoveObject("remove_item"),
89  m_actionTextDefault("text_default"),
90  m_actionImage("text_image"),
91  m_actionStringGrid("text_stringGrid"),
92  m_actionTitle("text_title"),
93  m_actionBalloon("text_balloon"),
94  m_actionBarCode("text_barCode"),
95  m_actionAlignLeft("align_left"),
96  m_actionAlignRight("align_right"),
97  m_actionAlignTop("align_top"),
98  m_actionAlignBottom("align_bottom"),
99  m_actionAlignCenterHorizontal("align_center_horizontal"),
100  m_actionAlignCenterVertical("align_center_vertical"),
101  m_actionUndo("undo"),
102  m_actionRedo("redo"),
103  m_actionDrawMap("draw_map"),
104  m_actionObjectToImage("object_to_image"),
105  m_actionExit("exit"),
106  m_actionExportToPDF("export_to_pdf"),
107  m_mapToolButton(0),
108  m_mapToolsToolButton(0),
109  m_geometryToolButton(0),
110  m_viewAreaToolButton(0),
111  m_arrowCursorButton(0),
112  m_itemTools(0),
113  m_lineIntersectionToolButton(0),
114  m_bringToFrontToolButton(0),
115  m_sendToBackToolButton(0),
116  m_recomposeToolButton(0),
117  m_textToolButton(0),
118  m_alignLeftToolButton(0),
119  m_alignRightToolButton(0),
120  m_alignTopToolButton(0),
121  m_alignBottomToolButton(0),
122  m_alignCenterHorizontalToolButton(0),
123  m_alignCenterVerticalToolButton(0),
124  m_removeObjectToolButton(0),
125  m_undoToolButton(0),
126  m_drawMapToolButton(0),
127  m_objectToImageButton(0),
128  m_exitButton(0),
129  m_exportToPDFButton(0),
130  m_actionComboZoom(0),
131  m_actionMapToolButton(0),
132  m_actionMapToolsToolButton(0),
133  m_actionGeometryToolButton(0),
134  m_actionViewAreaToolButton(0),
135  m_actionArrowCursorButton(0),
136  m_actionItemTools(0),
137  m_actionLineIntersectionToolButton(0),
138  m_actionBringToFrontToolButton(0),
139  m_actionSendToBackToolButton(0),
140  m_actionRecomposeToolButton(0),
141  m_actionTextToolButton(0),
142  m_actionAlignLeftToolButton(0),
143  m_actionAlignRightToolButton(0),
144  m_actionAlignTopToolButton(0),
145  m_actionAlignBottomToolButton(0),
146  m_actionAlignCenterHorizontalToolButton(0),
147  m_actionAlignCenterVerticalToolButton(0),
148  m_actionRemoveObjectToolButton(0),
149  m_actionUndoToolButton(0),
150  m_actionDrawMapToolButton(0),
151  m_actionObjectToImageButton(0),
152  m_actionExitButton(0),
153  m_actionExportToPDFButton(0)
154 {
155  setVisible(false);
156  setWindowTitle("Layout - Toolbar");
157  setMinimumSize(200, 10);
158 }
159 
161 {
162 
163 }
164 
166 {
167  setVisible(context.isShow());
168  if(context.isShow() == true)
169  show();
170  else
171  hide();
172 }
173 
174 void te::layout::ToolbarOutside::setPosition( const double& x, const double& y )
175 {
176  move(x,y);
177  refresh();
178 }
179 
181 {
182  QPointF posF = pos();
183  qreal valuex = posF.x();
184  qreal valuey = posF.y();
185 
186  te::gm::Coord2D coordinate;
187  coordinate.x = valuex;
188  coordinate.y = valuey;
189 
190  return coordinate;
191 }
192 
194 {
195  createArrowCursorButton();
196  createDrawMapToolButton();
197  this->addSeparator();
198 
199  createRecomposeToolButton();
200  this->addSeparator();
201 
202  createUndoToolButton();
203  this->addSeparator();
204 
205  createViewAreaToolButton();
206  createMapToolsToolButton();
207  this->addSeparator();
208 
209  createMapToolButton();
210  createGeometryToolButton();
211  createTextToolButton();
212  this->addSeparator();
213 
214  createItemTools();
215  this->addSeparator();
216 
217  createRemoveObjectToolButton();
218  this->addSeparator();
219 
220  createBringToFrontToolButton();
221  createSendToBackToolButton();
222  this->addSeparator();
223 
224  createAlignLeftToolButton();
225  createAlignTopToolButton();
226  createAlignBottomToolButton();
227  createAlignRightToolButton();
228  this->addSeparator();
229 
230  createAlignCenterHorizontalToolButton();
231  createAlignCenterVerticalToolButton();
232  this->addSeparator();
233 
234  createObjectToImageButton();
235  this->addSeparator();
236 
237  createExportToPDFButton();
238  this->addSeparator();
239 
240  createSceneZoomCombobox();
241  this->addSeparator();
242 
243  createExitButton();
244  this->addSeparator();
245 }
246 
248 {
249  QToolButton *btnMap = createToolButton("Map", "Map Objects", "");
250 
251  QMenu* menu = new QMenu(btnMap);
252 
253  QAction* actionDefaultMenu = createAction("Default Map Object", m_actionMapDefault, "layout-default-map", "", menu);
254  menu->addAction(actionDefaultMenu);
255 
256  QAction* actionGridMap = createAction("Grid Map", m_actionGridMap, "layout-grid", "", menu);
257  menu->addAction(actionGridMap);
258 
259  QAction* actionGridPlanar = createAction("Grid Planar", m_actionGridPlanar, "layout-grid", "", menu);
260  menu->addAction(actionGridPlanar);
261 
262  QAction* actionGridGeodesic = createAction("Grid Geodesic", m_actionGridGeodesic, "layout-grid", "", menu);
263  menu->addAction(actionGridGeodesic);
264 
265  QAction* actionLegend = createAction("Default Legend", m_actionLegendDefault, "layout-default-legend", "", menu);
266  menu->addAction(actionLegend);
267 
268  QAction* actionScale = createAction("Scale Object", m_actionScale, "layout-scale", "", menu);
269  menu->addAction(actionScale);
270 
271  QAction* actionNorth = createAction("North Object", m_actionNorth, "layout-north", "", menu);
272  menu->addAction(actionNorth);
273 
274  QAction* actionMapLocation = createAction("Map Location Object", m_actionMapLocation, "layout-map-location", "", menu);
275  menu->addAction(actionMapLocation);
276 
277  btnMap->setMenu(menu);
278  btnMap->setPopupMode(QToolButton::MenuButtonPopup);
279  btnMap->setDefaultAction(actionDefaultMenu);
280 
281  connect(btnMap, SIGNAL(triggered(QAction*)), this, SLOT(onMapTriggered(QAction*)));
282  m_actionMapToolButton = this->addWidget(btnMap);
283 
284  m_mapToolButton = btnMap;
285 
286  return btnMap;
287 }
288 
290 {
291  QToolButton *btnMapTools = createToolButton("Map Tools", "Map Tools", "");
292 
293  QMenu* menu = new QMenu(btnMapTools);
294 
295  QAction* actionPan = createAction("Pan Tool", m_actionMapPan, "layout-map-pan", "", menu);
296  menu->addAction(actionPan);
297 
298  QAction* actionZoomIn = createAction("Zoom In", m_actionMapZoomIn, "layout-map-zoom-in", "", menu);
299  menu->addAction(actionZoomIn);
300 
301  QAction* actionZoomOut = createAction("Zoom Out", m_actionMapZoomOut, "layout-map-zoom-out", "", menu);
302  menu->addAction(actionZoomOut);
303 
304  QAction* actionSystematic = createAction("Systematic Scale", m_actionMapSystematicScale, "layout-systematic-map", "", menu);
305  menu->addAction(actionSystematic);
306 
307  QAction* actionTextGrid = createAction("Text Grid as Object", m_actionMapCreateTextGrid, "layout-createtext-as-obj", "", menu);
308  menu->addAction(actionTextGrid);
309 
310  QAction* actionTextMap = createAction("Text Map as Object", m_actionMapCreateMapText, "layout-createmap-text-as-objs", "", menu);
311  menu->addAction(actionTextMap);
312 
313  QAction* actionLegend = createAction("Legend as Object", m_actionMapCreateLegendChildAsObject, "layout-legend-child", "", menu);
314  menu->addAction(actionLegend);
315 
316  btnMapTools->setMenu(menu);
317  btnMapTools->setPopupMode(QToolButton::MenuButtonPopup);
318  btnMapTools->setDefaultAction(actionPan);
319 
320  connect(btnMapTools, SIGNAL(triggered(QAction*)), this, SLOT(onMapToolsTriggered(QAction*)));
321  m_actionMapToolsToolButton = this->addWidget(btnMapTools);
322 
323  m_mapToolsToolButton = btnMapTools;
324 
325  return btnMapTools;
326 }
327 
329 {
330  QToolButton *btnGeometry = createToolButton("Geometry Tools", "Geometries Objects", "");
331 
332  QMenu* menu = new QMenu(btnGeometry);
333 
334  QAction* actionRectagle = createAction("Rectangle Object", m_actionRectangle, "layout-square", "", menu);
335  menu->addAction(actionRectagle);
336 
337  QAction* actionArrow = createAction("Arrow Object", m_actionArrow, "layout-arrow", "", menu);
338  menu->addAction(actionArrow);
339 
340  QAction* actionEllipse = createAction("Ellipse Object", m_actionEllipse, "layout-ellipse", "", menu);
341  menu->addAction(actionEllipse);
342 
343  QAction* actionPoint = createAction("Point Object", m_actionPoint, "layout-point", "", menu);
344  menu->addAction(actionPoint);
345 
346  QAction* actionLine = createAction("Line Object", m_actionLine, "layout-drawline", "", menu);
347  menu->addAction(actionLine);
348 
349  QAction* actionPolygon = createAction("Polygon Object", m_actionPolygon, "layout-polygon", "", menu);
350  menu->addAction(actionPolygon);
351 
352  btnGeometry->setMenu(menu);
353  btnGeometry->setPopupMode(QToolButton::MenuButtonPopup);
354  btnGeometry->setDefaultAction(actionRectagle);
355 
356  connect(btnGeometry, SIGNAL(triggered(QAction*)), this, SLOT(onGeometryTriggered(QAction*)));
357  m_actionGeometryToolButton = this->addWidget(btnGeometry);
358 
359  m_geometryToolButton = btnGeometry;
360 
361  return btnGeometry;
362 }
363 
365 {
366  QToolButton *btnViewArea = createToolButton("Paper Tools", "Paper Tools", "");
367 
368  QMenu* menu = new QMenu(btnViewArea);
369 
370  QAction* actionPan = createAction("Pan Tool", m_actionViewPan, "layout-paper-pan", "", menu);
371  menu->addAction(actionPan);
372 
373  QAction* actionZoomIn = createAction("Zoom In", m_actionViewZoomIn, "layout-paper-zoom-in", "", menu);
374  menu->addAction(actionZoomIn);
375 
376  QAction* actionZoomOut = createAction("Zoom Out", m_actionViewZoomOut, "layout-paper-zoom-out", "", menu);
377  menu->addAction(actionZoomOut);
378 
379  btnViewArea->setMenu(menu);
380  btnViewArea->setPopupMode(QToolButton::MenuButtonPopup);
381  btnViewArea->setDefaultAction(actionPan);
382 
383  connect(btnViewArea, SIGNAL(triggered(QAction*)), this, SLOT(onViewAreaTriggered(QAction*)));
384  m_actionViewAreaToolButton = this->addWidget(btnViewArea);
385 
386  m_viewAreaToolButton = btnViewArea;
387 
388  return btnViewArea;
389 }
390 
392 {
393  QToolButton *btnArrowCursor = createToolButton("Arrow Cursor", "Arrow Cursor", "layout-default-cursor");
394  btnArrowCursor->setCheckable(false);
395  connect(btnArrowCursor, SIGNAL(clicked(bool)), this, SLOT(onArrowCursorClicked(bool)));
396 
397  m_actionArrowCursorButton = this->addWidget(btnArrowCursor);
398 
399  m_arrowCursorButton = btnArrowCursor;
400 
401  return btnArrowCursor;
402 }
403 
405 {
406  QToolButton *btnTools = createToolButton("Item Tools", "Item Tools", "");
407 
408  QMenu* menu = new QMenu(btnTools);
409 
410  QAction* actionGroup = createAction("Group", m_actionGroup, "layout-group", "", menu);
411  menu->addAction(actionGroup);
412 
413  QAction* actionUngroup = createAction("Ungroup", m_actionUngroup, "layout-ungroup", "", menu);
414  menu->addAction(actionUngroup);
415 
416  btnTools->setMenu(menu);
417  btnTools->setPopupMode(QToolButton::MenuButtonPopup);
418  btnTools->setDefaultAction(actionGroup);
419 
420  connect(btnTools, SIGNAL(triggered(QAction*)), this, SLOT(onItemToolsTriggered(QAction*)));
421  m_actionItemTools = this->addWidget(btnTools);
422 
423  m_itemTools = btnTools;
424 
425  return btnTools;
426 }
427 
429 {
430  QToolButton *btnLineMouse = createToolButton("Draw Line Intersection Mouse", "Draw Line Intersection Mouse", "layout-draw-line-mouse-intersection");
431  connect(btnLineMouse, SIGNAL(toggled(bool)), this, SLOT(onLineIntersectionMouse(bool)));
432 
433  m_actionLineIntersectionToolButton = this->addWidget(btnLineMouse);
434 
435  m_lineIntersectionToolButton = btnLineMouse;
436 
437  return btnLineMouse;
438 }
439 
441 {
442  m_comboZoom = new QComboBox(this);
443  m_comboZoom->setObjectName(m_actionSceneZoom.c_str());
444 
445  m_comboZoom->addItem("42%", 0.42);
446  m_comboZoom->addItem("50%", 0.5);
447  m_comboZoom->addItem("70%", 0.7);
448  m_comboZoom->addItem("100%", 1.);
449  m_comboZoom->addItem("150%", 1.5);
450  m_comboZoom->addItem("200%", 2.);
451  m_comboZoom->addItem("300%", 3.);
452 
453  connect(m_comboZoom, SIGNAL(currentIndexChanged(int)), this, SLOT(onSceneZoomCurrentIndexChanged(int)));
454  m_comboZoom->setCurrentIndex(1);
455  Context::getInstance().setDefaultZoomFactor(m_comboZoom->itemData(1).toDouble());
456 
457  m_actionComboZoom = this->addWidget(m_comboZoom);
458 
459  return m_comboZoom;
460 }
461 
463 {
464  QToolButton *btn = createToolButton("Bring to front", "Bring to front", "layout-in-front");
465  btn->setCheckable(false);
466  connect(btn, SIGNAL(clicked(bool)), this, SLOT(onBringToFrontClicked(bool)));
467 
468  m_actionBringToFrontToolButton = this->addWidget(btn);
469 
470  m_bringToFrontToolButton = btn;
471 
472  return btn;
473 }
474 
476 {
477  QToolButton *btn = createToolButton("Send to back", "Send to back", "layout-to-back");
478  btn->setCheckable(false);
479  connect(btn, SIGNAL(clicked(bool)), this, SLOT(onSendToBackClicked(bool)));
480 
481  m_actionSendToBackToolButton = this->addWidget(btn);
482 
483  m_sendToBackToolButton = btn;
484 
485  return btn;
486 }
487 
488 
490 {
491  QToolButton *btn = createToolButton("Recompose", "Recompose", "layout-recompose");
492  btn->setCheckable(false);
493  connect(btn, SIGNAL(clicked(bool)), this, SLOT(onRecomposeClicked(bool)));
494 
495  m_actionRecomposeToolButton = this->addWidget(btn);
496 
497  m_recomposeToolButton = btn;
498 
499  return btn;
500 }
501 
503 {
504  QToolButton *btn = createToolButton("Text Tools", "Text Tools", "");
505 
506  QMenu* menu = new QMenu(btn);
507 
508  QAction* actionTxtDefault = createAction("Default Text Object", m_actionTextDefault, "layout-default-text", "", menu);
509  menu->addAction(actionTxtDefault);
510 
511  QAction* actionTitle = createAction("Title Object", m_actionTitle, "layout-title", "", menu);
512  menu->addAction(actionTitle);
513 
514  QAction* actionStringGrid = createAction("Text Grid Object", m_actionStringGrid, "layout-grid", "", menu);
515  menu->addAction(actionStringGrid);
516 
517  QAction* actionImage = createAction("Image Object", m_actionImage, "layout-image", "", menu);
518  menu->addAction(actionImage);
519 
520  QAction* actionBalloon = createAction("Balloon Object", m_actionBalloon, "layout-ballon", "", menu);
521  menu->addAction(actionBalloon);
522 
523  QAction* actionBarCode = createAction("BarCode Object", m_actionBarCode, "layout-barcode", "", menu);
524  menu->addAction(actionBarCode);
525 
526  btn->setMenu(menu);
527  btn->setPopupMode(QToolButton::MenuButtonPopup);
528  btn->setDefaultAction(actionTxtDefault);
529 
530  connect(btn, SIGNAL(triggered(QAction*)), this, SLOT(onTextToolsTriggered(QAction*)));
531  m_actionTextToolButton = this->addWidget(btn);
532 
533  m_textToolButton = btn;
534 
535  return btn;
536 }
537 
539 {
540  QToolButton *btn = createToolButton("Align Left", "Align Left", "layout-alignleft");
541  btn->setCheckable(false);
542  connect(btn, SIGNAL(clicked(bool)), this, SLOT(onAlignLeftClicked(bool)));
543 
544  m_actionAlignLeftToolButton = this->addWidget(btn);
545 
546  m_alignLeftToolButton = btn;
547 
548  return btn;
549 }
550 
552 {
553  QToolButton *btn = createToolButton("Align Right", "Align Right", "layout-alignright");
554  btn->setCheckable(false);
555  connect(btn, SIGNAL(clicked(bool)), this, SLOT(onAlignRightClicked(bool)));
556 
557  m_actionAlignRightToolButton = this->addWidget(btn);
558 
559  m_alignRightToolButton = btn;
560 
561  return btn;
562 }
563 
565 {
566  QToolButton *btn = createToolButton("Align Top", "Align Top", "layout-aligntop");
567  btn->setCheckable(false);
568  connect(btn, SIGNAL(clicked(bool)), this, SLOT(onAlignTopClicked(bool)));
569 
570  m_actionAlignTopToolButton = this->addWidget(btn);
571 
572  m_alignTopToolButton = btn;
573 
574  return btn;
575 }
576 
578 {
579  QToolButton *btn = createToolButton("Align Bottom", "Align Bottom", "layout-alignbottom");
580  btn->setCheckable(false);
581  connect(btn, SIGNAL(clicked(bool)), this, SLOT(onAlignBottomClicked(bool)));
582 
583  m_actionAlignBottomToolButton = this->addWidget(btn);
584 
585  m_alignBottomToolButton = btn;
586 
587  return btn;
588 }
589 
591 {
592  QToolButton *btn = createToolButton("Align Center Horizontal", "Align Center Horizontal", "layout-alignhrzcenter");
593  btn->setCheckable(false);
594  connect(btn, SIGNAL(clicked(bool)), this, SLOT(onAlignCenterHorizontalClicked(bool)));
595 
596  m_actionAlignCenterHorizontalToolButton = this->addWidget(btn);
597 
598  m_alignCenterHorizontalToolButton = btn;
599 
600  return btn;
601 }
602 
604 {
605  QToolButton *btn = createToolButton("Align Center Vertical", "Align Center Vertical", "layout-alignvrtcenter");
606  btn->setCheckable(false);
607  connect(btn, SIGNAL(clicked(bool)), this, SLOT(onAlignCenterVerticalClicked(bool)));
608 
609  m_actionAlignCenterVerticalToolButton = this->addWidget(btn);
610 
611  m_alignCenterVerticalToolButton = btn;
612 
613  return btn;
614 }
615 
617 {
618  QToolButton *btn = createToolButton("Remove Object", "Remove Object", "layout-empty-trash");
619  btn->setCheckable(false);
620  connect(btn, SIGNAL(clicked(bool)), this, SLOT(onRemoveObjectClicked(bool)));
621 
622  m_actionRemoveObjectToolButton = this->addWidget(btn);
623 
624  m_removeObjectToolButton = btn;
625 
626  return btn;
627 }
628 
630 {
631  QToolButton *btn = createToolButton("Undo/Redo", "Undo/Redo", "");
632 
633  QMenu* menu = new QMenu(btn);
634 
635  Scene* lScene = dynamic_cast<Scene*>(Context::getInstance().getScene());
636 
637  QUndoStack* undoStack = lScene->getUndoStack();
638 
639  if(!undoStack)
640  return 0;
641 
642  QAction* actionUndo = undoStack->createUndoAction(menu, tr("&Undo"));
643  actionUndo->setShortcuts(QKeySequence::Undo);
644  actionUndo->setObjectName(m_actionUndo.c_str());
645  actionUndo->setIcon(QIcon::fromTheme("layout-undo"));
646  actionUndo->setToolTip("Undo Action");
647  menu->addAction(actionUndo);
648 
649  QAction* actionRedo = undoStack->createRedoAction(menu, tr("&Redo"));
650  actionRedo->setShortcuts(QKeySequence::Redo);
651  actionRedo->setObjectName(m_actionRedo.c_str());
652  actionRedo->setIcon(QIcon::fromTheme("layout-redo"));
653  actionRedo->setToolTip("Redo Action");
654  menu->addAction(actionRedo);
655 
656  btn->setMenu(menu);
657  btn->setPopupMode(QToolButton::MenuButtonPopup);
658  btn->setDefaultAction(actionUndo);
659 
660  m_actionUndoToolButton = this->addWidget(btn);
661 
662  m_undoToolButton = btn;
663 
664  return btn;
665 }
666 
668 {
669  QToolButton *btn = createToolButton("Redraw Selection Map", "Redraw Selection Map", "layout-draw-map");
670  btn->setCheckable(false);
671  connect(btn, SIGNAL(clicked(bool)), this, SLOT(onDrawMapClicked(bool)));
672 
673  m_actionDrawMapToolButton = this->addWidget(btn);
674 
675  m_drawMapToolButton = btn;
676 
677  return btn;
678 }
679 
681 {
682  QToolButton *btn = createToolButton("Object To Image", "Export all selected objects to image", "layout-object-to-image");
683  btn->setCheckable(false);
684  connect(btn, SIGNAL(clicked(bool)), this, SLOT(onObjectToImageClicked(bool)));
685 
686  m_actionObjectToImageButton = this->addWidget(btn);
687 
688  m_objectToImageButton = btn;
689 
690  return btn;
691 }
692 
694 {
695  QToolButton *btn = createToolButton("Exit", "Exit", "layout-close");
696  btn->setCheckable(false);
697  connect(btn, SIGNAL(clicked(bool)), this, SLOT(onExitClicked(bool)));
698 
699  m_actionExitButton = this->addWidget(btn);
700 
701  m_exitButton = btn;
702 
703  return btn;
704 }
705 
707 {
708  QToolButton *btn = createToolButton("Export To PDF", "Export to PDF", "layout-pdf");
709  btn->setCheckable(false);
710  connect(btn, SIGNAL(clicked(bool)), this, SLOT(onExportToPDFClicked(bool)));
711 
712  m_actionExportToPDFButton = this->addWidget(btn);
713 
714  m_exportToPDFButton = btn;
715 
716  return btn;
717 }
718 
720 {
721  QToolButton* button = dynamic_cast<QToolButton*>(sender());
722  if(button)
723  {
724  button->setDefaultAction(action);
725  }
726 
728 
729  if(action->objectName().compare(m_actionMapDefault.c_str()) == 0)
730  {
731  changeAction(type->getModeCreateMap());
732  }
733  else if(action->objectName().compare(m_actionGridMap.c_str()) == 0)
734  {
735  changeAction(type->getModeCreateGridMap());
736  }
737  else if(action->objectName().compare(m_actionGridPlanar.c_str()) == 0)
738  {
739  changeAction(type->getModeCreateGridPlanar());
740  }
741  else if(action->objectName().compare(m_actionGridGeodesic.c_str()) == 0)
742  {
743  changeAction(type->getModeCreateGridGeodesic());
744  }
745  else if(action->objectName().compare(m_actionLegendDefault.c_str()) == 0)
746  {
747  changeAction(type->getModeCreateLegend());
748  }
749  else if(action->objectName().compare(m_actionScale.c_str()) == 0)
750  {
751  changeAction(type->getModeCreateScale());
752  }
753  else if(action->objectName().compare(m_actionNorth.c_str()) == 0)
754  {
755  changeAction(type->getModeCreateNorth());
756  }
757  else if(action->objectName().compare(m_actionMapLocation.c_str()) == 0)
758  {
759  changeAction(type->getModeCreateMapLocation());
760  }
761 }
762 
764 {
765  QToolButton* button = dynamic_cast<QToolButton*>(sender());
766  if(button)
767  {
768  button->setDefaultAction(action);
769  }
770 
772 
773  if(action->objectName().compare(m_actionMapPan.c_str()) == 0)
774  {
775  changeAction(type->getModeMapPan());
776  }
777  else if(action->objectName().compare(m_actionMapZoomIn.c_str()) == 0)
778  {
779  changeAction(type->getModeMapZoomIn());
780  }
781  else if(action->objectName().compare(m_actionMapZoomOut.c_str()) == 0)
782  {
783  changeAction(type->getModeMapZoomOut());
784  }
785  else if(action->objectName().compare(m_actionMapSystematicScale.c_str()) == 0)
786  {
787  changeAction(type->getModeSystematicScale());
788  }
789  else if(action->objectName().compare(m_actionMapCreateTextGrid.c_str()) == 0)
790  {
791  changeAction(type->getModeMapCreateTextGrid());
792  }
793  else if(action->objectName().compare(m_actionMapCreateMapText.c_str()) == 0)
794  {
795  changeAction(type->getModeMapCreateTextMap());
796  }
797  else if(action->objectName().compare(m_actionMapCreateLegendChildAsObject.c_str()) == 0)
798  {
799  changeAction(type->getModeLegendChildAsObject());
800  }
801 }
802 
804 {
805  QToolButton* button = dynamic_cast<QToolButton*>(sender());
806  if(button)
807  {
808  button->setDefaultAction(action);
809  }
810 
812 
813  if(action->objectName().compare(m_actionRectangle.c_str()) == 0)
814  {
815  changeAction(type->getModeCreateRectangle());
816  }
817  else if(action->objectName().compare(m_actionArrow.c_str()) == 0)
818  {
819  changeAction(type->getModeCreateArrow());
820  }
821  else if(action->objectName().compare(m_actionEllipse.c_str()) == 0)
822  {
823  changeAction(type->getModeCreateEllipse());
824  }
825  else if(action->objectName().compare(m_actionPoint.c_str()) == 0)
826  {
827  changeAction(type->getModeCreatePoint());
828  }
829  else if (action->objectName().compare(m_actionLine.c_str()) == 0)
830  {
831  changeAction(type->getModeCreateLine());
833  }
834  else if (action->objectName().compare(m_actionPolygon.c_str()) == 0)
835  {
836  changeAction(type->getModeCreatePolygon());
838  }
839 }
840 
842 {
843  QToolButton* button = dynamic_cast<QToolButton*>(sender());
844  if(button)
845  {
846  button->setDefaultAction(action);
847  }
848 
850 
851  if(action->objectName().compare(m_actionViewPan.c_str()) == 0)
852  {
853  changeAction(type->getModePan());
854  }
855  else if(action->objectName().compare(m_actionViewZoomIn.c_str()) == 0)
856  {
857  changeAction(type->getModeZoomIn());
858  }
859  else if(action->objectName().compare(m_actionViewZoomOut.c_str()) == 0)
860  {
861  changeAction(type->getModeZoomOut());
862  }
863 }
864 
866 {
868  changeAction(type->getModeArrowCursor());
869 }
870 
872 {
873  QToolButton* button = dynamic_cast<QToolButton*>(sender());
874  if(button)
875  {
876  button->setDefaultAction(action);
877  }
878 
880 
881  if(action->objectName().compare(m_actionGroup.c_str()) == 0)
882  {
883  changeAction(type->getModeGroup());
884  }
885  else if(action->objectName().compare(m_actionUngroup.c_str()) == 0)
886  {
887  changeAction(type->getModeUngroup());
888  }
889 }
890 
892 {
894  bool result = false;
896 
897  if(checked)
898  {
899  if(type->getModeActiveLinesIntersectionMouse() != mouseMode)
900  {
902  }
903  }
904  else
905  {
906  if(type->getModeOffLinesIntersectionMouse() != mouseMode)
907  {
909  }
910  }
911 
912  emit changeContext(result);
913 }
914 
916 {
917  QVariant variant = m_comboZoom->itemData(index);
918  double zoomFactor = Context::getInstance().getZoomFactor();
919  if(variant.toDouble() != zoomFactor)
920  {
922  Context::getInstance().setZoomFactor(variant.toDouble());
924  changeAction(type->getModeSceneZoom());
925  }
926 }
927 
929 {
931  changeAction(type->getModeBringToFront());
932 }
933 
935 {
937  changeAction(type->getModeSendToBack());
938 }
939 
941 {
943  m_comboZoom->setCurrentIndex(1);
944  changeAction(type->getModeRecompose());
945 }
946 
948 {
949  QToolButton* button = dynamic_cast<QToolButton*>(sender());
950  if(button)
951  {
952  button->setDefaultAction(action);
953  }
954 
956  if(action->objectName().compare(m_actionTextDefault.c_str()) == 0)
957  {
958  changeAction(type->getModeCreateText());
959  }
960  else if(action->objectName().compare(m_actionStringGrid.c_str()) == 0)
961  {
962  changeAction(type->getModeCreateTextGrid());
963  }
964  else if(action->objectName().compare(m_actionTitle.c_str()) == 0)
965  {
966  changeAction(type->getModeCreateTitle());
967  }
968  else if(action->objectName().compare(m_actionImage.c_str()) == 0)
969  {
970  changeAction(type->getModeCreateImage());
971  }
972  else if(action->objectName().compare(m_actionBalloon.c_str()) == 0)
973  {
974  changeAction(type->getModeCreateBalloon());
975  }
976  else if(action->objectName().compare(m_actionBarCode.c_str()) == 0)
977  {
978  changeAction(type->getModeCreateBarCode());
979  }
980 }
981 
983 {
985  changeAction(type->getModeAlignLeft());
986 }
987 
989 {
991  changeAction(type->getModeAlignRight());
992 }
993 
995 {
997  changeAction(type->getModeAlignTop());
998 }
999 
1001 {
1003  changeAction(type->getModeAlignBottom());
1004 }
1005 
1007 {
1009  changeAction(type->getModeAlignCenterHorizontal());
1010 }
1011 
1013 {
1015  changeAction(type->getModeAlignCenterVertical());
1016 }
1017 
1019 {
1021  changeAction(type->getModeRemoveObject());
1022 }
1023 
1025 {
1027  changeAction(type->getModeDrawSelectionMap());
1028 }
1029 
1031 {
1033  changeAction(type->getModeObjectToImage());
1034 }
1035 
1037 {
1039  changeAction(type->getModeExit());
1040 }
1041 
1043 {
1045  changeAction(type->getModeExportToPDF());
1046 }
1047 
1049 {
1050  bool result = true;
1051  EnumType* layoutMode = Context::getInstance().getMode();
1052 
1053  if(mode != layoutMode)
1054  {
1055  Context::getInstance().setMode(mode);
1056  }
1057  else
1058  {
1059  result = false;
1060  }
1061 
1062  emit changeContext(result);
1063 }
1064 
1065 QToolButton* te::layout::ToolbarOutside::createToolButton( std::string text, std::string tooltip, std::string icon )
1066 {
1067  QToolButton *btn = new QToolButton(this);
1068  btn->setText(text.c_str());
1069  btn->setGeometry(0,0,10,10);
1070  btn->setCheckable(true);
1071  btn->setToolTip(tooltip.c_str());
1072 
1073  if(!icon.empty())
1074  btn->setIcon(QIcon::fromTheme(icon.c_str()));
1075 
1076  return btn;
1077 }
1078 
1079 QPushButton* te::layout::ToolbarOutside::createPushButton( std::string text, std::string tooltip, std::string icon )
1080 {
1081  QPushButton *btn = new QPushButton(this);
1082  btn->setText(text.c_str());
1083  btn->setGeometry(0,0,10,10);
1084  btn->setCheckable(true);
1085  btn->setToolTip(tooltip.c_str());
1086 
1087  btn->setIcon(QIcon::fromTheme(icon.c_str()));
1088 
1089  return btn;
1090 }
1091 
1092 QAction* te::layout::ToolbarOutside::createAction( std::string text, std::string objName, std::string icon, std::string tooltip, QWidget* parent )
1093 {
1094  QWidget* parentToUse = parent;
1095  if(parentToUse == 0)
1096  {
1097  parentToUse = this;
1098  }
1099 
1100  QAction *actionMenu = new QAction(text.c_str(), parentToUse);
1101  actionMenu->setObjectName(objName.c_str());
1102 
1103  actionMenu->setIcon(QIcon::fromTheme(icon.c_str()));
1104  actionMenu->setToolTip(tooltip.c_str());
1105 
1106  return actionMenu;
1107 }
1108 
1110 {
1111  return m_comboZoom;
1112 }
1113 
1115 {
1116  int index = m_comboZoom->findData(factor);
1117 
1118  if ( index != -1 ) { // -1 for not found
1119  m_comboZoom->setCurrentIndex(index);
1120  }
1121 }
1122 
1124 {
1125  return m_mapToolButton;
1126 }
1127 
1129 {
1130  return m_mapToolsToolButton;
1131 }
1132 
1134 {
1135  return m_geometryToolButton;
1136 }
1137 
1139 {
1140  return m_viewAreaToolButton;
1141 }
1142 
1144 {
1145  return m_arrowCursorButton;
1146 }
1147 
1149 {
1150  return m_itemTools;
1151 }
1152 
1154 {
1155  return m_lineIntersectionToolButton;
1156 }
1157 
1159 {
1160  return m_bringToFrontToolButton;
1161 }
1162 
1164 {
1165  return m_sendToBackToolButton;
1166 }
1167 
1169 {
1170  return m_recomposeToolButton;
1171 }
1172 
1174 {
1175  return m_textToolButton;
1176 }
1177 
1179 {
1180  return m_alignLeftToolButton;
1181 }
1182 
1184 {
1185  return m_alignRightToolButton;
1186 }
1187 
1189 {
1190  return m_alignTopToolButton;
1191 }
1192 
1194 {
1195  return m_alignBottomToolButton;
1196 }
1197 
1199 {
1200  return m_alignCenterHorizontalToolButton;
1201 }
1202 
1204 {
1205  return m_alignCenterVerticalToolButton;
1206 }
1207 
1209 {
1210  return m_removeObjectToolButton;
1211 }
1212 
1214 {
1215  return m_undoToolButton;
1216 }
1217 
1219 {
1220  return m_drawMapToolButton;
1221 }
1222 
1224 {
1225  return m_objectToImageButton;
1226 }
1227 
1229 {
1230  return m_exitButton;
1231 }
1232 
1234 {
1235  return m_actionMapDefault;
1236 }
1237 
1239 {
1240  return m_actionLegendDefault;
1241 }
1242 
1244 {
1245  return m_actionScale;
1246 }
1247 
1249 {
1250  return m_actionMapZoomIn;
1251 }
1252 
1254 {
1255  return m_actionMapZoomOut;
1256 }
1257 
1259 {
1260  return m_actionMapPan;
1261 }
1262 
1264 {
1265  return m_actionMapSystematicScale;
1266 }
1267 
1269 {
1270  return m_actionMapCreateTextGrid;
1271 }
1272 
1274 {
1275  return m_actionMapCreateMapText;
1276 }
1277 
1279 {
1280  return m_actionMapCreateLegendChildAsObject;
1281 }
1282 
1284 {
1285  return m_actionGridMap;
1286 }
1287 
1289 {
1290  return m_actionGridPlanar;
1291 }
1292 
1294 {
1295  return m_actionGridGeodesic;
1296 }
1297 
1299 {
1300  return m_actionNorth;
1301 }
1302 
1304 {
1305  return m_actionMapLocation;
1306 }
1307 
1309 {
1310  return m_actionRectangle;
1311 }
1312 
1314 {
1315  return m_actionPoint;
1316 }
1317 
1319 {
1320  return m_actionEllipse;
1321 }
1322 
1324 {
1325  return m_actionArrow;
1326 }
1327 
1329 {
1330  return m_actionLine;
1331 }
1332 
1334 {
1335  return m_actionPolygon;
1336 }
1337 
1339 {
1340  return m_actionViewPan;
1341 }
1342 
1344 {
1345  return m_actionViewZoomIn;
1346 }
1347 
1349 {
1350  return m_actionViewZoomOut;
1351 }
1352 
1354 {
1355  return m_actionGroup;
1356 }
1357 
1359 {
1360  return m_actionUngroup;
1361 }
1362 
1364 {
1365  return m_actionLineIntersectionMouse;
1366 }
1367 
1369 {
1370  return m_actionSceneZoom;
1371 }
1372 
1374 {
1375  return m_actionRemoveObject;
1376 }
1377 
1379 {
1380  return m_actionTextDefault;
1381 }
1382 
1384 {
1385  return m_actionImage;
1386 }
1387 
1389 {
1390  return m_actionStringGrid;
1391 }
1392 
1394 {
1395  return m_actionTitle;
1396 }
1397 
1399 {
1400  return m_actionBalloon;
1401 }
1402 
1404 {
1405  return m_actionBarCode;
1406 }
1407 
1409 {
1410  return m_actionAlignLeft;
1411 }
1412 
1414 {
1415  return m_actionAlignRight;
1416 }
1417 
1419 {
1420  return m_actionAlignTop;
1421 }
1422 
1424 {
1425  return m_actionAlignBottom;
1426 }
1427 
1429 {
1430  return m_actionAlignCenterHorizontal;
1431 }
1432 
1434 {
1435  return m_actionAlignCenterVertical;
1436 }
1437 
1439 {
1440  return m_actionUndo;
1441 }
1442 
1444 {
1445  return m_actionRedo;
1446 }
1447 
1449 {
1450  return m_actionDrawMap;
1451 }
1452 
1454 {
1455  return m_actionObjectToImage;
1456 }
1457 
1459 {
1460  return m_actionExit;
1461 }
1462 
1464 {
1465  return m_actionExportToPDF;
1466 }
1467 
1469 {
1470  return m_actionMapToolButton;
1471 }
1472 
1474 {
1475  return m_actionMapToolsToolButton;
1476 }
1477 
1479 {
1480  return m_actionGeometryToolButton;
1481 }
1482 
1484 {
1485  return m_actionViewAreaToolButton;
1486 }
1487 
1489 {
1490  return m_actionArrowCursorButton;
1491 }
1492 
1494 {
1495  return m_actionItemTools;
1496 }
1497 
1499 {
1500  return m_actionLineIntersectionToolButton;
1501 }
1502 
1504 {
1505  return m_actionBringToFrontToolButton;
1506 }
1507 
1509 {
1510  return m_actionSendToBackToolButton;
1511 }
1512 
1514 {
1515  return m_actionRecomposeToolButton;
1516 }
1517 
1519 {
1520  return m_actionTextToolButton;
1521 }
1522 
1524 {
1525  return m_actionAlignLeftToolButton;
1526 }
1527 
1529 {
1530  return m_actionAlignRightToolButton;
1531 }
1532 
1534 {
1535  return m_actionAlignTopToolButton;
1536 }
1537 
1539 {
1540  return m_actionAlignBottomToolButton;
1541 }
1542 
1544 {
1545  return m_actionAlignCenterHorizontalToolButton;
1546 }
1547 
1549 {
1550  return m_actionAlignCenterVerticalToolButton;
1551 }
1552 
1554 {
1555  return m_actionRemoveObjectToolButton;
1556 }
1557 
1559 {
1560  return m_actionUndoToolButton;
1561 }
1562 
1564 {
1565  return m_actionDrawMapToolButton;
1566 }
1567 
1569 {
1570  return m_actionObjectToImageButton;
1571 }
1572 
1574 {
1575  return m_actionExitButton;
1576 }
1577 
1579 {
1580  return m_actionComboZoom;
1581 }
1582 
1583 
1584 
virtual EnumType * getModeObjectToImage() const
Returns value that represents object to image (MVC Component to image. Ex.: .png) mode type belonging...
Abstract class to represent an observable. "Model" part of MVC component.
Definition: Observable.h:56
Class responsible for maintaining the drawing context of a MVC component. It is always used by the "M...
Definition: ContextItem.h:49
virtual QToolButton * getUndoToolButton()
virtual EnumType * getModeCreateTextGrid() const
Returns value that represents create text grid mode type belonging to enumeration.
virtual QToolButton * getRecomposeToolButton()
virtual QToolButton * getAlignCenterVerticalToolButton()
virtual void onItemToolsTriggered(QAction *action)
virtual QToolButton * getAlignTopToolButton()
virtual QAction * getActionViewAreaToolButton()
virtual QAction * getActionDrawMapToolButton()
virtual EnumType * getModeDrawSelectionMap() const
Returns value that represents draw selection map (MapDisplay proxy) mode type belonging to enumeratio...
virtual QToolButton * createObjectToImageButton()
virtual QAction * getActionAlignLeftToolButton()
virtual void onAlignRightClicked(bool checked)
virtual QAction * getActionMapToolsToolButton()
virtual te::gm::Coord2D getPosition()
Method that returns the position llx, lly Reimplement this function in a ItemObserver subclass to pro...
double y
y-coordinate.
Definition: Coord2D.h:114
virtual QAction * getActionArrowCursorButton()
virtual QToolButton * createMapToolButton()
virtual EnumType * getModeSendToBack() const
Returns value that represents send to back mode type belonging to enumeration.
virtual QToolButton * createToolButton(std::string text, std::string tooltip, std::string icon)
virtual QComboBox * createSceneZoomCombobox()
virtual QAction * getActionItemTools()
virtual EnumType * getModeRecompose() const
Returns value that represents recompose mode type belonging to enumeration.
virtual EnumType * getModeBringToFront() const
Returns value that represents bring to front mode type belonging to enumeration.
virtual QToolButton * createGeometryToolButton()
virtual EnumType * getModeExportToPDF() const
Returns value that represents export to PDF mode type belonging to enumeration.
virtual EnumModeType * getEnumModeType()
Returns mode type enumeration.
Definition: Enums.cpp:92
virtual QAction * getActionBringToFrontToolButton()
virtual EnumType * getModeMapZoomIn() const
Returns value that represents map zoom in mode type belonging to enumeration.
double x
x-coordinate.
Definition: Coord2D.h:113
virtual void onSceneZoomCurrentIndexChanged(int index)
void setZoomFactor(double zoomFactor)
Change current zoom factor. Ex.: 0.5 (50%)
Definition: Context.cpp:108
virtual QToolButton * getDrawMapToolButton()
std::string getActionLineIntersectionMouse()
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 QAction * getActionRecomposeToolButton()
virtual QPushButton * createPushButton(std::string text, std::string tooltip, std::string icon)
virtual QToolButton * createLineIntersectionToolButton()
virtual QToolButton * createUndoToolButton()
virtual EnumType * getModeMapCreateTextGrid() const
Returns value that represents create text grid (vectorize) mode type belonging to enumeration...
virtual QToolButton * createBringToFrontToolButton()
Abstract class to represent an observer. "View" part of MVC widget. All classes representing the grap...
virtual void changeAction(EnumType *mode)
virtual QToolButton * getRemoveObjectToolButton()
virtual void onRecomposeClicked(bool checked)
virtual EnumType * getModeLegendChildAsObject() const
Returns value that represents legend child as object (vectorize) mode type belonging to enumeration...
virtual void onExitClicked(bool checked)
virtual QToolButton * createExitButton()
virtual QToolButton * createDrawMapToolButton()
virtual QAction * getActionUndoToolButton()
virtual EnumType * getModeUngroup() const
Returns value that represents ungroup mode type belonging to enumeration.
virtual QToolButton * getAlignCenterHorizontalToolButton()
An utility struct for representing 2D coordinates.
Definition: Coord2D.h:40
virtual EnumType * getModeCoordWait() const
Returns value that represents wait coordinate mode type belonging to enumeration. ...
std::string getActionAlignCenterHorizontal()
virtual QToolButton * getAlignRightToolButton()
virtual QToolButton * getAlignLeftToolButton()
virtual QToolButton * createArrowCursorButton()
virtual EnumType * getModeSceneZoom() const
Returns value that represents scene zoom mode type belonging to enumeration.
virtual QAction * getActionSendToBackToolButton()
virtual void onViewAreaTriggered(QAction *action)
virtual QAction * getActionGeometryToolButton()
virtual QAction * getActionRemoveObjectToolButton()
virtual QAction * createAction(std::string text, std::string objName, std::string icon, std::string tooltip="", QWidget *parent=0)
virtual QAction * getActionMapToolButton()
virtual QToolButton * getObjectToImageButton()
virtual EnumType * getModeZoomOut() const
Returns value that represents zoom out mode type belonging to enumeration.
virtual EnumType * getModeExit() const
Returns value that represents exit mode type belonging to enumeration.
virtual EnumType * getModeCreateLegend() const
Returns value that represents create legend mode type belonging to enumeration.
virtual void onMapToolsTriggered(QAction *action)
virtual EnumType * getModeAlignCenterVertical() const
Returns value that represents align center vertical mode type belonging to enumeration.
std::string getActionMapCreateTextGrid()
virtual QToolButton * createTextToolButton()
virtual void onBringToFrontClicked(bool checked)
virtual QAction * getActionAlignTopToolButton()
virtual EnumType * getModeActiveLinesIntersectionMouse() const
Returns value that represents active lines intersection mouse mode type belonging to enumeration...
virtual QToolButton * getTextToolButton()
virtual void onExportToPDFClicked(bool checked)
virtual void onAlignCenterVerticalClicked(bool checked)
virtual QToolButton * createMapToolsToolButton()
virtual QToolButton * createAlignLeftToolButton()
Standard Toolbar for Layout. Includes Qt components for interaction between the user and the plugin/a...
virtual EnumType * getModeCreateTitle() const
Returns value that represents create title mode type belonging to enumeration.
static Context & 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...
Definition: EnumModeType.h:50
virtual void onArrowCursorClicked(bool checked)
virtual QUndoStack * getUndoStack()
Method that return stack of Undo/Redo.
Definition: Scene.cpp:328
std::string getActionMapSystematicScale()
virtual EnumType * getModeCreateMapLocation() const
Returns value that represents create map location mode type belonging to enumeration.
virtual void onRemoveObjectClicked(bool checked)
virtual EnumType * getModeAlignRight() const
Returns value that represents align right mode type belonging to enumeration.
virtual QToolButton * createSendToBackToolButton()
virtual void onSendToBackClicked(bool checked)
virtual QComboBox * getComboBoxZoom()
virtual EnumType * getModeCreatePolygon() const
Returns value that represents create polygon mode type belonging to enumeration.
virtual void onChangeZoom(double factor)
virtual EnumType * getModeOffLinesIntersectionMouse() const
Returns value that represents off lines intersection mouse mode type belonging to enumeration...
virtual QToolButton * getMapToolButton()
virtual EnumType * getModeCreateGridMap() const
Returns value that represents wait coordinate mode type belonging to enumeration. ...
virtual QAction * getActionTextToolButton()
virtual void updateObserver(ContextItem context)
Reimplemented from Observer.
virtual EnumType * getModeMapPan() const
Returns value that represents map pan mode type belonging to enumeration.
virtual QToolButton * createItemTools()
virtual QToolButton * getMapToolsToolButton()
EnumType * getMode()
Returns value of the enumeration of mode type.
Definition: Context.cpp:75
virtual QToolButton * getGeometryToolButton()
virtual void onLineIntersectionMouse(bool checked)
Class representing the scene. This scene is child of QGraphicsScene, part of Graphics View Framework...
Definition: Scene.h:80
std::string getActionAlignCenterVertical()
virtual EnumType * getModeAlignLeft() const
Returns value that represents align left mode type belonging to enumeration.
virtual EnumType * getModePan() const
Returns value that represents pan mode type belonging to enumeration.
virtual EnumType * getModeCreateLine() const
Returns value that represents create line mode type belonging to enumeration.
virtual EnumType * getModeAlignBottom() const
Returns value that represents align bottom mode type belonging to enumeration.
virtual EnumType * getModeAlignCenterHorizontal() const
Returns value that represents align center horizontal mode type belonging to enumeration.
virtual QToolButton * createExportToPDFButton()
virtual QToolButton * createViewAreaToolButton()
virtual EnumType * getModeGroup() const
Returns value that represents group mode type belonging to enumeration.
virtual QToolButton * getExitButton()
virtual QAction * getActionLineIntersectionToolButton()
virtual void setPosition(const double &x, const double &y)
Change coordinate llx,lly of the MVC widget. Reimplement this function in a ItemController subclass t...
virtual EnumType * getModeMapZoomOut() const
Returns value that represents map zoom out mode type belonging to enumeration.
std::string getActionMapCreateLegendChildAsObject()
virtual EnumType * getModeCreateEllipse() const
Returns value that represents create ellipse mode type belonging to enumeration.
virtual void onGeometryTriggered(QAction *action)
virtual QAction * getActionAlignCenterHorizontalToolButton()
virtual EnumType * getModeZoomIn() const
Returns value that represents zoom in mode type belonging to enumeration.
void setWait(EnumType *wait)
Definition: Context.cpp:283
Class that represents the value of an enumeration. An enumeration is made of "1..n" objects EnumType...
Definition: EnumType.h:48
virtual EnumType * getModeMapCreateTextMap() const
Returns value that represents create text map (vectorize) mode type belonging to enumeration.
virtual void onAlignCenterHorizontalClicked(bool checked)
virtual QAction * getActionAlignRightToolButton()
virtual void onAlignLeftClicked(bool checked)
virtual QToolButton * getSendToBackToolButton()
virtual EnumType * getModeCreatePoint() const
Returns value that represents create point mode type belonging to enumeration.
virtual EnumType * getModeCreateNorth() const
Returns value that represents create north mode type belonging to enumeration.
EnumType * getLineIntersectionMouseMode()
Definition: Context.cpp:218
virtual QAction * getActionComboBoxZoom()
void setDefaultZoomFactor(double zoomFactor)
Change default zoom factor. Ex.: 0.5 (50%)
Definition: Context.cpp:233
virtual QToolButton * getViewAreaToolButton()
virtual void onAlignBottomClicked(bool checked)
virtual void onDrawMapClicked(bool checked)
void setMode(EnumType *mode)
Change value of the enumeration of mode type. Ex.: select, pan, create text, etc. The type of mode is...
Definition: Context.cpp:93
virtual QToolButton * getItemTools()
virtual QToolButton * getArrowCursorButton()
ToolbarOutside(OutsideController *controller, Observable *o)
virtual EnumType * getModeCreateBarCode() const
Returns value that represents wait coordinate mode type belonging to enumeration. ...
AbstractScene * getScene()
Returns abstract scene for QGraphicsScene class, part of Graphics View Framework. ...
Definition: Context.cpp:88
virtual EnumType * getModeCreateBalloon() const
Returns value that represents create balloon mode type belonging to enumeration.
virtual QAction * getActionAlignBottomToolButton()
std::string getActionMapCreateMapText()
virtual EnumType * getModeCreateGridPlanar() const
Returns value that represents create grid planar mode type belonging to enumeration.
virtual QToolButton * createAlignRightToolButton()
virtual EnumType * getModeArrowCursor() const
Returns value that represents arrow mode type belonging to enumeration.
virtual EnumType * getModeCreateScale() const
Returns value that represents create scale mode type belonging to enumeration.
virtual EnumType * getModeSystematicScale() const
Returns value that represents systematic scale mode type belonging to enumeration.
virtual void onTextToolsTriggered(QAction *action)
virtual EnumType * getModeCreateArrow() const
Returns value that represents create arrow mode type belonging to enumeration.
Abstract class to represent a controller. "Controller" part of MVC widget. All classes representing t...
double getZoomFactor()
Returns current zoom factor. Ex.: 0.5 (50%)
Definition: Context.cpp:103
virtual QToolButton * createAlignTopToolButton()
virtual QToolButton * createAlignCenterHorizontalToolButton()
void setOldZoomFactor(double zoomFactor)
Change previous zoom factor. Ex.: 0.5 (50%)
Definition: Context.cpp:243
virtual QAction * getActionExitButton()
virtual EnumType * getModeRemoveObject() const
Returns value that represents remove object (MVC component) mode type belonging to enumeration...
virtual QToolButton * createRecomposeToolButton()
virtual EnumType * getModeCreateMap() const
Returns value that represents create map mode type belonging to enumeration.
virtual QToolButton * createRemoveObjectToolButton()
virtual QAction * getActionObjectToImageButton()
virtual QToolButton * getBringToFrontToolButton()
virtual void onMapTriggered(QAction *action)
virtual QAction * getActionAlignCenterVerticalToolButton()
virtual QToolButton * createAlignCenterVerticalToolButton()
virtual QToolButton * createAlignBottomToolButton()
virtual EnumType * getModeCreateImage() const
Returns value that represents create image mode type belonging to enumeration.
virtual void onObjectToImageClicked(bool checked)
virtual QToolButton * getLineIntersectionToolButton()
virtual EnumType * getModeCreateGridGeodesic() const
Returns value that represents create grid geodesic mode type belonging to enumeration.
void setLineIntersectionMouseMode(EnumType *mode)
Definition: Context.cpp:223
virtual QToolButton * getAlignBottomToolButton()
virtual EnumType * getModeAlignTop() const
Returns value that represents align top mode type belonging to enumeration.
virtual void onAlignTopClicked(bool checked)