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