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

Method initImpl

apps/modeler/src/surface_actor_item.cpp:57–90  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

NewFunction · 0.85
SetPointsMethod · 0.45

Tested by

no test coverage detected