How can i remove a vertex at some index?
someting like …
removeVertexAtIndex(int index);
How can i remove a vertex at some index?
someting like …
removeVertexAtIndex(int index);
I haven’t test this, but how about
myPolyline.getVertices().remove( myPolyline.getVertices().begin() + index);
Thanks this is a solution i found
not sure if it is good or not yet but works
(for cases index -1, only one element, over max index)
void my_ofPolylineRemoveVertexAtIndex(ofPolyline &p, int index)
{
int polyLine_length = p.getVertices().size();
if(index>=0)
{
if(index<polyLine_length)
{
if(polyLine_length > 1)
{
p.getVertices().erase(p.getVertices().begin() + index);
p.flagHasChanged();
}
else
{
p.clear();
}
}
}
}