MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / initImpl

Method initImpl

apps/modeler/src/points_actor_item.cpp:56–88  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

54
55//////////////////////////////////////////////////////////////////////////////////////////////
56void
57pcl::modeler::PointsActorItem::initImpl()
58{
59 poly_data_->SetPoints(cloud_mesh_->getVtkPoints());
60
61 vtkSmartPointer<vtkVertexGlyphFilter> vertex_glyph_filter =
62 vtkSmartPointer<vtkVertexGlyphFilter>::New();
63 vertex_glyph_filter->AddInputData(poly_data_);
64 vertex_glyph_filter->Update();
65
66 vtkSmartPointer<vtkDataSetMapper> mapper = vtkSmartPointer<vtkDataSetMapper>::New();
67 mapper->SetInputConnection(vertex_glyph_filter->GetOutputPort());
68
69 vtkSmartPointer<vtkDataArray> scalars;
70 cloud_mesh_->getColorScalarsFromField(scalars, color_scheme_);
71 poly_data_->GetPointData()->SetScalars(scalars);
72
73 double minmax[2];
74 scalars->GetRange(minmax);
75 mapper->SetScalarRange(minmax);
76
77 mapper->SetScalarModeToUsePointData();
78 mapper->InterpolateScalarsBeforeMappingOn();
79 mapper->ScalarVisibilityOn();
80
81 vtkSmartPointer<vtkLODActor> actor =
82 vtkSmartPointer<vtkLODActor>(dynamic_cast<vtkLODActor*>(actor_.GetPointer()));
83 actor->SetMapper(mapper);
84
85 actor->SetNumberOfCloudPoints(
86 int(std::max<vtkIdType>(1, poly_data_->GetNumberOfPoints() / 10)));
87 actor->GetProperty()->SetInterpolationToFlat();
88}
89
90//////////////////////////////////////////////////////////////////////////////////////////////
91void

Callers

nothing calls this directly

Calls 3

NewFunction · 0.85
SetPointsMethod · 0.45

Tested by

no test coverage detected