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