diff --git a/visualization/src/pcl_visualizer.cpp b/visualization/src/pcl_visualizer.cpp index f2eb40e4ff7..c3517bf9de7 100644 --- a/visualization/src/pcl_visualizer.cpp +++ b/visualization/src/pcl_visualizer.cpp @@ -698,6 +698,7 @@ pcl::visualization::PCLVisualizer::addCoordinateSystem (double scale, const std: vtkSmartPointer axes_actor = vtkSmartPointer::New (); axes_actor->SetMapper (axes_mapper); + axes_actor->SetPickable(false); // Save the ID and actor pair to the global actor map (*coordinate_actor_map_) [id] = axes_actor; @@ -740,6 +741,7 @@ pcl::visualization::PCLVisualizer::addCoordinateSystem (double scale, float x, f vtkSmartPointer axes_actor = vtkSmartPointer::New (); axes_actor->SetMapper (axes_mapper); axes_actor->SetPosition (x, y, z); + axes_actor->SetPickable(false); // Save the ID and actor pair to the global actor map (*coordinate_actor_map_) [id] = axes_actor; @@ -1408,7 +1410,7 @@ pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties ( // Check if the mapper has scalars if (!actor->GetMapper ()->GetInput ()->GetPointData ()->GetScalars ()) break; - + // Check that scalars are not unisgned char (i.e. check if a LUT is used to colormap scalars assuming vtk ColorMode is Default) if (actor->GetMapper ()->GetInput ()->GetPointData ()->GetScalars ()->IsA ("vtkUnsignedCharArray")) break; @@ -1419,7 +1421,7 @@ pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties ( PCL_WARN ("[setPointCloudRenderingProperties] Range max must be greater than range min!\n"); return (false); } - + // Update LUT actor->GetMapper ()->GetLookupTable ()->SetRange (val1, val2); actor->GetMapper()->UseLookupTableScalarRangeOn (); @@ -1571,7 +1573,7 @@ pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties ( // Check if the mapper has scalars if (!actor->GetMapper ()->GetInput ()->GetPointData ()->GetScalars ()) break; - + // Check that scalars are not unisgned char (i.e. check if a LUT is used to colormap scalars assuming vtk ColorMode is Default) if (actor->GetMapper ()->GetInput ()->GetPointData ()->GetScalars ()->IsA ("vtkUnsignedCharArray")) break; @@ -1579,7 +1581,7 @@ pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties ( // Get range limits from existing LUT double *range; range = actor->GetMapper ()->GetLookupTable ()->GetRange (); - + actor->GetMapper ()->ScalarVisibilityOn (); actor->GetMapper ()->SetScalarRange (range[0], range[1]); vtkSmartPointer table; @@ -1595,7 +1597,7 @@ pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties ( // Check if the mapper has scalars if (!actor->GetMapper ()->GetInput ()->GetPointData ()->GetScalars ()) break; - + // Check that scalars are not unisgned char (i.e. check if a LUT is used to colormap scalars assuming vtk ColorMode is Default) if (actor->GetMapper ()->GetInput ()->GetPointData ()->GetScalars ()->IsA ("vtkUnsignedCharArray")) break; @@ -1725,7 +1727,7 @@ pcl::visualization::PCLVisualizer::setShapeRenderingProperties ( // Check if the mapper has scalars if (!actor->GetMapper ()->GetInput ()->GetPointData ()->GetScalars ()) break; - + // Check that scalars are not unisgned char (i.e. check if a LUT is used to colormap scalars assuming vtk ColorMode is Default) if (actor->GetMapper ()->GetInput ()->GetPointData ()->GetScalars ()->IsA ("vtkUnsignedCharArray")) break; @@ -1736,7 +1738,7 @@ pcl::visualization::PCLVisualizer::setShapeRenderingProperties ( PCL_WARN ("[setShapeRenderingProperties] Range max must be greater than range min!\n"); return (false); } - + // Update LUT actor->GetMapper ()->GetLookupTable ()->SetRange (val1, val2); actor->GetMapper()->UseLookupTableScalarRangeOn (); @@ -1869,11 +1871,11 @@ pcl::visualization::PCLVisualizer::setShapeRenderingProperties ( // Check that scalars are not unisgned char (i.e. check if a LUT is used to colormap scalars assuming vtk ColorMode is Default) if (actor->GetMapper ()->GetInput ()->GetPointData ()->GetScalars ()->IsA ("vtkUnsignedCharArray")) break; - + // Get range limits from existing LUT double *range; range = actor->GetMapper ()->GetLookupTable ()->GetRange (); - + actor->GetMapper ()->ScalarVisibilityOn (); actor->GetMapper ()->SetScalarRange (range[0], range[1]); vtkSmartPointer table; @@ -3013,7 +3015,7 @@ pcl::visualization::PCLVisualizer::addPolygonMesh (const pcl::PolygonMesh &poly_ pcl::fromPCLPointCloud2 (poly_mesh.cloud, *point_cloud); poly_points->SetNumberOfPoints (point_cloud->size ()); - for (std::size_t i = 0; i < point_cloud->size (); ++i) + for (std::size_t i = 0; i < point_cloud->size (); ++i) { const pcl::PointXYZ& p = (*point_cloud)[i]; poly_points->InsertPoint (i, p.x, p.y, p.z); @@ -3183,7 +3185,7 @@ pcl::visualization::PCLVisualizer::updatePolygonMesh ( // Update the cells cells = vtkSmartPointer::New (); - + const auto idx = details::fillCells(lookup, verts, cells, max_size_of_polygon); cells->GetData ()->SetNumberOfValues (idx); @@ -3427,7 +3429,7 @@ pcl::visualization::PCLVisualizer::addTextureMesh (const pcl::TextureMesh &mesh, mapper->MapDataArrayToMultiTextureAttribute(tu, this_coordinates_name.c_str(), vtkDataObject::FIELD_ASSOCIATION_POINTS); - + polydata->GetPointData ()->AddArray (coordinates); actor->GetProperty ()->SetTexture (tu, texture); ++tex_id; @@ -4346,7 +4348,7 @@ pcl::visualization::PCLVisualizer::close () void pcl::visualization::PCLVisualizer::removeCorrespondences ( const std::string &id, int viewport) -{ +{ removeShape (id, viewport); } @@ -4579,7 +4581,7 @@ pcl::visualization::PCLVisualizer::getUniqueCameraFile (int argc, char **argv) p_file_indices = pcl::console::parse_file_extension_argument (argc, argv, ".pcd"); if (!p_file_indices.empty ()) { - boost::uuids::detail::sha1 sha1; + boost::uuids::detail::sha1 sha1; bool valid = false; // Calculate sha1 using canonical paths