VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
annotation.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2025-2026 Arnis Lektauers
3//
4//
5#pragma once
6
7#include <string>
8
9#include "script.h"
10#include "scriptRegistry.h"
11
12namespace visutwin::canvas
13{
14 class Engine;
15
33 class Annotation : public Script
34 {
35 public:
36 SCRIPT_NAME("annotation")
37
38 // Expose entity() as public so AnnotationManager can access the owning entity
39 using Script::entity;
40
41 const std::string& label() const { return _label; }
42 void setLabel(const std::string& value)
43 {
44 _label = value;
45 fire("label:set", value);
46 }
47
48 const std::string& title() const { return _title; }
49 void setTitle(const std::string& value)
50 {
51 _title = value;
52 fire("title:set", value);
53 }
54
55 const std::string& text() const { return _text; }
56 void setText(const std::string& value)
57 {
58 _text = value;
59 fire("text:set", value);
60 }
61
67 void activate();
68
69 private:
70 std::string _label;
71 std::string _title;
72 std::string _text;
73 };
74}
75
void setTitle(const std::string &value)
Definition annotation.h:49
void setText(const std::string &value)
Definition annotation.h:56
const std::string & text() const
Definition annotation.h:55
const std::string & label() const
Definition annotation.h:41
void setLabel(const std::string &value)
Definition annotation.h:42
Entity * entity() const
Definition script.h:71
const std::string & title() const
Definition annotation.h:48
Central application orchestrator managing scenes, rendering, input, and resource loading.
Definition engine.h:38
EventHandler * fire(const std::string &name, Args &&... args)
#define SCRIPT_NAME(Name)
Definition script.h:10
#define REGISTER_SCRIPT(Type, Name)