Vivoe Lite 0.5.0
Lightweight GVA like HMI for military displays.
Loading...
Searching...
No Matches
object_localisation.h
1//
2// Copyright (c) 2023, DefenceX PTY LTD
3//
4// This file is part of the VivoeX project developed by DefenceX.
5//
6// Licensed under the Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
7// License. See the LICENSE file in the project root for full license details.
8//
12#ifndef HMICORE_WIDGETS_AI_OBJECT_LOCALISATION_H_
13#define HMICORE_WIDGETS_AI_OBJECT_LOCALISATION_H_
14
15#include <cstdint>
16#include <map>
17#include <memory>
18#include <string>
19#include <vector>
20
21#include "hmicore/events_gva.h"
24
25namespace gva {
26
29 public:
31 struct BoxType {
33 uint32_t xpos = 0;
35 uint32_t ypos = 0;
37 uint32_t height = 0;
39 uint32_t width = 0;
41 uint32_t rgb_value = 0x00FF0000; // green
43 std::string label = "";
45 bool flashing = false;
47 bool dotted = false;
48 };
49
56 explicit WidgetObjectLocalisation(const RendererGva& renderer, TouchGva* touch);
57
62 ~WidgetObjectLocalisation() final = default;
63
69 std::string GetWidgetName() const final { return "WidgetObjectLocalisation"; };
70
75 void Draw() final;
76
83 void AddBoundingBox(int16_t id, const BoxType& box);
84
90 void DeleteBoundingBox(int16_t id);
91
97
98 private:
105 void DrawFunctionBoundingBoxes() const;
106
113 GvaKeyEnum IdToKey(uint16_t id) const;
114
115 std::map<int16_t, std::shared_ptr<BoxType>> boxes_;
116 TouchGva* touch_;
117};
118
119} // namespace gva
120
121#endif // HMICORE_WIDGETS_AI_OBJECT_LOCALISATION_H_
Class definition of the GVA renderer.
Definition renderer_gva.h:29
Class defining the touch screen events.
Definition touch_gva.h:71
Class defining the bounding box object.
Definition object_localisation.h:28
bool flashing
Flashing if true.
Definition object_localisation.h:45
std::string label
The object label.
Definition object_localisation.h:43
void DeleteBoundingBox(int16_t id)
Delete a box by ID.
Definition object_localisation.cc:30
uint32_t height
The object height.
Definition object_localisation.h:37
uint32_t width
The object width.
Definition object_localisation.h:39
void Draw() final
The base overloaded Draw fuctions to draw this widget type.
Definition object_localisation.cc:20
std::string GetWidgetName() const final
Get the Widget Name attribute.
Definition object_localisation.h:69
bool dotted
Dotted if true.
Definition object_localisation.h:47
uint32_t rgb_value
The object RGB colour.
Definition object_localisation.h:41
uint32_t xpos
The object x position.
Definition object_localisation.h:33
uint32_t ypos
The object y position.
Definition object_localisation.h:35
~WidgetObjectLocalisation() final=default
Destroy the Widget Keyboard object.
void AddBoundingBox(int16_t id, const BoxType &box)
Add a box onto the object localisation overlay.
Definition object_localisation.cc:26
void DeleteAllBoundingBox()
Delete all box.
Definition object_localisation.cc:32
The bounding box data.
Definition object_localisation.h:31
Class defining the base widget.
Definition widget.h:27
GvaKeyEnum
These are physical GVA keys around the display.
Definition gva.h:67