Path.cpp
Go to the documentation of this file.
1 #include "Path.h"
2 
3 #include <iterator>
4 
5 #include <ArmarXCore/interface/core/BasicVectorTypes.h>
6 #include <ArmarXCore/interface/core/BasicVectorTypesHelpers.h>
7 
8 namespace armarx::viz
9 {
10 
12  {
13  data_->points.clear();
14 
15  return *this;
16  }
17 
18  Path& Path::width(float w)
19  {
20  data_->lineWidth = w;
21 
22  return *this;
23  }
24 
25  Path& Path::points(std::vector<Eigen::Vector3f> const& ps)
26  {
27  auto& points = data_->points;
28  points.clear();
29  points.reserve(ps.size());
30 
31  std::transform(ps.begin(),
32  ps.end(),
33  std::back_inserter(points),
34  [](const auto & e)
35  {
36  return ToBasicVectorType(e);
37  });
38 
39  return *this;
40  }
41 
42  Path& Path::addPoint(Eigen::Vector3f p)
43  {
44  data_->points.emplace_back(ToBasicVectorType(p));
45 
46  return *this;
47  }
48 
49 } // namespace armarx::viz
Path.h
armarx::viz::Path::clear
Path & clear()
Definition: Path.cpp:11
armarx::viz::Path::addPoint
Path & addPoint(Eigen::Vector3f p)
Definition: Path.cpp:42
armarx::viz::ElementOps< Path, data::ElementPath >::data_
IceInternal::Handle< data::ElementPath > data_
Definition: ElementOps.h:281
armarx::transform
auto transform(const Container< InputT, Alloc > &in, OutputT(*func)(InputT const &)) -> Container< OutputT, typename std::allocator_traits< Alloc >::template rebind_alloc< OutputT > >
Convenience function (with less typing) to transform a container of type InputT into the same contain...
Definition: algorithm.h:315
armarx::viz::Path::points
Path & points(std::vector< Eigen::Vector3f > const &ps)
Definition: Path.cpp:25
armarx::viz::Path
Definition: Path.h:31
armarx::viz::Path::width
Path & width(float w)
Definition: Path.cpp:18
armarx::viz
This file is part of ArmarX.
Definition: ArVizStorage.cpp:416