widget2d setcolor implementation

This commit is contained in:
ozantonkal 2013-07-09 14:28:55 +02:00
parent 318b1c00a9
commit 10d955f18b
2 changed files with 11 additions and 0 deletions
modules/viz
include/opencv2/viz
src

@ -53,6 +53,8 @@ namespace temp_viz
Widget2D() {}
Widget2D(const Widget &other);
Widget2D& operator=(const Widget &other);
void setColor(const Color &color);
};

@ -182,4 +182,13 @@ temp_viz::Widget2D& temp_viz::Widget2D::operator=(const Widget &other)
CV_Assert(actor);
Widget::operator=(other);
return *this;
}
void temp_viz::Widget2D::setColor(const Color &color)
{
vtkActor2D *actor = vtkActor2D::SafeDownCast(WidgetAccessor::getActor(*this));
CV_Assert(actor);
Color c = vtkcolor(color);
actor->GetProperty ()->SetColor (c.val);
actor->Modified ();
}