Skip to content
Snippets Groups Projects
Commit 40a16a46 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Add overloads taking std::vector

parent 97a5760a
No related branches found
No related tags found
No related merge requests found
......@@ -290,7 +290,7 @@ namespace armarx::viz
public:
using ElementOps::ElementOps;
Mesh& vertices(Eigen::Vector3f* vs, std::size_t size)
Mesh& vertices(const Eigen::Vector3f* vs, std::size_t size)
{
auto& vertices = data_->vertices;
vertices.clear();
......@@ -303,27 +303,43 @@ namespace armarx::viz
return *this;
}
Mesh& vertices(const std::vector<Eigen::Vector3f>& vs)
{
return this->vertices(vs.data(), vs.size());
}
Mesh& vertices(armarx::Vector3f* vs, std::size_t size)
Mesh& vertices(const armarx::Vector3f* vs, std::size_t size)
{
data_->vertices.assign(vs, vs + size);
return *this;
}
Mesh& vertices(const std::vector<armarx::Vector3f>& vs)
{
return this->vertices(vs.data(), vs.size());
}
Mesh& colors(data::Color* cs, std::size_t size)
Mesh& colors(const data::Color* cs, std::size_t size)
{
data_->colors.assign(cs, cs + size);
return *this;
}
Mesh& colors(const std::vector<data::Color>& cs)
{
return this->colors(cs.data(), cs.size());
}
Mesh& faces(data::Face* fs, std::size_t size)
Mesh& faces(const data::Face* fs, std::size_t size)
{
data_->faces.assign(fs, fs + size);
return *this;
}
Mesh& faces(const std::vector<data::Face>& fs)
{
return this->faces(fs.data(), fs.size());
}
};
class Robot : public ElementOps<Robot, data::ElementRobot>
......
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