widget2d setcolor implementation

pull/1453/head
ozantonkal 12 years ago
parent 318b1c00a9
commit 10d955f18b
  1. 2
      modules/viz/include/opencv2/viz/widgets.hpp
  2. 9
      modules/viz/src/widget.cpp

@ -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 ();
}
Loading…
Cancel
Save