line widget set/get line width

pull/1453/head
ozantonkal 12 years ago
parent 158ed299c1
commit ba89a6a34a
  1. 3
      modules/viz/include/opencv2/viz/widgets.hpp
  2. 12
      modules/viz/src/simple_widgets.cpp
  3. 1
      modules/viz/test/test_viz3d.cpp

@ -38,6 +38,9 @@ namespace temp_viz
{
public:
LineWidget(const Point3f &pt1, const Point3f &pt2, const Color &color = Color::white());
void setLineWidth(float line_width);
float getLineWidth();
};

@ -16,3 +16,15 @@ temp_viz::LineWidget::LineWidget(const Point3f &pt1, const Point3f &pt2, const C
setColor(color);
}
void temp_viz::LineWidget::setLineWidth(float line_width)
{
vtkSmartPointer<vtkLODActor> actor = WidgetAccessor::getActor(*this);
actor->GetProperty()->SetLineWidth(line_width);
}
float temp_viz::LineWidget::getLineWidth()
{
vtkSmartPointer<vtkLODActor> actor = WidgetAccessor::getActor(*this);
return actor->GetProperty()->GetLineWidth();
}

@ -115,6 +115,7 @@ TEST(Viz_viz3d, accuracy)
v.setShapePose("sphere1", cloudPosition);
v.setShapePose("arrow1", cloudPosition);
lw2.setColor(temp_viz::Color(col_blue, col_green, col_red));
lw.setLineWidth(lw.getLineWidth()+pos_x * 10);
angle_x += 0.1f;
angle_y -= 0.1f;

Loading…
Cancel
Save