-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBrokenLine.cpp
More file actions
29 lines (19 loc) · 792 Bytes
/
BrokenLine.cpp
File metadata and controls
29 lines (19 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "BrokenLine.h"
BrokenLine::BrokenLine() {};
vtkPoints* BrokenLine::GetPoints() {
return this->points;
}
void BrokenLine::SetPoints(vtkPoints* points) {
this->points = points;
}
void BrokenLine::build(vtkPoints* points, vtkSmartPointer<vtkRenderer> renderer) {
vtkSmartPointer<vtkLineSource> lineSource =
vtkSmartPointer<vtkLineSource>::New();
lineSource->SetPoints(points);
vtkSmartPointer<vtkPolyDataMapper> brokenLineMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
brokenLineMapper->SetInputConnection(lineSource->GetOutputPort());
vtkSmartPointer<vtkActor> brokenLineActor = vtkSmartPointer<vtkActor>::New();
brokenLineActor->SetMapper(brokenLineMapper);
brokenLineActor->GetProperty()->SetColor(0.32, 0.21, 0.123);
renderer->AddActor(brokenLineActor);
}