Layer.h
Go to the documentation of this file.
1#pragma once
2
3#include <ArmarXCore/interface/core/BasicVectorTypes.h>
4
5#include <RobotAPI/interface/ArViz/Component.h>
6
7#include "Elements.h"
8
9namespace armarx::viz
10{
11
12 struct Layer
13 {
14 Layer() = default;
15
16 Layer(std::string const& component, std::string const& name)
17 {
18 data_.component = component;
19 data_.name = name;
20 data_.action = data::Layer_CREATE_OR_UPDATE;
21 }
22
23 void
25 {
26 data_.elements.clear();
27 }
28
29 template <typename ElementT>
30 void
31 add(ElementT const& element)
32 {
33 data_.elements.push_back(element.data_);
34 }
35
36 // template <typename ElementT>
37 // void add(std::vector<ElementT> const& elements)
38 // {
39 // for (ElementT const& e : elements)
40 // {
41 // add(e);
42 // }
43 // }
44
45 void
47 {
48 data_.action = data::LayerAction::Layer_DELETE;
49 }
50
51 std::size_t
52 size() const noexcept
53 {
54 return data_.elements.size();
55 }
56
57 data::LayerUpdate data_;
58 };
59
60} // namespace armarx::viz
This file is part of ArmarX.
std::size_t size() const noexcept
Definition Layer.h:52
void markForDeletion()
Definition Layer.h:46
data::LayerUpdate data_
Definition Layer.h:57
void add(ElementT const &element)
Definition Layer.h:31
Layer(std::string const &component, std::string const &name)
Definition Layer.h:16