trikRuntime
display.h
Go to the documentation of this file.
1 /* Copyright 2013 - 2015 Yurii Litvinov, Smirnov Mikhail, Kogutich Denis
2  * and CyberTech Labs Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License. */
15 
16 #pragma once
17 
18 #include <QtCore/QThread>
19 #include <QtCore/QString>
20 
21 #include "displayInterface.h"
22 
23 namespace trikControl {
24 
25 class GuiWorker;
26 
28 class /* TRIKCONTROL_EXPORT for ScriptRunner/PythonQt */ TRIKCONTROL_EXPORT Display : public DisplayInterface
29 {
30  Q_OBJECT
31 
32 public:
36  explicit Display(const QString &mediaPath);
37 
38  ~Display() override;
39 
40  DisplayWidgetInterface &graphicsWidget() override;
41 
42 public slots:
43  void setBackground(const QString &color) override;
44  void showImage(const QString &fileName) override;
45 
46  void show(const QVector<int32_t> &array, int width, int height, const QString &format) override;
47 
48  void addLabel(const QString &text, int x, int y) override;
49  void removeLabels() override;
50 
51  void setPainterColor(const QString &color) override;
52  void setPainterWidth(int penWidth) override;
53 
54  void drawLine(int x1, int y1, int x2, int y2) override;
55  void drawPoint(int x, int y) override;
56  void drawRect(int x, int y, int width, int height, bool filled = false) override;
57  void drawEllipse(int x, int y, int width, int height, bool filled = false) override;
58  void drawArc(int x, int y, int width, int height, int startAngle, int spanAngle) override;
59 
60  void hide() override;
61  void clear() override;
62  void reset() override;
63  void redraw() override;
64 
65 private:
66  const QString mMediaPath;
67  GuiWorker *mGuiWorker; // Has ownership.
68 };
69 
70 }
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
Works in GUI thread and is responsible for all output to display.
Definition: guiWorker.h:38
var x
Definition: file-test.js:2
Implementation of display interface for real robot.
Definition: display.h:28
var y
Definition: file-test.js:5