/////////////////////////////////////////////////////////////////////////////////////////
| 54 | |
| 55 | ////////////////////////////////////////////////////////////////////////////////////////////// |
| 56 | void |
| 57 | pcl::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 | ////////////////////////////////////////////////////////////////////////////////////////////// |
| 91 | void |
nothing calls this directly
no test coverage detected