mirror of
https://github.com/opencv/opencv.git
synced 2024-12-16 18:39:12 +08:00
19 lines
570 B
C++
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);
|
|
}
|