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 "Path.h"
#include <iterator>
#include <ArmarXCore/interface/core/BasicVectorTypes.h>
#include <ArmarXCore/interface/core/BasicVectorTypesHelpers.h>
namespace armarx::viz namespace armarx::viz
{ {
Path& Path::clear() Path& Path::clear()
{ {
data_->points.clear(); data_->points.clear();
return *this;
}
Path& Path::lineColor(Color color)
{
data_->lineColor = color;
return *this; return *this;
} }
Path& Path::lineColorGlasbeyLUT(std::size_t id, int alpha) Path& Path::width(float w)
{
return lineColor(Color::fromRGBA(simox::color::GlasbeyLUT::at(id, alpha)));
}
Path& Path::lineWidth(float w)
{ {
data_->lineWidth = w; data_->lineWidth = w;
...@@ -33,17 +27,21 @@ namespace armarx::viz ...@@ -33,17 +27,21 @@ namespace armarx::viz
auto& points = data_->points; auto& points = data_->points;
points.clear(); points.clear();
points.reserve(ps.size()); 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; return *this;
} }
Path& Path::addPoint(Eigen::Vector3f p) 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; return *this;
} }
......
...@@ -35,17 +35,7 @@ namespace armarx::viz ...@@ -35,17 +35,7 @@ namespace armarx::viz
Path& clear(); Path& clear();
Path& lineColor(Color color); Path& width(float w);
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& points(std::vector<Eigen::Vector3f> const& ps); Path& points(std::vector<Eigen::Vector3f> const& ps);
......
...@@ -104,7 +104,6 @@ module data ...@@ -104,7 +104,6 @@ module data
{ {
Vector3fSeq points; Vector3fSeq points;
Color lineColor;
float lineWidth = 10.0f; 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