trikRuntime
displayInterface.h
Go to the documentation of this file.
1 /* Copyright 2015 CyberTech Labs Ltd.
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License. */
14 
15 #pragma once
16 
17 #include <QtCore/QObject>
18 #include <QtCore/QString>
19 #include <QVector>
20 
21 #include "displayWidgetInterface.h"
22 
23 #include "declSpec.h"
24 
25 namespace trikControl {
26 
28 class TRIKCONTROL_EXPORT DisplayInterface : public QObject
29 {
30  Q_OBJECT
31 
32 public:
34  virtual DisplayWidgetInterface &graphicsWidget() = 0;
35 
36 public slots:
40  virtual void showImage(const QString &fileName) = 0;
41 
48  virtual void show(const QVector<int32_t> &array, int width, int height, const QString &format) = 0;
49 
55  virtual void addLabel(const QString &text, int x, int y) = 0;
56 
58  virtual void removeLabels() = 0;
59 
61  virtual void setPainterColor(const QString &color) = 0;
62 
64  virtual void setPainterWidth(int penWidth) = 0;
65 
71  virtual void drawLine(int x1, int y1, int x2, int y2) = 0;
72 
76  virtual void drawPoint(int x, int y) = 0;
77 
84  virtual void drawRect(int x, int y, int width, int height, bool filled = false) = 0;
85 
92  virtual void drawEllipse(int x, int y, int width, int height, bool filled = false) = 0;
93 
101  virtual void drawArc(int x, int y, int width, int height, int startAngle, int spanAngle) = 0;
102 
105  virtual void setBackground(const QString &color) = 0;
106 
108  virtual void hide() = 0;
109 
111  virtual void clear() = 0;
112 
114  virtual void reset() = 0;
115 
118  virtual void redraw() = 0;
119 };
120 
121 }
122 
123 Q_DECLARE_METATYPE(trikControl::DisplayInterface *)
Interface for widget on which Brick draws its graphics. Can notify when it shows or hides itself...
Definition: displayWidgetInterface.h:30
#define TRIKCONTROL_EXPORT
Definition: declSpec.h:23
Definition: trikCommunicator.h:27
Provides ability to draw something on robot display.
Definition: displayInterface.h:28
var x
Definition: file-test.js:2
var y
Definition: file-test.js:5