Skip to content
Snippets Groups Projects
Commit b7407d85 authored by Fabian Reister's avatar Fabian Reister
Browse files

Arviz Path element: simplified implementation; removed lineColor

parent 7afb8465
No related branches found
No related tags found
No related merge requests found
#include "Path.h"
#include <iterator>
#include <ArmarXCore/interface/core/BasicVectorTypes.h>
#include <ArmarXCore/interface/core/BasicVectorTypesHelpers.h>
namespace armarx::viz
{
Path& Path::clear()
{
data_->points.clear();
return *this;
}
Path& Path::lineColor(Color color)
{
data_->lineColor = color;
return *this;
}
Path& Path::lineColorGlasbeyLUT(std::size_t id, int alpha)
{
return lineColor(Color::fromRGBA(simox::color::GlasbeyLUT::at(id, alpha)));
}
Path& Path::lineWidth(float w)
Path& Path::width(float w)
{
data_->lineWidth = w;
......@@ -33,17 +27,21 @@ namespace armarx::viz
auto& points = data_->points;
points.clear();
points.reserve(ps.size());
for (auto& p : ps)
std::transform(ps.begin(),
ps.end(),
std::back_inserter(points),
[](const auto & e)
{
points.push_back(armarx::Vector3f{p.x(), p.y(), p.z()});
}
return ToBasicVectorType(e);
});
return *this;
}
Path& Path::addPoint(Eigen::Vector3f p)
{
data_->points.push_back(armarx::Vector3f{p.x(), p.y(), p.z()});
data_->points.emplace_back(ToBasicVectorType(p));
return *this;
}
......
......@@ -35,17 +35,7 @@ namespace armarx::viz
Path& clear();
Path& lineColor(Color color);
template<class...Ts>
Path& lineColor(Ts&& ...ts)
{
return lineColor({std::forward<Ts>(ts)...});
}
Path& lineColorGlasbeyLUT(std::size_t id, int alpha = 255);
Path& lineWidth(float w);
Path& width(float w);
Path& points(std::vector<Eigen::Vector3f> const& ps);
......
......@@ -104,7 +104,6 @@ module data
{
Vector3fSeq points;
Color lineColor;
float lineWidth = 10.0f;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment