Loading...
Searching...
No Matches
ProcessGraphicsScene.h
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 terralib/process/qt/ProcessGraphicsScene.h
22
23 \brief A QGraphicsScebe to display a Process Builder items.
24*/
25
26#ifndef __TERRALIB_PROCESS_QT_INTERNAL_PROCESSGRAPHICSSCENE_H
27#define __TERRALIB_PROCESS_QT_INTERNAL_PROCESSGRAPHICSSCENE_H
28
29#include "../../Config.h"
30
31#include "../../Task.h"
32
33// Qt Includes
34#include <QGraphicsScene>
35
36// STL
37#include <string>
38
39namespace te
40{
41 namespace process
42 {
43 namespace qt
44 {
45 class ProcessManager;
46
47 class ConnectorGraphicsItem;
48 class HotPointGraphicsItem;
49 class TaskGraphicsItem;
50
51 /*!
52 \class ProcessGraphicsScene
53
54 \brief A Abstract QTreeWidgetItem Group of Process Builder items.
55
56 */
57 class TEPROCESSEXPORT ProcessGraphicsScene : public QGraphicsScene
58 {
59 Q_OBJECT
60
61 public:
62
63 /*! \brief Default constructor. */
64 ProcessGraphicsScene(ProcessManager* manager, QObject *parent = nullptr);
65
66 /*! \brief Virtual destructor. */
68
69 public:
70
71 void createTaskItem(te::process::TaskSharedPtr task, QPointF pos = QPointF());
72
74 te::process::qt::TaskGraphicsItem* taskToItem, HotPointGraphicsItem* hotPointToItem);
75
76 void alignSelecteds(Qt::Alignment alignment);
77
78 public slots:
79
80 void onRemovedTask(const std::string& taskId);
81
82 void onResetedTaskId(const std::string& id, const std::string& newId);
83
84 void onRemovedConnector(const std::string& connectorId);
85
86 protected:
87
88 /*!
89 \brief Virtual function to reimplement qt event.
90 */
91 virtual void dragEnterEvent(QGraphicsSceneDragDropEvent* event) override;
92
93 /*!
94 \brief Virtual function to reimplement qt event.
95 */
96 virtual void dragMoveEvent(QGraphicsSceneDragDropEvent *event) override;
97
98 /*!
99 \brief Virtual function to reimplement qt event.
100 */
101 virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *event) override;
102
103 /*!
104 \brief Virtual function to reimplement qt event.
105 */
106 virtual void dropEvent(QGraphicsSceneDragDropEvent* event) override;
107
108 /*!
109 \brief Virtual function to reimplement qt event.
110 */
111 virtual void keyPressEvent(QKeyEvent* event) override;
112
113 protected:
114
116 };
117 }
118 }
119}
120
121#endif // __TERRALIB_PROCESS_QT_INTERNAL_PROCESSGRAPHICSSCENE_H
A GraphicItem to represents Task parameters as hot point.
A Abstract QTreeWidgetItem Group of Process Builder items.
void onRemovedTask(const std::string &taskId)
void createConnectorItem(te::process::qt::TaskGraphicsItem *taskFromItem, HotPointGraphicsItem *hotPointFromItem, te::process::qt::TaskGraphicsItem *taskToItem, HotPointGraphicsItem *hotPointToItem)
virtual void keyPressEvent(QKeyEvent *event) override
Virtual function to reimplement qt event.
virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *event) override
Virtual function to reimplement qt event.
void createTaskItem(te::process::TaskSharedPtr task, QPointF pos=QPointF())
virtual void dropEvent(QGraphicsSceneDragDropEvent *event) override
Virtual function to reimplement qt event.
void onRemovedConnector(const std::string &connectorId)
ProcessGraphicsScene(ProcessManager *manager, QObject *parent=nullptr)
Default constructor.
void onResetedTaskId(const std::string &id, const std::string &newId)
void alignSelecteds(Qt::Alignment alignment)
~ProcessGraphicsScene()
Virtual destructor.
virtual void dragMoveEvent(QGraphicsSceneDragDropEvent *event) override
Virtual function to reimplement qt event.
virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *event) override
Virtual function to reimplement qt event.
A QObject class to handle with process management.
A GraphicItem to represents a Task Process Builder item.
TerraLib.
#define slots
#define TEPROCESSEXPORT
Definition Config.h:47