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
8namespace armarx::viz
9{
10
11 Path&
13 {
14 data_->points.clear();
15
16 return *this;
17 }
18
19 Path&
20 Path::width(float w)
21 {
22 data_->lineWidth = w;
23
24 return *this;
25 }
26
27 Path&
28 Path::points(std::vector<Eigen::Vector3f> const& ps)
29 {
30 auto& points = data_->points;
31 points.clear();
32 points.reserve(ps.size());
33
34 std::transform(ps.begin(),
35 ps.end(),
36 std::back_inserter(points),
37 [](const auto& e) { return ToBasicVectorType(e); });
38
39 return *this;
40 }
41
42 Path&
43 Path::addPoint(Eigen::Vector3f p)
44 {
45 data_->points.emplace_back(ToBasicVectorType(p));
46
47 return *this;
48 }
49
50} // namespace armarx::viz
IceInternal::Handle< data::ElementPath > data_
Definition ElementOps.h:315
Path & points(std::vector< Eigen::Vector3f > const &ps)
Definition Path.cpp:28
Path & clear()
Definition Path.cpp:12
Path & width(float w)
Definition Path.cpp:20
Path & addPoint(Eigen::Vector3f p)
Definition Path.cpp:43
This file is part of ArmarX.