opencv/modules/viz/src/simple_widgets.cpp
2013-07-04 13:54:00 +04:00

19 lines
570 B
C++

#include "precomp.hpp"
temp_viz::LineWidget::LineWidget(const Point3f &pt1, const Point3f &pt2, const Color &color)
{
vtkSmartPointer<vtkLineSource> line = vtkSmartPointer<vtkLineSource>::New();
line->SetPoint1 (pt1.x, pt1.y, pt1.z);
line->SetPoint2 (pt2.x, pt2.y, pt2.z);
line->Update ();
vtkSmartPointer<vtkDataSetMapper> mapper = vtkSmartPointer<vtkDataSetMapper>::New ();
mapper->SetInput(line->GetOutput ());
vtkSmartPointer<vtkLODActor> actor = WidgetAccessor::getActor(*this);
actor->SetMapper(mapper);
setColor(color);
}