From f4b61046dc2063f22129583910700234f049abe6 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 24 Nov 2022 17:58:55 +0100 Subject: [PATCH] Use strongly typed 'enum' instead of 'int' for properties in PCLVisualizer code --- apps/cloud_composer/src/items/cloud_item.cpp | 4 +- .../filesystem_face_detection.cpp | 4 +- .../face_detection/openni_face_detection.cpp | 12 +- apps/src/ni_agast.cpp | 8 +- apps/src/ni_brisk.cpp | 8 +- apps/src/ni_linemod.cpp | 8 +- apps/src/ni_susan.cpp | 8 +- apps/src/ni_trajkovic.cpp | 8 +- apps/src/openni_organized_edge_detection.cpp | 88 ++++++++----- ...nni_organized_multi_plane_segmentation.cpp | 8 +- apps/src/openni_uniform_sampling.cpp | 4 +- apps/src/organized_segmentation_demo.cpp | 10 +- apps/src/pcd_organized_edge_detection.cpp | 94 ++++++++++---- apps/src/pcd_select_object_plane.cpp | 2 +- apps/src/stereo_ground_segmentation.cpp | 4 +- cuda/apps/src/kinect_normals_cuda.cpp | 12 +- cuda/apps/src/kinect_planes_cuda.cpp | 12 +- cuda/apps/src/kinect_segmentation_cuda.cpp | 12 +- doc/tutorials/content/pcl_visualizer.rst | 6 +- .../content/range_image_visualization.rst | 2 +- .../correspondence_grouping.cpp | 4 +- .../global_hypothesis_verification.cpp | 10 +- .../main_ground_based_people_detection.cpp | 2 +- .../iccv2011/src/test_feature_estimation.cpp | 2 +- .../iccv2011/src/test_object_recognition.cpp | 2 +- .../iros2011/src/test_feature_estimation.cpp | 2 +- .../iros2011/src/test_object_recognition.cpp | 2 +- .../matrix_transform/matrix_transform.cpp | 4 +- .../moment_of_inertia/moment_of_inertia.cpp | 4 +- .../narf_feature_extraction.cpp | 4 +- .../narf_keypoint_extraction.cpp | 4 +- .../normal_distributions_transform.cpp | 4 +- .../openni_narf_keypoint_extraction.cpp | 2 +- .../pcl_visualizer/pcl_visualizer_demo.cpp | 14 +-- .../sources/qt_visualizer/pclviewer.cpp | 2 +- .../random_sample_consensus.cpp | 2 +- .../range_image_border_extraction.cpp | 8 +- .../range_image_visualization.cpp | 2 +- .../sources/registration_api/example1.cpp | 10 +- .../stick_segmentation/stick_segmentation.cpp | 8 +- .../supervoxel_clustering.cpp | 6 +- .../vfh_recognition/nearest_neighbors.cpp | 4 +- .../example_sift_keypoint_estimation.cpp | 2 +- ...xample_sift_normal_keypoint_estimation.cpp | 2 +- .../example_sift_z_keypoint_estimation.cpp | 2 +- .../segmentation/example_cpc_segmentation.cpp | 2 +- examples/segmentation/example_supervoxels.cpp | 4 +- examples/stereo/example_stereo_baseline.cpp | 2 +- gpu/kinfu/tools/kinfu_app.cpp | 2 +- gpu/kinfu/tools/kinfu_app_sim.cpp | 2 +- gpu/kinfu/tools/record_tsdfvolume.cpp | 2 +- gpu/kinfu_large_scale/tools/kinfuLS_app.cpp | 2 +- gpu/kinfu_large_scale/tools/kinfu_app_sim.cpp | 2 +- .../tools/record_tsdfvolume.cpp | 2 +- gpu/surface/test/test_pseudo_convex_hull.cpp | 2 +- .../main_ground_based_people_detection.cpp | 2 +- .../pcl/people/impl/person_cluster.hpp | 4 +- simulation/tools/sim_test_simple.cpp | 4 +- simulation/tools/sim_viewer.cpp | 45 +++++-- test/visualization/test_visualization.cpp | 22 ++-- tools/image_grabber_viewer.cpp | 4 +- tools/obj_rec_ransac_accepted_hypotheses.cpp | 16 +-- tools/obj_rec_ransac_model_opps.cpp | 6 +- tools/obj_rec_ransac_orr_octree.cpp | 6 +- .../obj_rec_ransac_orr_octree_zprojection.cpp | 6 +- tools/obj_rec_ransac_result.cpp | 6 +- tools/obj_rec_ransac_scene_opps.cpp | 10 +- tools/octree_viewer.cpp | 4 +- tools/pcd_grabber_viewer.cpp | 4 +- tools/pcd_viewer.cpp | 24 ++-- tools/real_sense_viewer.cpp | 2 +- .../include/pcl/visualization/common/common.h | 2 +- .../pcl/visualization/pcl_visualizer.h | 23 ++-- visualization/src/cloud_viewer.cpp | 12 +- visualization/src/pcl_visualizer.cpp | 116 ++++++++---------- visualization/test/test_shapes.cpp | 6 +- visualization/test/test_shapes_multiport.cpp | 6 +- 77 files changed, 439 insertions(+), 335 deletions(-) mode change 100755 => 100644 apps/src/stereo_ground_segmentation.cpp diff --git a/apps/cloud_composer/src/items/cloud_item.cpp b/apps/cloud_composer/src/items/cloud_item.cpp index 8f70e6b0f0f..1fb463445ab 100644 --- a/apps/cloud_composer/src/items/cloud_item.cpp +++ b/apps/cloud_composer/src/items/cloud_item.cpp @@ -71,8 +71,8 @@ void pcl::cloud_composer::CloudItem::paintView (pcl::visualization::PCLVisualizer::Ptr vis) const { vis->addPointCloud (cloud_blob_ptr_, geometry_handler_, color_handler_, origin_, orientation_, getId ().toStdString ()); - vis->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, properties_->getProperty ("Point Size").toDouble (), getId ().toStdString ()); - vis->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY, properties_->getProperty ("Opacity").toDouble (), getId ().toStdString ()); + vis->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, properties_->getProperty ("Point Size").toDouble (), getId ().toStdString ()); + vis->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, properties_->getProperty ("Opacity").toDouble (), getId ().toStdString ()); } diff --git a/apps/src/face_detection/filesystem_face_detection.cpp b/apps/src/face_detection/filesystem_face_detection.cpp index fcb5028b66a..d56c6bf4bfd 100644 --- a/apps/src/face_detection/filesystem_face_detection.cpp +++ b/apps/src/face_detection/filesystem_face_detection.cpp @@ -82,7 +82,9 @@ run(pcl::RFFaceDetectorTrainer& fdrf, handler_votes(votes_cloud, "intensity"); vis.addPointCloud(votes_cloud, handler_votes, "votes_cloud"); vis.setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 14, "votes_cloud"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, + 14, + "votes_cloud"); } vis.addCoordinateSystem(0.1, "global"); diff --git a/apps/src/face_detection/openni_face_detection.cpp b/apps/src/face_detection/openni_face_detection.cpp index 3af6d65961b..43b76241c78 100644 --- a/apps/src/face_detection/openni_face_detection.cpp +++ b/apps/src/face_detection/openni_face_detection.cpp @@ -70,11 +70,17 @@ run(pcl::RFFaceDetectorTrainer& fdrf, bool heat_map = false, bool show_votes = f votes_cloud, 255, 0, 0); vis.addPointCloud(votes_cloud, handler_votes, "votes_cloud"); vis.setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 14, "votes_cloud"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, + 14, + "votes_cloud"); vis.setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, 0.5, "votes_cloud"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + 0.5, + "votes_cloud"); vis.setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, 0.75, "votes_cloud"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + 0.75, + "votes_cloud"); } std::vector heads; diff --git a/apps/src/ni_agast.cpp b/apps/src/ni_agast.cpp index 6793e490d0a..b4a368613aa 100644 --- a/apps/src/ni_agast.cpp +++ b/apps/src/ni_agast.cpp @@ -306,9 +306,13 @@ class AGASTDemo { if (!cloud_viewer_.updatePointCloud(keypoints3d, blue, "keypoints")) cloud_viewer_.addPointCloud(keypoints3d, blue, "keypoints"); cloud_viewer_.setPointCloudRenderingProperties( - visualization::PCL_VISUALIZER_POINT_SIZE, 20, "keypoints"); + visualization::RenderingProperties::PCL_VISUALIZER_FONT_SIZE, + 20, + "keypoints"); cloud_viewer_.setPointCloudRenderingProperties( - visualization::PCL_VISUALIZER_OPACITY, 0.5, "keypoints"); + visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + 0.5, + "keypoints"); } } diff --git a/apps/src/ni_brisk.cpp b/apps/src/ni_brisk.cpp index 274cdf5a8d6..b7a5fddf834 100644 --- a/apps/src/ni_brisk.cpp +++ b/apps/src/ni_brisk.cpp @@ -253,9 +253,13 @@ class BRISKDemo { if (!cloud_viewer_.updatePointCloud(keypoints3d, blue, "keypoints")) cloud_viewer_.addPointCloud(keypoints3d, blue, "keypoints"); cloud_viewer_.setPointCloudRenderingProperties( - visualization::PCL_VISUALIZER_POINT_SIZE, 10, "keypoints"); + visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, + 10, + "keypoints"); cloud_viewer_.setPointCloudRenderingProperties( - visualization::PCL_VISUALIZER_OPACITY, 0.5, "keypoints"); + visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + 0.5, + "keypoints"); } cloud_viewer_.spinOnce(); diff --git a/apps/src/ni_linemod.cpp b/apps/src/ni_linemod.cpp index 52452ec0bd6..3b8785c7ffe 100644 --- a/apps/src/ni_linemod.cpp +++ b/apps/src/ni_linemod.cpp @@ -440,7 +440,7 @@ class NILinemod { // Else, draw it on screen // cloud_viewer_.addPolygon (region, 1.0, 0.0, 0.0, "region"); // cloud_viewer_.setShapeRenderingProperties - // (visualization::PCL_VISUALIZER_LINE_WIDTH, 10, "region"); + // (visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, 10, "region"); PlanarRegion refined_region; pcl::approximatePolygon(region, refined_region, 0.01, false, true); @@ -449,7 +449,9 @@ class NILinemod { static_cast(refined_region.getContour().size())); cloud_viewer_.addPolygon(refined_region, 0.0, 0.0, 1.0, "refined_region"); cloud_viewer_.setShapeRenderingProperties( - visualization::PCL_VISUALIZER_LINE_WIDTH, 10, "refined_region"); + visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, + 10, + "refined_region"); // Draw in image space image_viewer_.addPlanarPolygon( @@ -485,7 +487,7 @@ class NILinemod { 0.0, cube_name); cloud_viewer_.setShapeRenderingProperties( - visualization::PCL_VISUALIZER_LINE_WIDTH, 10, cube_name); + visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, 10, cube_name); // ...and 2D image_viewer_.addRectangle(search_.getInputCloud(), *object); diff --git a/apps/src/ni_susan.cpp b/apps/src/ni_susan.cpp index d67eb2568a7..314c53c5d54 100644 --- a/apps/src/ni_susan.cpp +++ b/apps/src/ni_susan.cpp @@ -160,9 +160,13 @@ class SUSANDemo { if (!cloud_viewer_.updatePointCloud(keypoints, blue, "keypoints")) cloud_viewer_.addPointCloud(keypoints, blue, "keypoints"); cloud_viewer_.setPointCloudRenderingProperties( - visualization::PCL_VISUALIZER_POINT_SIZE, 20, "keypoints"); + visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, + 20, + "keypoints"); cloud_viewer_.setPointCloudRenderingProperties( - visualization::PCL_VISUALIZER_OPACITY, 0.5, "keypoints"); + visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + 0.5, + "keypoints"); } } diff --git a/apps/src/ni_trajkovic.cpp b/apps/src/ni_trajkovic.cpp index b418e72ce96..92ee563a9b0 100644 --- a/apps/src/ni_trajkovic.cpp +++ b/apps/src/ni_trajkovic.cpp @@ -187,9 +187,13 @@ class TrajkovicDemo { if (!cloud_viewer_.updatePointCloud(keypoints, blue, "keypoints")) cloud_viewer_.addPointCloud(keypoints, blue, "keypoints"); cloud_viewer_.setPointCloudRenderingProperties( - visualization::PCL_VISUALIZER_POINT_SIZE, 10, "keypoints"); + visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, + 10, + "keypoints"); cloud_viewer_.setPointCloudRenderingProperties( - visualization::PCL_VISUALIZER_OPACITY, 0.5, "keypoints"); + visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + 0.5, + "keypoints"); } } diff --git a/apps/src/openni_organized_edge_detection.cpp b/apps/src/openni_organized_edge_detection.cpp index caf01aae7c8..a5d58a549aa 100644 --- a/apps/src/openni_organized_edge_detection.cpp +++ b/apps/src/openni_organized_edge_detection.cpp @@ -61,7 +61,7 @@ class OpenNIOrganizedEdgeDetection { viewer->setSize(640, 480); viewer->addPointCloud(cloud, "cloud"); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "cloud"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 1, "cloud"); viewer->addCoordinateSystem(0.2f, "global"); viewer->initCameraParameters(); viewer->registerKeyboardCallback(&OpenNIOrganizedEdgeDetection::keyboard_callback, @@ -71,43 +71,63 @@ class OpenNIOrganizedEdgeDetection { const int point_size = 2; viewer->addPointCloud(cloud, "nan boundary edges"); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_POINT_SIZE, + pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, point_size, "nan boundary edges"); - viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, - 0.0f, - 0.0f, - 1.0f, - "nan boundary edges"); + viewer->setPointCloudRenderingProperties( + pcl::visualization::RenderingProperties::PCL_VISUALIZER_IMMEDIATE_RENDERING, + 0.0f, + 0.0f, + 1.0f, + "nan boundary edges"); viewer->addPointCloud(cloud, "occluding edges"); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_POINT_SIZE, point_size, "occluding edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, + point_size, + "occluding edges"); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_COLOR, 0.0f, 1.0f, 0.0f, "occluding edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, + 0.0f, + 1.0f, + 0.0f, + "occluding edges"); viewer->addPointCloud(cloud, "occluded edges"); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_POINT_SIZE, point_size, "occluded edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, + point_size, + "occluded edges"); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_COLOR, 1.0f, 0.0f, 0.0f, "occluded edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, + 1.0f, + 0.0f, + 0.0f, + "occluded edges"); viewer->addPointCloud(cloud, "high curvature edges"); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_POINT_SIZE, + pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, point_size, "high curvature edges"); - viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, - 1.0f, - 1.0f, - 0.0f, - "high curvature edges"); + viewer->setPointCloudRenderingProperties( + pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, + 1.0f, + 1.0f, + 0.0f, + "high curvature edges"); viewer->addPointCloud(cloud, "rgb edges"); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_POINT_SIZE, point_size, "rgb edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, + point_size, + "rgb edges"); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_COLOR, 0.0f, 1.0f, 1.0f, "rgb edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, + 0.0f, + 1.0f, + 1.0f, + "rgb edges"); return viewer; } @@ -120,43 +140,53 @@ class OpenNIOrganizedEdgeDetection { switch (event.getKeyCode()) { case '1': viewer->getPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, "nan boundary edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + opacity, + "nan boundary edges"); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, 1.0 - opacity, "nan boundary edges"); break; case '2': viewer->getPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, "occluding edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + opacity, + "occluding edges"); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, 1.0 - opacity, "occluding edges"); break; case '3': viewer->getPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, "occluded edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + opacity, + "occluded edges"); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, 1.0 - opacity, "occluded edges"); break; case '4': viewer->getPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, opacity, "high curvature edges"); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, 1.0 - opacity, "high curvature edges"); break; case '5': viewer->getPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, "rgb edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + opacity, + "rgb edges"); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, 1.0 - opacity, "rgb edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + 1.0 - opacity, + "rgb edges"); break; } } diff --git a/apps/src/openni_organized_multi_plane_segmentation.cpp b/apps/src/openni_organized_multi_plane_segmentation.cpp index a587a7e2154..5f4aa917ca7 100644 --- a/apps/src/openni_organized_multi_plane_segmentation.cpp +++ b/apps/src/openni_organized_multi_plane_segmentation.cpp @@ -66,9 +66,9 @@ class OpenNIOrganizedMultiPlaneSegmentation { cloud, 0, 255, 0); viewer->addPointCloud(cloud, single_color, "cloud"); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "cloud"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 1, "cloud"); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, 0.15, "cloud"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, 0.15, "cloud"); viewer->addCoordinateSystem(1.0, "global"); viewer->initCameraParameters(); return viewer; @@ -180,7 +180,9 @@ class OpenNIOrganizedMultiPlaneSegmentation { contour, red[i], grn[i], blu[i]); viewer->addPointCloud(contour, color, name); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 4, name); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, + 4, + name); } prev_models_size = regions.size(); cloud_mutex.unlock(); diff --git a/apps/src/openni_uniform_sampling.cpp b/apps/src/openni_uniform_sampling.cpp index fbce9edc772..06ca07ce1fa 100644 --- a/apps/src/openni_uniform_sampling.cpp +++ b/apps/src/openni_uniform_sampling.cpp @@ -110,7 +110,9 @@ class OpenNIUniformSampling { if (!viz.updatePointCloud(keypoints_, "keypoints")) { viz.addPointCloud(keypoints_, "keypoints"); viz.setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 5.0, "keypoints"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, + 5.0, + "keypoints"); viz.resetCameraViewpoint("keypoints"); } } diff --git a/apps/src/organized_segmentation_demo.cpp b/apps/src/organized_segmentation_demo.cpp index e4ce56193aa..6572169d8dd 100644 --- a/apps/src/organized_segmentation_demo.cpp +++ b/apps/src/organized_segmentation_demo.cpp @@ -48,7 +48,7 @@ displayPlanarRegions( if (!viewer->updatePointCloud(contour, color, name)) viewer->addPointCloud(contour, color, name); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 5, name); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 5, name); } } @@ -70,9 +70,9 @@ displayEuclideanClusters(const pcl::PointCloud::CloudVectorType& cluster if (!viewer->updatePointCloud(cluster_cloud, color0, name)) viewer->addPointCloud(cluster_cloud, color0, name); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 5, name); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 5, name); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, 0.3, name); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, 0.3, name); } } @@ -449,7 +449,9 @@ OrganizedSegmentationDemo::timeoutSlot() vis_->addPointCloudNormals( prev_cloud_.makeShared(), prev_normals_.makeShared(), 10, 0.05f, "normals"); vis_->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, 0.5, "normals"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + 0.5, + "normals"); } else { vis_->removePointCloud("normals"); diff --git a/apps/src/pcd_organized_edge_detection.cpp b/apps/src/pcd_organized_edge_detection.cpp index 6eb0c222c0a..f0cba3b735b 100644 --- a/apps/src/pcd_organized_edge_detection.cpp +++ b/apps/src/pcd_organized_edge_detection.cpp @@ -128,37 +128,53 @@ keyboard_callback(const pcl::visualization::KeyboardEvent& event, void*) switch (event.getKeyCode()) { case '1': viewer.getPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, "nan boundary edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + opacity, + "nan boundary edges"); viewer.setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, 1.0 - opacity, "nan boundary edges"); break; case '2': viewer.getPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, "occluding edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + opacity, + "occluding edges"); viewer.setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, 1.0 - opacity, "occluding edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + 1.0 - opacity, + "occluding edges"); break; case '3': viewer.getPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, "occluded edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + opacity, + "occluded edges"); viewer.setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, 1.0 - opacity, "occluded edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + 1.0 - opacity, + "occluded edges"); break; case '4': viewer.getPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, "high curvature edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + opacity, + "high curvature edges"); viewer.setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, 1.0 - opacity, "high curvature edges"); break; case '5': viewer.getPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, "rgb edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + opacity, + "rgb edges"); viewer.setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, 1.0 - opacity, "rgb edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + 1.0 - opacity, + "rgb edges"); break; } } @@ -230,37 +246,63 @@ compute(const pcl::PCLPointCloud2::ConstPtr& input, const int point_size = 2; viewer.addPointCloud(nan_boundary_edges, "nan boundary edges"); viewer.setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_POINT_SIZE, point_size, "nan boundary edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, + point_size, + "nan boundary edges"); viewer.setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_COLOR, 0.0f, 0.0f, 1.0f, "nan boundary edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, + 0.0f, + 0.0f, + 1.0f, + "nan boundary edges"); viewer.addPointCloud(occluding_edges, "occluding edges"); viewer.setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_POINT_SIZE, point_size, "occluding edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, + point_size, + "occluding edges"); viewer.setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_COLOR, 0.0f, 1.0f, 0.0f, "occluding edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, + 0.0f, + 1.0f, + 0.0f, + "occluding edges"); viewer.addPointCloud(occluded_edges, "occluded edges"); viewer.setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_POINT_SIZE, point_size, "occluded edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, + point_size, + "occluded edges"); viewer.setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_COLOR, 1.0f, 0.0f, 0.0f, "occluded edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, + 1.0f, + 0.0f, + 0.0f, + "occluded edges"); viewer.addPointCloud(high_curvature_edges, "high curvature edges"); - viewer.setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, - point_size, - "high curvature edges"); - viewer.setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, - 1.0f, - 1.0f, - 0.0f, - "high curvature edges"); + viewer.setPointCloudRenderingProperties( + pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, + point_size, + "high curvature edges"); + viewer.setPointCloudRenderingProperties( + pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, + 1.0f, + 1.0f, + 0.0f, + "high curvature edges"); viewer.addPointCloud(rgb_edges, "rgb edges"); viewer.setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_POINT_SIZE, point_size, "rgb edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, + point_size, + "rgb edges"); viewer.setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_COLOR, 0.0f, 1.0f, 1.0f, "rgb edges"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, + 0.0f, + 1.0f, + 1.0f, + "rgb edges"); while (!viewer.wasStopped()) { viewer.spinOnce(); diff --git a/apps/src/pcd_select_object_plane.cpp b/apps/src/pcd_select_object_plane.cpp index b7914d72668..99edd6bf86d 100644 --- a/apps/src/pcd_select_object_plane.cpp +++ b/apps/src/pcd_select_object_plane.cpp @@ -494,7 +494,7 @@ class ObjectSelection { // Else, draw it on screen cloud_viewer_->addPolygon(region, 0.0, 0.0, 1.0, "region"); cloud_viewer_->setShapeRenderingProperties( - visualization::PCL_VISUALIZER_LINE_WIDTH, 10, "region"); + visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, 10, "region"); // Draw in image space if (image_viewer_) { diff --git a/apps/src/stereo_ground_segmentation.cpp b/apps/src/stereo_ground_segmentation.cpp old mode 100755 new mode 100644 index 0ef2ed02713..e86b5bbf129 --- a/apps/src/stereo_ground_segmentation.cpp +++ b/apps/src/stereo_ground_segmentation.cpp @@ -493,7 +493,9 @@ class HRCSSegmentation { viewer->addPointCloudNormals( prev_ground_image, prev_normal_cloud, 10, 0.15f, "normals"); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, 0.5, "normals"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + 0.5, + "normals"); } if (prev_cloud->size() > 1000) { diff --git a/cuda/apps/src/kinect_normals_cuda.cpp b/cuda/apps/src/kinect_normals_cuda.cpp index 53adab03536..a88520dff79 100644 --- a/cuda/apps/src/kinect_normals_cuda.cpp +++ b/cuda/apps/src/kinect_normals_cuda.cpp @@ -79,9 +79,9 @@ class NormalEstimation double psize = 1.0,opacity = 1.0,linesize =1.0; if (!first_time) { - viz.getPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, linesize, cloud_name); - viz.getPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, cloud_name); - viz.getPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, psize, cloud_name); + viz.getPointCloudRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, linesize, cloud_name); + viz.getPointCloudRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, opacity, cloud_name); + viz.getPointCloudRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, psize, cloud_name); //viz.removePointCloud ("normalcloud"); viz.removePointCloud ("cloud"); } @@ -90,9 +90,9 @@ class NormalEstimation //viz.addPointCloudNormals (normal_cloud, 139, 0.1, "normalcloud"); viz.addPointCloud (normal_cloud, Color_handler, std::string("cloud"), 0); - viz.setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, linesize, cloud_name); - viz.setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, cloud_name); - viz.setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, psize, cloud_name); + viz.setPointCloudRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, linesize, cloud_name); + viz.setPointCloudRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, opacity, cloud_name); + viz.setPointCloudRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, psize, cloud_name); new_cloud = false; } } diff --git a/cuda/apps/src/kinect_planes_cuda.cpp b/cuda/apps/src/kinect_planes_cuda.cpp index c61c03364f2..f211cd9a8a3 100644 --- a/cuda/apps/src/kinect_planes_cuda.cpp +++ b/cuda/apps/src/kinect_planes_cuda.cpp @@ -96,9 +96,9 @@ class MultiRansac static bool first_time = true; if (!first_time) { - viz.getPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, linesize, cloud_name); - viz.getPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, cloud_name); - viz.getPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, psize, cloud_name); + viz.getPointCloudRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, linesize, cloud_name); + viz.getPointCloudRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, opacity, cloud_name); + viz.getPointCloudRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, psize, cloud_name); //viz.removePointCloud ("normalcloud"); viz.removePointCloud ("cloud"); } @@ -107,9 +107,9 @@ class MultiRansac //viz.addPointCloudNormals (normal_cloud, 139, 0.1, "normalcloud"); viz.addPointCloud (normal_cloud, Color_handler, std::string("cloud"), 0); - viz.setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, linesize, cloud_name); - viz.setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, cloud_name); - viz.setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, psize, cloud_name); + viz.setPointCloudRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, linesize, cloud_name); + viz.setPointCloudRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, opacity, cloud_name); + viz.setPointCloudRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, psize, cloud_name); new_cloud = false; } } diff --git a/cuda/apps/src/kinect_segmentation_cuda.cpp b/cuda/apps/src/kinect_segmentation_cuda.cpp index 2b0e242de9b..cb8d65e8da3 100644 --- a/cuda/apps/src/kinect_segmentation_cuda.cpp +++ b/cuda/apps/src/kinect_segmentation_cuda.cpp @@ -111,9 +111,9 @@ class Segmentation static bool first_time = true; if (!first_time) { - viz.getPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, linesize, cloud_name); - viz.getPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, cloud_name); - viz.getPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, psize, cloud_name); + viz.getPointCloudRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, linesize, cloud_name); + viz.getPointCloudRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, opacity, cloud_name); + viz.getPointCloudRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, psize, cloud_name); if (last_enable_normal_viz) viz.removePointCloud ("normalcloud"); viz.removePointCloud ("cloud"); @@ -136,9 +136,9 @@ class Segmentation ColorHandler Color_handler (normal_cloud,"curvature"); viz.addPointCloud (normal_cloud, Color_handler, cloud_name, 0); } - viz.setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, linesize, cloud_name); - viz.setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, cloud_name); - viz.setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, psize, cloud_name); + viz.setPointCloudRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, linesize, cloud_name); + viz.setPointCloudRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, opacity, cloud_name); + viz.setPointCloudRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, psize, cloud_name); new_cloud = false; } last_enable_normal_viz = enable_normal_viz; diff --git a/doc/tutorials/content/pcl_visualizer.rst b/doc/tutorials/content/pcl_visualizer.rst index 1cedca26ac7..efa65ba7382 100644 --- a/doc/tutorials/content/pcl_visualizer.rst +++ b/doc/tutorials/content/pcl_visualizer.rst @@ -107,7 +107,7 @@ or you can see the `PCLVisualizer documentation`_ for more details. .. code-block:: cpp ... - viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "sample cloud"); + viewer->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 1, "sample cloud"); ... This next line changes the size of the rendered points. You can control @@ -462,8 +462,8 @@ same point cloud, but this time we give it a custom colour handler. .. code-block:: cpp ... - viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, "sample cloud1"); - viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, "sample cloud2"); + viewer->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 3, "sample cloud1"); + viewer->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 3, "sample cloud2"); viewer->addCoordinateSystem (1.0); ... diff --git a/doc/tutorials/content/range_image_visualization.rst b/doc/tutorials/content/range_image_visualization.rst index 5e189482777..f91060bdea6 100644 --- a/doc/tutorials/content/range_image_visualization.rst +++ b/doc/tutorials/content/range_image_visualization.rst @@ -30,7 +30,7 @@ The interesting part begins here: viewer.setBackgroundColor (1, 1, 1); pcl::visualization::PointCloudColorHandlerCustom range_image_color_handler (range_image_ptr, 0, 0, 0); viewer.addPointCloud (range_image_ptr, range_image_color_handler, "range image"); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "range image"); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 1, "range image"); //viewer.addCoordinateSystem (1.0f); //pcl::visualization::PointCloudColorHandlerCustom point_cloud_color_handler (point_cloud_ptr, 150, 150, 150); //viewer.addPointCloud (point_cloud_ptr, point_cloud_color_handler, "original point cloud"); diff --git a/doc/tutorials/content/sources/correspondence_grouping/correspondence_grouping.cpp b/doc/tutorials/content/sources/correspondence_grouping/correspondence_grouping.cpp index 81cd0fac088..3475248942a 100644 --- a/doc/tutorials/content/sources/correspondence_grouping/correspondence_grouping.cpp +++ b/doc/tutorials/content/sources/correspondence_grouping/correspondence_grouping.cpp @@ -379,11 +379,11 @@ main (int argc, char *argv[]) { pcl::visualization::PointCloudColorHandlerCustom scene_keypoints_color_handler (scene_keypoints, 0, 0, 255); viewer.addPointCloud (scene_keypoints, scene_keypoints_color_handler, "scene_keypoints"); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 5, "scene_keypoints"); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 5, "scene_keypoints"); pcl::visualization::PointCloudColorHandlerCustom off_scene_model_keypoints_color_handler (off_scene_model_keypoints, 0, 0, 255); viewer.addPointCloud (off_scene_model_keypoints, off_scene_model_keypoints_color_handler, "off_scene_model_keypoints"); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 5, "off_scene_model_keypoints"); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 5, "off_scene_model_keypoints"); } for (std::size_t i = 0; i < rototranslations.size (); ++i) diff --git a/doc/tutorials/content/sources/global_hypothesis_verification/global_hypothesis_verification.cpp b/doc/tutorials/content/sources/global_hypothesis_verification/global_hypothesis_verification.cpp index 293a9b108ea..dea887ce5c2 100644 --- a/doc/tutorials/content/sources/global_hypothesis_verification/global_hypothesis_verification.cpp +++ b/doc/tutorials/content/sources/global_hypothesis_verification/global_hypothesis_verification.cpp @@ -483,7 +483,7 @@ main (int argc, CloudStyle modelStyle = style_white; pcl::visualization::PointCloudColorHandlerCustom off_scene_model_color_handler (off_scene_model, modelStyle.r, modelStyle.g, modelStyle.b); viewer.addPointCloud (off_scene_model, off_scene_model_color_handler, "off_scene_model"); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, modelStyle.size, "off_scene_model"); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, modelStyle.size, "off_scene_model"); } if (show_keypoints_) @@ -492,12 +492,12 @@ main (int argc, pcl::visualization::PointCloudColorHandlerCustom model_good_keypoints_color_handler (off_model_good_kp, goodKeypointStyle.r, goodKeypointStyle.g, goodKeypointStyle.b); viewer.addPointCloud (off_model_good_kp, model_good_keypoints_color_handler, "model_good_keypoints"); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, goodKeypointStyle.size, "model_good_keypoints"); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, goodKeypointStyle.size, "model_good_keypoints"); pcl::visualization::PointCloudColorHandlerCustom scene_good_keypoints_color_handler (scene_good_kp, goodKeypointStyle.r, goodKeypointStyle.g, goodKeypointStyle.b); viewer.addPointCloud (scene_good_kp, scene_good_keypoints_color_handler, "scene_good_keypoints"); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, goodKeypointStyle.size, "scene_good_keypoints"); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, goodKeypointStyle.size, "scene_good_keypoints"); } for (std::size_t i = 0; i < instances.size (); ++i) @@ -508,14 +508,14 @@ main (int argc, CloudStyle clusterStyle = style_red; pcl::visualization::PointCloudColorHandlerCustom instance_color_handler (instances[i], clusterStyle.r, clusterStyle.g, clusterStyle.b); viewer.addPointCloud (instances[i], instance_color_handler, ss_instance.str ()); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, clusterStyle.size, ss_instance.str ()); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, clusterStyle.size, ss_instance.str ()); CloudStyle registeredStyles = hypotheses_mask[i] ? style_green : style_cyan; ss_instance << "_registered" << std::endl; pcl::visualization::PointCloudColorHandlerCustom registered_instance_color_handler (registered_instances[i], registeredStyles.r, registeredStyles.g, registeredStyles.b); viewer.addPointCloud (registered_instances[i], registered_instance_color_handler, ss_instance.str ()); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, registeredStyles.size, ss_instance.str ()); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, registeredStyles.size, ss_instance.str ()); } while (!viewer.wasStopped ()) diff --git a/doc/tutorials/content/sources/ground_based_rgbd_people_detection/src/main_ground_based_people_detection.cpp b/doc/tutorials/content/sources/ground_based_rgbd_people_detection/src/main_ground_based_people_detection.cpp index bedee069d77..c38933e13a5 100644 --- a/doc/tutorials/content/sources/ground_based_rgbd_people_detection/src/main_ground_based_people_detection.cpp +++ b/doc/tutorials/content/sources/ground_based_rgbd_people_detection/src/main_ground_based_people_detection.cpp @@ -111,7 +111,7 @@ pp_callback (const pcl::visualization::PointPickingEvent& event, void* args) pcl::visualization::PointCloudColorHandlerCustom red (data->clicked_points_3d, 255, 0, 0); data->viewerPtr->removePointCloud("clicked_points"); data->viewerPtr->addPointCloud(data->clicked_points_3d, red, "clicked_points"); - data->viewerPtr->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 10, "clicked_points"); + data->viewerPtr->setPointCloudRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 10, "clicked_points"); std::cout << current_point.x << " " << current_point.y << " " << current_point.z << std::endl; } diff --git a/doc/tutorials/content/sources/iccv2011/src/test_feature_estimation.cpp b/doc/tutorials/content/sources/iccv2011/src/test_feature_estimation.cpp index d3ceb67834a..de967df9a0e 100644 --- a/doc/tutorials/content/sources/iccv2011/src/test_feature_estimation.cpp +++ b/doc/tutorials/content/sources/iccv2011/src/test_feature_estimation.cpp @@ -128,7 +128,7 @@ main (int argc, char ** argv) { pcl::visualization::PointCloudColorHandlerCustom red (keypoints, 255, 0, 0); vis.addPointCloud (keypoints, red, "keypoints"); - vis.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, "keypoints"); + vis.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 3, "keypoints"); } if (global_descriptor) { diff --git a/doc/tutorials/content/sources/iccv2011/src/test_object_recognition.cpp b/doc/tutorials/content/sources/iccv2011/src/test_object_recognition.cpp index bd363d2b5e0..9aace325408 100644 --- a/doc/tutorials/content/sources/iccv2011/src/test_object_recognition.cpp +++ b/doc/tutorials/content/sources/iccv2011/src/test_object_recognition.cpp @@ -195,7 +195,7 @@ main (int argc, char ** argv) pcl::visualization::PointCloudColorHandlerCustom red (aligned_model_points, 255, 0, 0); vis.addPointCloud (aligned_model_points, red, "model"); - vis.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 2, "model"); + vis.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 2, "model"); vis.resetCamera (); vis.addPointCloud (query, "query"); diff --git a/doc/tutorials/content/sources/iros2011/src/test_feature_estimation.cpp b/doc/tutorials/content/sources/iros2011/src/test_feature_estimation.cpp index 3e27e60cf40..13969f09c4a 100644 --- a/doc/tutorials/content/sources/iros2011/src/test_feature_estimation.cpp +++ b/doc/tutorials/content/sources/iros2011/src/test_feature_estimation.cpp @@ -128,7 +128,7 @@ main (int argc, char ** argv) { pcl::visualization::PointCloudColorHandlerCustom red (keypoints, 255, 0, 0); vis.addPointCloud (keypoints, red, "keypoints"); - vis.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, "keypoints"); + vis.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 3, "keypoints"); } if (global_descriptor) { diff --git a/doc/tutorials/content/sources/iros2011/src/test_object_recognition.cpp b/doc/tutorials/content/sources/iros2011/src/test_object_recognition.cpp index 79f24a2cd8b..ca27c0abcb2 100644 --- a/doc/tutorials/content/sources/iros2011/src/test_object_recognition.cpp +++ b/doc/tutorials/content/sources/iros2011/src/test_object_recognition.cpp @@ -195,7 +195,7 @@ main (int argc, char ** argv) pcl::visualization::PointCloudColorHandlerCustom red (aligned_model_points, 255, 0, 0); vis.addPointCloud (aligned_model_points, red, "model"); - vis.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 2, "model"); + vis.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 2, "model"); vis.resetCamera (); vis.addPointCloud (query, "query"); diff --git a/doc/tutorials/content/sources/matrix_transform/matrix_transform.cpp b/doc/tutorials/content/sources/matrix_transform/matrix_transform.cpp index a3b41d52506..6e018dfba97 100644 --- a/doc/tutorials/content/sources/matrix_transform/matrix_transform.cpp +++ b/doc/tutorials/content/sources/matrix_transform/matrix_transform.cpp @@ -124,8 +124,8 @@ main (int argc, char** argv) viewer.addCoordinateSystem (1.0, "cloud", 0); viewer.setBackgroundColor(0.05, 0.05, 0.05, 0); // Setting background to a dark grey - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 2, "original_cloud"); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 2, "transformed_cloud"); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 2, "original_cloud"); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 2, "transformed_cloud"); //viewer.setPosition(800, 400); // Setting visualiser window position while (!viewer.wasStopped ()) { // Display the visualiser until 'q' key is pressed diff --git a/doc/tutorials/content/sources/moment_of_inertia/moment_of_inertia.cpp b/doc/tutorials/content/sources/moment_of_inertia/moment_of_inertia.cpp index af3e4db64d6..009309e105b 100644 --- a/doc/tutorials/content/sources/moment_of_inertia/moment_of_inertia.cpp +++ b/doc/tutorials/content/sources/moment_of_inertia/moment_of_inertia.cpp @@ -47,12 +47,12 @@ int main (int argc, char** argv) viewer->initCameraParameters (); viewer->addPointCloud (cloud, "sample cloud"); viewer->addCube (min_point_AABB.x, max_point_AABB.x, min_point_AABB.y, max_point_AABB.y, min_point_AABB.z, max_point_AABB.z, 1.0, 1.0, 0.0, "AABB"); - viewer->setShapeRenderingProperties(pcl::visualization::PCL_VISUALIZER_REPRESENTATION, pcl::visualization::PCL_VISUALIZER_REPRESENTATION_WIREFRAME, "AABB"); + viewer->setShapeRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_REPRESENTATION, pcl::visualization::PCL_VISUALIZER_REPRESENTATION_WIREFRAME, "AABB"); Eigen::Vector3f position (position_OBB.x, position_OBB.y, position_OBB.z); Eigen::Quaternionf quat (rotational_matrix_OBB); viewer->addCube (position, quat, max_point_OBB.x - min_point_OBB.x, max_point_OBB.y - min_point_OBB.y, max_point_OBB.z - min_point_OBB.z, "OBB"); - viewer->setShapeRenderingProperties(pcl::visualization::PCL_VISUALIZER_REPRESENTATION, pcl::visualization::PCL_VISUALIZER_REPRESENTATION_WIREFRAME, "OBB"); + viewer->setShapeRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_REPRESENTATION, pcl::visualization::PCL_VISUALIZER_REPRESENTATION_WIREFRAME, "OBB"); pcl::PointXYZ center (mass_center (0), mass_center (1), mass_center (2)); pcl::PointXYZ x_axis (major_vector (0) + mass_center (0), major_vector (1) + mass_center (1), major_vector (2) + mass_center (2)); diff --git a/doc/tutorials/content/sources/narf_feature_extraction/narf_feature_extraction.cpp b/doc/tutorials/content/sources/narf_feature_extraction/narf_feature_extraction.cpp index ba450f4e617..f4be1bfe4fd 100644 --- a/doc/tutorials/content/sources/narf_feature_extraction/narf_feature_extraction.cpp +++ b/doc/tutorials/content/sources/narf_feature_extraction/narf_feature_extraction.cpp @@ -148,7 +148,7 @@ main (int argc, char** argv) viewer.setBackgroundColor (1, 1, 1); pcl::visualization::PointCloudColorHandlerCustom range_image_color_handler (range_image_ptr, 0, 0, 0); viewer.addPointCloud (range_image_ptr, range_image_color_handler, "range image"); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "range image"); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 1, "range image"); //viewer.addCoordinateSystem (1.0f, "global"); //PointCloudColorHandlerCustom point_cloud_color_handler (point_cloud_ptr, 150, 150, 150); //viewer.addPointCloud (point_cloud_ptr, point_cloud_color_handler, "original point cloud"); @@ -191,7 +191,7 @@ main (int argc, char** argv) keypoints[i].getVector3fMap () = range_image[keypoint_indices[i]].getVector3fMap (); pcl::visualization::PointCloudColorHandlerCustom keypoints_color_handler (keypoints_ptr, 0, 255, 0); viewer.addPointCloud (keypoints_ptr, keypoints_color_handler, "keypoints"); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 7, "keypoints"); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 7, "keypoints"); // ------------------------------------------------------ // -----Extract NARF descriptors for interest points----- diff --git a/doc/tutorials/content/sources/narf_keypoint_extraction/narf_keypoint_extraction.cpp b/doc/tutorials/content/sources/narf_keypoint_extraction/narf_keypoint_extraction.cpp index 42e55957b2e..2575402c968 100644 --- a/doc/tutorials/content/sources/narf_keypoint_extraction/narf_keypoint_extraction.cpp +++ b/doc/tutorials/content/sources/narf_keypoint_extraction/narf_keypoint_extraction.cpp @@ -142,7 +142,7 @@ main (int argc, char** argv) viewer.setBackgroundColor (1, 1, 1); pcl::visualization::PointCloudColorHandlerCustom range_image_color_handler (range_image_ptr, 0, 0, 0); viewer.addPointCloud (range_image_ptr, range_image_color_handler, "range image"); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "range image"); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 1, "range image"); //viewer.addCoordinateSystem (1.0f, "global"); //PointCloudColorHandlerCustom point_cloud_color_handler (point_cloud_ptr, 150, 150, 150); //viewer.addPointCloud (point_cloud_ptr, point_cloud_color_handler, "original point cloud"); @@ -187,7 +187,7 @@ main (int argc, char** argv) pcl::visualization::PointCloudColorHandlerCustom keypoints_color_handler (keypoints_ptr, 0, 255, 0); viewer.addPointCloud (keypoints_ptr, keypoints_color_handler, "keypoints"); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 7, "keypoints"); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 7, "keypoints"); //-------------------- // -----Main loop----- diff --git a/doc/tutorials/content/sources/normal_distributions_transform/normal_distributions_transform.cpp b/doc/tutorials/content/sources/normal_distributions_transform/normal_distributions_transform.cpp index b5a525d25da..81223cc5df4 100644 --- a/doc/tutorials/content/sources/normal_distributions_transform/normal_distributions_transform.cpp +++ b/doc/tutorials/content/sources/normal_distributions_transform/normal_distributions_transform.cpp @@ -87,14 +87,14 @@ main () pcl::visualization::PointCloudColorHandlerCustom target_color (target_cloud, 255, 0, 0); viewer_final->addPointCloud (target_cloud, target_color, "target cloud"); - viewer_final->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, + viewer_final->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 1, "target cloud"); // Coloring and visualizing transformed input cloud (green). pcl::visualization::PointCloudColorHandlerCustom output_color (output_cloud, 0, 255, 0); viewer_final->addPointCloud (output_cloud, output_color, "output cloud"); - viewer_final->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, + viewer_final->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 1, "output cloud"); // Starting visualizer diff --git a/doc/tutorials/content/sources/openni_narf_keypoint_extraction/openni_narf_keypoint_extraction.cpp b/doc/tutorials/content/sources/openni_narf_keypoint_extraction/openni_narf_keypoint_extraction.cpp index 8e4d130ca95..18dcf0e379e 100644 --- a/doc/tutorials/content/sources/openni_narf_keypoint_extraction/openni_narf_keypoint_extraction.cpp +++ b/doc/tutorials/content/sources/openni_narf_keypoint_extraction/openni_narf_keypoint_extraction.cpp @@ -205,7 +205,7 @@ int main (int argc, char** argv) (keypoints_cloud_ptr, 0, 255, 0); if (!viewer.updatePointCloud (keypoints_cloud_ptr, color_handler_keypoints, "keypoints")) viewer.addPointCloud (keypoints_cloud_ptr, color_handler_keypoints, "keypoints"); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 7, "keypoints"); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 7, "keypoints"); } interface->stop (); diff --git a/doc/tutorials/content/sources/pcl_visualizer/pcl_visualizer_demo.cpp b/doc/tutorials/content/sources/pcl_visualizer/pcl_visualizer_demo.cpp index 6e388ef74fa..828c77bc4b9 100644 --- a/doc/tutorials/content/sources/pcl_visualizer/pcl_visualizer_demo.cpp +++ b/doc/tutorials/content/sources/pcl_visualizer/pcl_visualizer_demo.cpp @@ -40,7 +40,7 @@ pcl::visualization::PCLVisualizer::Ptr simpleVis (pcl::PointCloud pcl::visualization::PCLVisualizer::Ptr viewer (new pcl::visualization::PCLVisualizer ("3D Viewer")); viewer->setBackgroundColor (0, 0, 0); viewer->addPointCloud (cloud, "sample cloud"); - viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "sample cloud"); + viewer->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 1, "sample cloud"); viewer->addCoordinateSystem (1.0); viewer->initCameraParameters (); return (viewer); @@ -56,7 +56,7 @@ pcl::visualization::PCLVisualizer::Ptr rgbVis (pcl::PointCloud viewer->setBackgroundColor (0, 0, 0); pcl::visualization::PointCloudColorHandlerRGBField rgb(cloud); viewer->addPointCloud (cloud, rgb, "sample cloud"); - viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, "sample cloud"); + viewer->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 3, "sample cloud"); viewer->addCoordinateSystem (1.0); viewer->initCameraParameters (); return (viewer); @@ -72,7 +72,7 @@ pcl::visualization::PCLVisualizer::Ptr customColourVis (pcl::PointCloudsetBackgroundColor (0, 0, 0); pcl::visualization::PointCloudColorHandlerCustom single_color(cloud, 0, 255, 0); viewer->addPointCloud (cloud, single_color, "sample cloud"); - viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, "sample cloud"); + viewer->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 3, "sample cloud"); viewer->addCoordinateSystem (1.0); viewer->initCameraParameters (); return (viewer); @@ -89,7 +89,7 @@ pcl::visualization::PCLVisualizer::Ptr normalsVis ( viewer->setBackgroundColor (0, 0, 0); pcl::visualization::PointCloudColorHandlerRGBField rgb(cloud); viewer->addPointCloud (cloud, rgb, "sample cloud"); - viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, "sample cloud"); + viewer->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 3, "sample cloud"); viewer->addPointCloudNormals (cloud, normals, 10, 0.05, "normals"); viewer->addCoordinateSystem (1.0); viewer->initCameraParameters (); @@ -106,7 +106,7 @@ pcl::visualization::PCLVisualizer::Ptr shapesVis (pcl::PointCloudsetBackgroundColor (0, 0, 0); pcl::visualization::PointCloudColorHandlerRGBField rgb(cloud); viewer->addPointCloud (cloud, rgb, "sample cloud"); - viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, "sample cloud"); + viewer->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 3, "sample cloud"); viewer->addCoordinateSystem (1.0); viewer->initCameraParameters (); @@ -163,8 +163,8 @@ pcl::visualization::PCLVisualizer::Ptr viewportsVis ( pcl::visualization::PointCloudColorHandlerCustom single_color(cloud, 0, 255, 0); viewer->addPointCloud (cloud, single_color, "sample cloud2", v2); - viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, "sample cloud1"); - viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, "sample cloud2"); + viewer->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 3, "sample cloud1"); + viewer->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 3, "sample cloud2"); viewer->addCoordinateSystem (1.0); viewer->addPointCloudNormals (cloud, normals1, 10, 0.05, "normals1", v1); diff --git a/doc/tutorials/content/sources/qt_visualizer/pclviewer.cpp b/doc/tutorials/content/sources/qt_visualizer/pclviewer.cpp index 82a5fd2a941..971611c6764 100644 --- a/doc/tutorials/content/sources/qt_visualizer/pclviewer.cpp +++ b/doc/tutorials/content/sources/qt_visualizer/pclviewer.cpp @@ -103,7 +103,7 @@ PCLViewer::RGBsliderReleased () void PCLViewer::pSliderValueChanged (int value) { - viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, value, "cloud"); + viewer->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, value, "cloud"); refreshView(); } diff --git a/doc/tutorials/content/sources/random_sample_consensus/random_sample_consensus.cpp b/doc/tutorials/content/sources/random_sample_consensus/random_sample_consensus.cpp index 5c5cacf2e02..2fab2cebe7f 100644 --- a/doc/tutorials/content/sources/random_sample_consensus/random_sample_consensus.cpp +++ b/doc/tutorials/content/sources/random_sample_consensus/random_sample_consensus.cpp @@ -21,7 +21,7 @@ simpleVis (pcl::PointCloud::ConstPtr cloud) pcl::visualization::PCLVisualizer::Ptr viewer (new pcl::visualization::PCLVisualizer ("3D Viewer")); viewer->setBackgroundColor (0, 0, 0); viewer->addPointCloud (cloud, "sample cloud"); - viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, "sample cloud"); + viewer->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 3, "sample cloud"); //viewer->addCoordinateSystem (1.0, "global"); viewer->initCameraParameters (); return (viewer); diff --git a/doc/tutorials/content/sources/range_image_border_extraction/range_image_border_extraction.cpp b/doc/tutorials/content/sources/range_image_border_extraction/range_image_border_extraction.cpp index 950bb30eefd..0c8275e86e1 100644 --- a/doc/tutorials/content/sources/range_image_border_extraction/range_image_border_extraction.cpp +++ b/doc/tutorials/content/sources/range_image_border_extraction/range_image_border_extraction.cpp @@ -128,7 +128,7 @@ main (int argc, char** argv) viewer.addPointCloud (point_cloud_ptr, point_cloud_color_handler, "original point cloud"); //PointCloudColorHandlerCustom range_image_color_handler (range_image_ptr, 150, 150, 150); //viewer.addPointCloud (range_image_ptr, range_image_color_handler, "range image"); - //viewer.setPointCloudRenderingProperties (PCL_VISUALIZER_POINT_SIZE, 2, "range image"); + //viewer.setPointCloudRenderingProperties (RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 2, "range image"); // ------------------------- // -----Extract borders----- @@ -160,13 +160,13 @@ main (int argc, char** argv) } pcl::visualization::PointCloudColorHandlerCustom border_points_color_handler (border_points_ptr, 0, 255, 0); viewer.addPointCloud (border_points_ptr, border_points_color_handler, "border points"); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 7, "border points"); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 7, "border points"); pcl::visualization::PointCloudColorHandlerCustom veil_points_color_handler (veil_points_ptr, 255, 0, 0); viewer.addPointCloud (veil_points_ptr, veil_points_color_handler, "veil points"); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 7, "veil points"); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 7, "veil points"); pcl::visualization::PointCloudColorHandlerCustom shadow_points_color_handler (shadow_points_ptr, 0, 255, 255); viewer.addPointCloud (shadow_points_ptr, shadow_points_color_handler, "shadow points"); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 7, "shadow points"); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 7, "shadow points"); //------------------------------------- // -----Show points on range image----- diff --git a/doc/tutorials/content/sources/range_image_visualization/range_image_visualization.cpp b/doc/tutorials/content/sources/range_image_visualization/range_image_visualization.cpp index 523c1ed2d04..0a7b4869e65 100644 --- a/doc/tutorials/content/sources/range_image_visualization/range_image_visualization.cpp +++ b/doc/tutorials/content/sources/range_image_visualization/range_image_visualization.cpp @@ -131,7 +131,7 @@ main (int argc, char** argv) viewer.setBackgroundColor (1, 1, 1); pcl::visualization::PointCloudColorHandlerCustom range_image_color_handler (range_image_ptr, 0, 0, 0); viewer.addPointCloud (range_image_ptr, range_image_color_handler, "range image"); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "range image"); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 1, "range image"); //viewer.addCoordinateSystem (1.0f, "global"); //PointCloudColorHandlerCustom point_cloud_color_handler (point_cloud_ptr, 150, 150, 150); //viewer.addPointCloud (point_cloud_ptr, point_cloud_color_handler, "original point cloud"); diff --git a/doc/tutorials/content/sources/registration_api/example1.cpp b/doc/tutorials/content/sources/registration_api/example1.cpp index 98a43a5c461..8dce78d63fb 100644 --- a/doc/tutorials/content/sources/registration_api/example1.cpp +++ b/doc/tutorials/content/sources/registration_api/example1.cpp @@ -109,16 +109,16 @@ view (const CloudConstPtr &src, const CloudConstPtr &tgt, const CorrespondencesP vis->resetCameraViewpoint ("source"); } if (!vis->updatePointCloud (tgt, green, "target")) vis->addPointCloud (tgt, green, "target"); - vis->setPointCloudRenderingProperties (PCL_VISUALIZER_OPACITY, 0.5, "source"); - vis->setPointCloudRenderingProperties (PCL_VISUALIZER_OPACITY, 0.7, "target"); - vis->setPointCloudRenderingProperties (PCL_VISUALIZER_POINT_SIZE, 6, "source"); + vis->setPointCloudRenderingProperties (RenderingProperties::PCL_VISUALIZER_OPACITY, 0.5, "source"); + vis->setPointCloudRenderingProperties (RenderingProperties::PCL_VISUALIZER_OPACITY, 0.7, "target"); + vis->setPointCloudRenderingProperties (RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 6, "source"); pcl::console::TicToc tt; tt.tic (); if (!vis->updateCorrespondences (src, tgt, *correspondences, 1)) vis->addCorrespondences (src, tgt, *correspondences, 1, "correspondences"); tt.toc_print (); - vis->setShapeRenderingProperties (PCL_VISUALIZER_LINE_WIDTH, 5, "correspondences"); - //vis->setShapeRenderingProperties (PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0, "correspondences"); + vis->setShapeRenderingProperties (RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, 5, "correspondences"); + //vis->setShapeRenderingProperties (RenderingProperties::PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0, "correspondences"); vis->spin (); } diff --git a/doc/tutorials/content/sources/stick_segmentation/stick_segmentation.cpp b/doc/tutorials/content/sources/stick_segmentation/stick_segmentation.cpp index 9ecc8e4c51e..74ebdfbca36 100644 --- a/doc/tutorials/content/sources/stick_segmentation/stick_segmentation.cpp +++ b/doc/tutorials/content/sources/stick_segmentation/stick_segmentation.cpp @@ -223,8 +223,8 @@ main (int argc, char** argv) if (!p.updatePointCloud (cloud_f, "filter")) p.addPointCloud (cloud_f, "filter"); - p.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 10.0, "filter"); - p.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY, 0.2, "filter"); + p.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 10.0, "filter"); + p.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, 0.2, "filter"); if (!p.updatePointCloud (line, "line inliers")) p.addPointCloud (line, "line inliers"); @@ -240,8 +240,8 @@ main (int argc, char** argv) p.addLine (pmin, pmax); //p.addLine (coefficients); } - p.setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, 50.0, "line"); - p.setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_COLOR, 1.0, 1.0, 0.0, "line"); + p.setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, 50.0, "line"); + p.setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, 1.0, 1.0, 0.0, "line"); if (p_file_indices.size () == 1) p.spin (); diff --git a/doc/tutorials/content/sources/supervoxel_clustering/supervoxel_clustering.cpp b/doc/tutorials/content/sources/supervoxel_clustering/supervoxel_clustering.cpp index ceb6d8fb106..92660476615 100644 --- a/doc/tutorials/content/sources/supervoxel_clustering/supervoxel_clustering.cpp +++ b/doc/tutorials/content/sources/supervoxel_clustering/supervoxel_clustering.cpp @@ -92,12 +92,12 @@ main (int argc, char ** argv) PointCloudT::Ptr voxel_centroid_cloud = super.getVoxelCentroidCloud (); viewer->addPointCloud (voxel_centroid_cloud, "voxel centroids"); - viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE,2.0, "voxel centroids"); - viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY,0.95, "voxel centroids"); + viewer->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE,2.0, "voxel centroids"); + viewer->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY,0.95, "voxel centroids"); PointLCloudT::Ptr labeled_voxel_cloud = super.getLabeledVoxelCloud (); viewer->addPointCloud (labeled_voxel_cloud, "labeled voxels"); - viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY,0.8, "labeled voxels"); + viewer->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY,0.8, "labeled voxels"); PointNCloudT::Ptr sv_normal_cloud = super.makeSupervoxelNormalCloud (supervoxel_clusters); //We have this disabled so graph is easy to see, uncomment to see supervoxel normals diff --git a/doc/tutorials/content/sources/vfh_recognition/nearest_neighbors.cpp b/doc/tutorials/content/sources/vfh_recognition/nearest_neighbors.cpp index 783c092bbd3..a062f1ec595 100644 --- a/doc/tutorials/content/sources/vfh_recognition/nearest_neighbors.cpp +++ b/doc/tutorials/content/sources/vfh_recognition/nearest_neighbors.cpp @@ -256,13 +256,13 @@ main (int argc, char** argv) std::stringstream line_name; line_name << "line_" << i; p.addLine (min_p, max_p, 1, 0, 0, line_name.str (), viewport); - p.setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, 5, line_name.str (), viewport); + p.setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, 5, line_name.str (), viewport); } else p.addText (ss.str (), 20, 30, 0, 1, 0, ss.str (), viewport); // Increase the font size for the score* - p.setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_FONT_SIZE, 18, ss.str (), viewport); + p.setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_FONT_SIZE, 18, ss.str (), viewport); // Add the cluster name p.addText (cloud_name, 20, 10, cloud_name, viewport); diff --git a/examples/keypoints/example_sift_keypoint_estimation.cpp b/examples/keypoints/example_sift_keypoint_estimation.cpp index 612e070ea11..ca54b502260 100644 --- a/examples/keypoints/example_sift_keypoint_estimation.cpp +++ b/examples/keypoints/example_sift_keypoint_estimation.cpp @@ -90,7 +90,7 @@ main(int, char** argv) viewer.setBackgroundColor( 0.0, 0.0, 0.0 ); viewer.addPointCloud(cloud, "cloud"); viewer.addPointCloud(cloud_temp, keypoints_color_handler, "keypoints"); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 7, "keypoints"); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 7, "keypoints"); while(!viewer.wasStopped ()) { diff --git a/examples/keypoints/example_sift_normal_keypoint_estimation.cpp b/examples/keypoints/example_sift_normal_keypoint_estimation.cpp index c4c1905bf03..cc9c98677ee 100644 --- a/examples/keypoints/example_sift_normal_keypoint_estimation.cpp +++ b/examples/keypoints/example_sift_normal_keypoint_estimation.cpp @@ -112,7 +112,7 @@ main(int, char** argv) viewer.setBackgroundColor( 0.0, 0.0, 0.0 ); viewer.addPointCloud(cloud_xyz, cloud_color_handler, "cloud"); viewer.addPointCloud(cloud_temp, keypoints_color_handler, "keypoints"); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 7, "keypoints"); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 7, "keypoints"); while(!viewer.wasStopped ()) { diff --git a/examples/keypoints/example_sift_z_keypoint_estimation.cpp b/examples/keypoints/example_sift_z_keypoint_estimation.cpp index 146f03f5d46..e09764394df 100644 --- a/examples/keypoints/example_sift_z_keypoint_estimation.cpp +++ b/examples/keypoints/example_sift_z_keypoint_estimation.cpp @@ -104,7 +104,7 @@ main(int, char** argv) viewer.setBackgroundColor( 0.0, 0.0, 0.0 ); viewer.addPointCloud(cloud_xyz, cloud_color_handler, "cloud"); viewer.addPointCloud(cloud_temp, keypoints_color_handler, "keypoints"); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 7, "keypoints"); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 7, "keypoints"); while(!viewer.wasStopped ()) { diff --git a/examples/segmentation/example_cpc_segmentation.cpp b/examples/segmentation/example_cpc_segmentation.cpp index 8c9937f094d..1e3c373fb98 100644 --- a/examples/segmentation/example_cpc_segmentation.cpp +++ b/examples/segmentation/example_cpc_segmentation.cpp @@ -558,7 +558,7 @@ CPCSegmentation Parameters: \n\ if (!viewer->contains ("adjacency_graph")) { viewer->addModelFromPolyData (polyData, "adjacency_graph", 0); - viewer->setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, line_width, "adjacency_graph"); + viewer->setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, line_width, "adjacency_graph"); } } else diff --git a/examples/segmentation/example_supervoxels.cpp b/examples/segmentation/example_supervoxels.cpp index 76188bee4f5..76c4f3c10f5 100644 --- a/examples/segmentation/example_supervoxels.cpp +++ b/examples/segmentation/example_supervoxels.cpp @@ -355,7 +355,7 @@ main (int argc, char ** argv) if (!viewer->updatePointCloud ((show_refined)?refined_labeled_voxel_cloud:labeled_voxel_cloud, "colored voxels")) { viewer->addPointCloud ((show_refined)?refined_labeled_voxel_cloud:labeled_voxel_cloud, "colored voxels"); - viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE,3.0, "colored voxels"); + viewer->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE,3.0, "colored voxels"); } } else @@ -368,7 +368,7 @@ main (int argc, char ** argv) if (!viewer->updatePointCloud (voxel_centroid_cloud, "voxel centroids")) { viewer->addPointCloud (voxel_centroid_cloud, "voxel centroids"); - viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE,2.0, "voxel centroids"); + viewer->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE,2.0, "voxel centroids"); } } else diff --git a/examples/stereo/example_stereo_baseline.cpp b/examples/stereo/example_stereo_baseline.cpp index bf21c6f8f55..c007e003b15 100644 --- a/examples/stereo/example_stereo_baseline.cpp +++ b/examples/stereo/example_stereo_baseline.cpp @@ -92,7 +92,7 @@ main(int argc, char **argv) pcl::visualization::PointCloudColorHandlerRGBField intensity(out_cloud); viewer->addPointCloud (out_cloud, intensity, "stereo"); - //viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "stereo"); + //viewer->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 1, "stereo"); viewer->initCameraParameters (); //viewer->spin(); while (!viewer->wasStopped ()) diff --git a/gpu/kinfu/tools/kinfu_app.cpp b/gpu/kinfu/tools/kinfu_app.cpp index 84d05ed2cc4..ff480adc42e 100644 --- a/gpu/kinfu/tools/kinfu_app.cpp +++ b/gpu/kinfu/tools/kinfu_app.cpp @@ -315,7 +315,7 @@ struct CurrentFrameCloudView cloud_ptr_ = PointCloud::Ptr (new PointCloud); cloud_viewer_.setBackgroundColor (0, 0, 0.15); - cloud_viewer_.setPointCloudRenderingProperties (visualization::PCL_VISUALIZER_POINT_SIZE, 1); + cloud_viewer_.setPointCloudRenderingProperties (visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 1); cloud_viewer_.addCoordinateSystem (1.0, "global"); cloud_viewer_.initCameraParameters (); cloud_viewer_.setPosition (0, 500); diff --git a/gpu/kinfu/tools/kinfu_app_sim.cpp b/gpu/kinfu/tools/kinfu_app_sim.cpp index 1591c199846..fd11ce02a84 100644 --- a/gpu/kinfu/tools/kinfu_app_sim.cpp +++ b/gpu/kinfu/tools/kinfu_app_sim.cpp @@ -577,7 +577,7 @@ struct CurrentFrameCloudView cloud_ptr_ = PointCloud::Ptr (new PointCloud); cloud_viewer_.setBackgroundColor (0, 0, 0.15); - cloud_viewer_.setPointCloudRenderingProperties (visualization::PCL_VISUALIZER_POINT_SIZE, 1); + cloud_viewer_.setPointCloudRenderingProperties (visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 1); cloud_viewer_.addCoordinateSystem (1.0); cloud_viewer_.initCameraParameters (); cloud_viewer_.setPosition (0, 500); diff --git a/gpu/kinfu/tools/record_tsdfvolume.cpp b/gpu/kinfu/tools/record_tsdfvolume.cpp index 07878994a8b..2f26e6e6d04 100644 --- a/gpu/kinfu/tools/record_tsdfvolume.cpp +++ b/gpu/kinfu/tools/record_tsdfvolume.cpp @@ -410,7 +410,7 @@ main (int argc, char* argv[]) // pcl::visualization::PointCloudColorHandlerRGBField color_handler (cloud); // pcl::visualization::PointCloudColorHandlerCustom color_handler (cloud, 0.5, 0.5, 0.5); visualizer.addPointCloud (cloud); //, color_handler, "cloud"); - visualizer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1); + visualizer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 1); visualizer.addCoordinateSystem (1, "global"); visualizer.initCameraParameters(); visualizer.registerKeyboardCallback (keyboard_callback); diff --git a/gpu/kinfu_large_scale/tools/kinfuLS_app.cpp b/gpu/kinfu_large_scale/tools/kinfuLS_app.cpp index d96b6171de3..ed5f39558fc 100644 --- a/gpu/kinfu_large_scale/tools/kinfuLS_app.cpp +++ b/gpu/kinfu_large_scale/tools/kinfuLS_app.cpp @@ -263,7 +263,7 @@ struct CurrentFrameCloudView cloud_ptr_ = PointCloud::Ptr (new PointCloud); cloud_viewer_.setBackgroundColor (0, 0, 0.15); - cloud_viewer_.setPointCloudRenderingProperties (visualization::PCL_VISUALIZER_POINT_SIZE, 1); + cloud_viewer_.setPointCloudRenderingProperties (visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 1); cloud_viewer_.addCoordinateSystem (1.0, "global"); cloud_viewer_.initCameraParameters (); cloud_viewer_.setPosition (0, 500); diff --git a/gpu/kinfu_large_scale/tools/kinfu_app_sim.cpp b/gpu/kinfu_large_scale/tools/kinfu_app_sim.cpp index c333b269941..be490834c20 100644 --- a/gpu/kinfu_large_scale/tools/kinfu_app_sim.cpp +++ b/gpu/kinfu_large_scale/tools/kinfu_app_sim.cpp @@ -571,7 +571,7 @@ struct CurrentFrameCloudView cloud_ptr_ = PointCloud::Ptr (new PointCloud); cloud_viewer_.setBackgroundColor (0, 0, 0.15); - cloud_viewer_.setPointCloudRenderingProperties (visualization::PCL_VISUALIZER_POINT_SIZE, 1); + cloud_viewer_.setPointCloudRenderingProperties (visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 1); cloud_viewer_.addCoordinateSystem (1.0); cloud_viewer_.initCameraParameters (); cloud_viewer_.setPosition (0, 500); diff --git a/gpu/kinfu_large_scale/tools/record_tsdfvolume.cpp b/gpu/kinfu_large_scale/tools/record_tsdfvolume.cpp index b88550a8551..1f1a6f0ac84 100644 --- a/gpu/kinfu_large_scale/tools/record_tsdfvolume.cpp +++ b/gpu/kinfu_large_scale/tools/record_tsdfvolume.cpp @@ -408,7 +408,7 @@ main (int argc, char* argv[]) // pcl::visualization::PointCloudColorHandlerRGBField color_handler (cloud); // pcl::visualization::PointCloudColorHandlerCustom color_handler (cloud, 0.5, 0.5, 0.5); visualizer.addPointCloud (cloud); //, color_handler, "cloud"); - visualizer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1); + visualizer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 1); visualizer.addCoordinateSystem (1); visualizer.initCameraParameters(); visualizer.registerKeyboardCallback (keyboard_callback); diff --git a/gpu/surface/test/test_pseudo_convex_hull.cpp b/gpu/surface/test/test_pseudo_convex_hull.cpp index 6316948d10f..dc03623f583 100644 --- a/gpu/surface/test/test_pseudo_convex_hull.cpp +++ b/gpu/surface/test/test_pseudo_convex_hull.cpp @@ -132,7 +132,7 @@ TEST(PCL_SurfaceGPU, pseudoConvexHull) pcl::visualization::PointCloudColorHandlerCustom single_color(convex_ptr, 0, 255, 0); viewer.addPointCloud (convex_ptr, single_color, "convex"); - viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 5, "convex"); + viewer.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 5, "convex"); viewer.addPolylineFromPolygonMesh(mesh); diff --git a/people/apps/main_ground_based_people_detection.cpp b/people/apps/main_ground_based_people_detection.cpp index 8ae58151cb7..4d76ff8b992 100644 --- a/people/apps/main_ground_based_people_detection.cpp +++ b/people/apps/main_ground_based_people_detection.cpp @@ -111,7 +111,7 @@ pp_callback (const pcl::visualization::PointPickingEvent& event, void* args) pcl::visualization::PointCloudColorHandlerCustom red (data->clicked_points_3d, 255, 0, 0); data->viewerPtr->removePointCloud("clicked_points"); data->viewerPtr->addPointCloud(data->clicked_points_3d, red, "clicked_points"); - data->viewerPtr->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 10, "clicked_points"); + data->viewerPtr->setPointCloudRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 10, "clicked_points"); std::cout << current_point.x << " " << current_point.y << " " << current_point.z << std::endl; } diff --git a/people/include/pcl/people/impl/person_cluster.hpp b/people/include/pcl/people/impl/person_cluster.hpp index 79a48792d2e..8a94dfa65c4 100644 --- a/people/include/pcl/people/impl/person_cluster.hpp +++ b/people/include/pcl/people/impl/person_cluster.hpp @@ -412,8 +412,8 @@ void pcl::people::PersonCluster::drawTBoundingBox (pcl::visualization::P const std::string bbox_name = "bbox_person_" + std::to_string(person_number); viewer.removeShape (bbox_name); viewer.addCube (coeffs, bbox_name); - viewer.setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_COLOR, 0.0, 1.0, 0.0, bbox_name); - viewer.setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, 2, bbox_name); + viewer.setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, 0.0, 1.0, 0.0, bbox_name); + viewer.setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, 2, bbox_name); } template diff --git a/simulation/tools/sim_test_simple.cpp b/simulation/tools/sim_test_simple.cpp index a0547df862a..e9d5d73b838 100644 --- a/simulation/tools/sim_test_simple.cpp +++ b/simulation/tools/sim_test_simple.cpp @@ -287,7 +287,9 @@ simpleVis(pcl::PointCloud::ConstPtr cloud) pcl::visualization::PointCloudColorHandlerRGBField rgb(cloud); viewer->addPointCloud(cloud, rgb, "sample cloud"); viewer->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, "sample cloud"); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, + 3, + "sample cloud"); viewer->addCoordinateSystem(1.0, "reference"); viewer->initCameraParameters(); return (viewer); diff --git a/simulation/tools/sim_viewer.cpp b/simulation/tools/sim_viewer.cpp index f80f0dd5bd2..63b5490a7ac 100644 --- a/simulation/tools/sim_viewer.cpp +++ b/simulation/tools/sim_viewer.cpp @@ -587,21 +587,26 @@ main(int argc, char** argv) // Change the shape rendered color if (fcolorparam && fcolor_r.size() > i && fcolor_g.size() > i && fcolor_b.size() > i) - p->setShapeRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, - fcolor_r[i], - fcolor_g[i], - fcolor_b[i], - cloud_name); + p->setShapeRenderingProperties( + pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, + fcolor_r[i], + fcolor_g[i], + fcolor_b[i], + cloud_name); // Change the shape rendered point size if (!psize.empty()) p->setShapeRenderingProperties( - pcl::visualization::PCL_VISUALIZER_POINT_SIZE, psize.at(i), cloud_name); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, + psize.at(i), + cloud_name); // Change the shape rendered opacity if (!opaque.empty()) p->setShapeRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, opaque.at(i), cloud_name); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + opaque.at(i), + cloud_name); } pcl::PCLPointCloud2::Ptr cloud; @@ -767,9 +772,15 @@ main(int argc, char** argv) cloud_name_normals, viewport); p->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0, cloud_name_normals); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, + 1.0, + 0.0, + 0.0, + cloud_name_normals); p->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, 3, cloud_name_normals); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, + 3, + cloud_name_normals); const auto cloud_name_normals_pc = cloud_name_normals + "-pc"; p->addPointCloudPrincipalCurvatures( cloud_xyz, @@ -780,7 +791,9 @@ main(int argc, char** argv) cloud_name_normals_pc, viewport); p->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, 3, cloud_name_normals_pc); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, + 3, + cloud_name_normals_pc); } // Add every dimension as a possible color @@ -811,17 +824,23 @@ main(int argc, char** argv) // Set immediate mode rendering ON p->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_IMMEDIATE_RENDERING, 1.0, cloud_name); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_IMMEDIATE_RENDERING, + 1.0, + cloud_name); // Change the cloud rendered point size if (!psize.empty()) p->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_POINT_SIZE, psize.at(i), cloud_name); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, + psize.at(i), + cloud_name); // Change the cloud rendered opacity if (!opaque.empty()) p->setPointCloudRenderingProperties( - pcl::visualization::PCL_VISUALIZER_OPACITY, opaque.at(i), cloud_name); + pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, + opaque.at(i), + cloud_name); } //////////////////////////////////////////////////////////////// diff --git a/test/visualization/test_visualization.cpp b/test/visualization/test_visualization.cpp index 5a8b83e1fa9..9deb5b055f9 100644 --- a/test/visualization/test_visualization.cpp +++ b/test/visualization/test_visualization.cpp @@ -158,32 +158,32 @@ TEST (PCL, PCLVisualizer_getPointCloudRenderingProperties) std::string cloud_id = "input_cloud"; visualizer.addPointCloud (cloud, cloud_id); - ASSERT_TRUE (visualizer.setPointCloudRenderingProperties (PCL_VISUALIZER_COLOR, + ASSERT_TRUE (visualizer.setPointCloudRenderingProperties (RenderingProperties::PCL_VISUALIZER_COLOR, 1., 0., 0., cloud_id)); double r, g, b; - EXPECT_FALSE (visualizer.getPointCloudRenderingProperties (PCL_VISUALIZER_POINT_SIZE, + EXPECT_FALSE (visualizer.getPointCloudRenderingProperties (RenderingProperties::PCL_VISUALIZER_POINT_SIZE, r, g, b, cloud_id)); - EXPECT_FALSE (visualizer.getPointCloudRenderingProperties (PCL_VISUALIZER_OPACITY, + EXPECT_FALSE (visualizer.getPointCloudRenderingProperties (RenderingProperties::PCL_VISUALIZER_OPACITY, r, g, b, cloud_id)); - EXPECT_FALSE (visualizer.getPointCloudRenderingProperties (PCL_VISUALIZER_LINE_WIDTH, + EXPECT_FALSE (visualizer.getPointCloudRenderingProperties (RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, r, g, b, cloud_id)); - EXPECT_FALSE (visualizer.getPointCloudRenderingProperties (PCL_VISUALIZER_FONT_SIZE, + EXPECT_FALSE (visualizer.getPointCloudRenderingProperties (RenderingProperties::PCL_VISUALIZER_FONT_SIZE, r, g, b, cloud_id)); - EXPECT_FALSE (visualizer.getPointCloudRenderingProperties (PCL_VISUALIZER_REPRESENTATION, + EXPECT_FALSE (visualizer.getPointCloudRenderingProperties (RenderingProperties::PCL_VISUALIZER_REPRESENTATION, r, g, b, cloud_id)); - EXPECT_FALSE (visualizer.getPointCloudRenderingProperties (PCL_VISUALIZER_IMMEDIATE_RENDERING, + EXPECT_FALSE (visualizer.getPointCloudRenderingProperties (RenderingProperties::PCL_VISUALIZER_IMMEDIATE_RENDERING, r, g, b, cloud_id)); - EXPECT_FALSE (visualizer.getPointCloudRenderingProperties (PCL_VISUALIZER_SHADING, + EXPECT_FALSE (visualizer.getPointCloudRenderingProperties (RenderingProperties::PCL_VISUALIZER_SHADING, r, g, b, cloud_id)); - EXPECT_FALSE (visualizer.getPointCloudRenderingProperties (PCL_VISUALIZER_LUT, + EXPECT_FALSE (visualizer.getPointCloudRenderingProperties (RenderingProperties::PCL_VISUALIZER_LUT, r, g, b, cloud_id)); - EXPECT_FALSE (visualizer.getPointCloudRenderingProperties (PCL_VISUALIZER_LUT_RANGE, + EXPECT_FALSE (visualizer.getPointCloudRenderingProperties (RenderingProperties::PCL_VISUALIZER_LUT_RANGE, r, g, b, cloud_id)); r = 666.; g = 666.; b = 666.; - EXPECT_TRUE (visualizer.getPointCloudRenderingProperties (PCL_VISUALIZER_COLOR, + EXPECT_TRUE (visualizer.getPointCloudRenderingProperties (RenderingProperties::PCL_VISUALIZER_COLOR, r, g, b, cloud_id)); EXPECT_EQ (r, 1.); diff --git a/tools/image_grabber_viewer.cpp b/tools/image_grabber_viewer.cpp index 2669f04e970..7fead2fa14b 100644 --- a/tools/image_grabber_viewer.cpp +++ b/tools/image_grabber_viewer.cpp @@ -163,11 +163,11 @@ main (int argc, char** argv) // // Change the cloud rendered point size // if (psize > 0) - // p->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, psize, "OpenNICloud"); + // p->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, psize, "OpenNICloud"); // // // Change the cloud rendered opacity // if (opaque >= 0) - // p->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY, opaque, "OpenNICloud"); + // p->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, opaque, "OpenNICloud"); cloud_viewer->setBackgroundColor (bcolor[0], bcolor[1], bcolor[2]); diff --git a/tools/obj_rec_ransac_accepted_hypotheses.cpp b/tools/obj_rec_ransac_accepted_hypotheses.cpp index 4c2ec7010e4..19455ec1347 100644 --- a/tools/obj_rec_ransac_accepted_hypotheses.cpp +++ b/tools/obj_rec_ransac_accepted_hypotheses.cpp @@ -186,21 +186,21 @@ showHypothesisAsCoordinateFrame (Hypothesis& hypo, CallbackParameters* parameter coeffs.values[4] = x_dir[1]; coeffs.values[5] = x_dir[2]; parameters->viz_.addLine (coeffs, frame_name + "_x_axis"); - parameters->viz_.setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0, frame_name + "_x_axis"); + parameters->viz_.setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0, frame_name + "_x_axis"); // The y-axis coeffs.values[3] = y_dir[0]; coeffs.values[4] = y_dir[1]; coeffs.values[5] = y_dir[2]; parameters->viz_.addLine (coeffs, frame_name + "_y_axis"); - parameters->viz_.setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_COLOR, 0.0, 1.0, 0.0, frame_name + "_y_axis"); + parameters->viz_.setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, 0.0, 1.0, 0.0, frame_name + "_y_axis"); // The z-axis coeffs.values[3] = z_dir[0]; coeffs.values[4] = z_dir[1]; coeffs.values[5] = z_dir[2]; parameters->viz_.addLine (coeffs, frame_name + "_z_axis"); - parameters->viz_.setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_COLOR, 0.0, 0.0, 1.0, frame_name + "_z_axis"); + parameters->viz_.setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, 0.0, 0.0, 1.0, frame_name + "_z_axis"); } //=============================================================================================================================== @@ -286,11 +286,11 @@ update (CallbackParameters* params) // The lines std::string lines_str_id = "opps"; params->viz_.addModelFromPolyData (vtk_opps, lines_str_id); - params->viz_.setShapeRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, 0.0, 0.0, 1.0, lines_str_id); + params->viz_.setShapeRenderingProperties(pcl::visualization::RenderingProperties::RenderingProperties::PCL_VISUALIZER_COLOR, 0.0, 0.0, 1.0, lines_str_id); // The normals std::string normals_str_id = "opps normals"; params->viz_.addModelFromPolyData (vtk_hh->GetOutput (), normals_str_id); - params->viz_.setShapeRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, 1.0, 1.0, 0.0, normals_str_id); + params->viz_.setShapeRenderingProperties(pcl::visualization::RenderingProperties::RenderingProperties::PCL_VISUALIZER_COLOR, 1.0, 1.0, 0.0, normals_str_id); #endif // Now show some of the accepted hypotheses @@ -434,15 +434,15 @@ run (float pair_width, float voxel_size, float max_coplanarity_angle, int num_hy #ifdef _SHOW_SCENE_POINTS_ viz.addPointCloud (scene_points, "cloud in"); - viz.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 2, "cloud in"); + viz.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 2, "cloud in"); #endif #ifdef _SHOW_OCTREE_POINTS_ PointCloud::Ptr octree_points (new PointCloud ()); objrec.getSceneOctree ().getFullLeavesPoints (*octree_points); viz.addPointCloud (octree_points, "octree points"); - viz.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 5, "octree points"); - viz.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0, "octree points"); + viz.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 5, "octree points"); + viz.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0, "octree points"); #endif #if defined _SHOW_OCTREE_NORMALS_ && defined _SHOW_OCTREE_POINTS_ diff --git a/tools/obj_rec_ransac_model_opps.cpp b/tools/obj_rec_ransac_model_opps.cpp index d06c2f6bc74..82d8f1b97bb 100644 --- a/tools/obj_rec_ransac_model_opps.cpp +++ b/tools/obj_rec_ransac_model_opps.cpp @@ -142,8 +142,8 @@ void run (float pair_width, float voxel_size, float max_coplanarity_angle) model->getOctree ().getFullLeavesPoints (*octree_points); viz.addPointCloud (octree_points, "octree points"); - viz.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 5, "octree points"); - viz.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0, "octree points"); + viz.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 5, "octree points"); + viz.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0, "octree points"); #endif #if defined _SHOW_MODEL_OCTREE_NORMALS_ && defined _SHOW_MODEL_OCTREE_POINTS_ @@ -223,7 +223,7 @@ void showModelOpps (PCLVisualizer& viz, const ModelLibrary::HashTable& hash_tabl #endif viz.addModelFromPolyData (vtk_opps, "opps"); - viz.setShapeRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, 1.0, 1.0, 0.0, "opps"); + viz.setShapeRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, 1.0, 1.0, 0.0, "opps"); printf ("done.\n"); } diff --git a/tools/obj_rec_ransac_orr_octree.cpp b/tools/obj_rec_ransac_orr_octree.cpp index c21a193c4cc..a3a62204468 100644 --- a/tools/obj_rec_ransac_orr_octree.cpp +++ b/tools/obj_rec_ransac_orr_octree.cpp @@ -228,9 +228,9 @@ void run (const char* file_name, float voxel_size) viz.addPointCloudNormals (points_out, normals_out, 1, 6.0f, "normals out"); // Change the appearance - viz.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 2, "cloud in"); - viz.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 5, "cloud out"); - viz.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0, "cloud out"); + viz.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 2, "cloud in"); + viz.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 5, "cloud out"); + viz.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0, "cloud out"); // Convert the octree to a VTK poly-data object // show_octree(&octree, viz, true/*show full leaves only*/); diff --git a/tools/obj_rec_ransac_orr_octree_zprojection.cpp b/tools/obj_rec_ransac_orr_octree_zprojection.cpp index 446d53511d4..82a248f8451 100644 --- a/tools/obj_rec_ransac_orr_octree_zprojection.cpp +++ b/tools/obj_rec_ransac_orr_octree_zprojection.cpp @@ -136,9 +136,9 @@ void run (const char* file_name, float voxel_size) viz.addPointCloud (points_out, "cloud out"); // Change the appearance - viz.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 2, "cloud in"); - viz.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 5, "cloud out"); - viz.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0, "cloud out"); + viz.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 2, "cloud in"); + viz.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 5, "cloud out"); + viz.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0, "cloud out"); #endif // Enter the main loop diff --git a/tools/obj_rec_ransac_result.cpp b/tools/obj_rec_ransac_result.cpp index 12987d7535b..a6359dc8f10 100644 --- a/tools/obj_rec_ransac_result.cpp +++ b/tools/obj_rec_ransac_result.cpp @@ -194,7 +194,7 @@ run (float pair_width, float voxel_size, float max_coplanarity_angle) #ifdef _SHOW_SCENE_POINTS_ viz.addPointCloud (scene_points, "scene points"); - viz.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 2, "scene points"); + viz.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 2, "scene points"); #endif #ifdef _SHOW_OCTREE_POINTS_ @@ -202,10 +202,10 @@ run (float pair_width, float voxel_size, float max_coplanarity_angle) objrec.getSceneOctree ().getFullLeavesPoints (*octree_points); viz.addPointCloud (octree_points, "octree points"); // viz.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "octree points"); - viz.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0, "octree points"); + viz.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0, "octree points"); viz.addPointCloud (plane_points, "plane points"); - viz.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_COLOR, 0.9, 0.9, 0.9, "plane points"); + viz.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, 0.9, 0.9, 0.9, "plane points"); #endif #if defined _SHOW_OCTREE_NORMALS_ && defined _SHOW_OCTREE_POINTS_ diff --git a/tools/obj_rec_ransac_scene_opps.cpp b/tools/obj_rec_ransac_scene_opps.cpp index f3df089c131..99a60b92e07 100644 --- a/tools/obj_rec_ransac_scene_opps.cpp +++ b/tools/obj_rec_ransac_scene_opps.cpp @@ -179,12 +179,12 @@ void update (CallbackParameters* params) std::string lines_str_id = "opps"; params->viz_.removeShape(lines_str_id); params->viz_.addModelFromPolyData (vtk_opps, lines_str_id); - params->viz_.setShapeRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, 0.0, 0.0, 1.0, lines_str_id); + params->viz_.setShapeRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, 0.0, 0.0, 1.0, lines_str_id); // The normals std::string normals_str_id = "opps normals"; params->viz_.removeShape(normals_str_id); params->viz_.addModelFromPolyData (vtk_hh->GetOutput (), normals_str_id); - params->viz_.setShapeRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, 1.0, 1.0, 0.0, normals_str_id); + params->viz_.setShapeRenderingProperties(pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, 1.0, 1.0, 0.0, normals_str_id); } @@ -216,15 +216,15 @@ void run (float pair_width, float voxel_size, float max_coplanarity_angle) #ifdef _SHOW_SCENE_POINTS_ viz.addPointCloud (scene_points, "cloud in"); - viz.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 2, "cloud in"); + viz.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 2, "cloud in"); #endif #ifdef _SHOW_OCTREE_POINTS_ PointCloud::Ptr octree_points (new PointCloud ()); objrec.getSceneOctree ().getFullLeavesPoints (*octree_points); viz.addPointCloud (octree_points, "octree points"); - viz.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 5, "octree points"); - viz.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0, "octree points"); + viz.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 5, "octree points"); + viz.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0, "octree points"); #endif #if defined _SHOW_OCTREE_NORMALS_ && defined _SHOW_OCTREE_POINTS_ diff --git a/tools/octree_viewer.cpp b/tools/octree_viewer.cpp index 23d1cee4d51..f42862a73d2 100644 --- a/tools/octree_viewer.cpp +++ b/tools/octree_viewer.cpp @@ -276,7 +276,7 @@ class OctreeViewer //show centroid points pcl::visualization::PointCloudColorHandlerGenericField color_handler (cloudVoxel, "x"); viz.addPointCloud (cloudVoxel, color_handler, "cloud_centroid"); - viz.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, point_size_, "cloud_centroid"); + viz.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, point_size_, "cloud_centroid"); } if (show_original_points_) @@ -284,7 +284,7 @@ class OctreeViewer //show origin point cloud pcl::visualization::PointCloudColorHandlerGenericField color_handler (cloud, "z"); viz.addPointCloud (cloud, color_handler, "cloud"); - viz.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, point_size_, "cloud"); + viz.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, point_size_, "cloud"); } } diff --git a/tools/pcd_grabber_viewer.cpp b/tools/pcd_grabber_viewer.cpp index dd46219c774..2e1e04fd43f 100644 --- a/tools/pcd_grabber_viewer.cpp +++ b/tools/pcd_grabber_viewer.cpp @@ -148,11 +148,11 @@ main (int argc, char** argv) // // Change the cloud rendered point size // if (psize > 0) - // p->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, psize, "OpenNICloud"); + // p->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, psize, "OpenNICloud"); // // // Change the cloud rendered opacity // if (opaque >= 0) - // p->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY, opaque, "OpenNICloud"); + // p->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, opaque, "OpenNICloud"); cloud_viewer->setBackgroundColor (bcolor[0], bcolor[1], bcolor[2]); diff --git a/tools/pcd_viewer.cpp b/tools/pcd_viewer.cpp index 8ed0062a2b1..d0aac82d473 100644 --- a/tools/pcd_viewer.cpp +++ b/tools/pcd_viewer.cpp @@ -406,15 +406,15 @@ main (int argc, char** argv) // Change the shape rendered color if (fcolorparam && fcolor_r.size () > i && fcolor_g.size () > i && fcolor_b.size () > i) - p->setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_COLOR, fcolor_r[i], fcolor_g[i], fcolor_b[i], cloud_name); + p->setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, fcolor_r[i], fcolor_g[i], fcolor_b[i], cloud_name); // Change the shape rendered point size if (!psize.empty ()) - p->setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, psize.at (i), cloud_name); + p->setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, psize.at (i), cloud_name); // Change the shape rendered opacity if (!opaque.empty ()) - p->setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY, opaque.at (i), cloud_name); + p->setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, opaque.at (i), cloud_name); // Change the shape rendered shading if (!shadings.empty ()) @@ -422,17 +422,17 @@ main (int argc, char** argv) if (shadings[i] == "flat") { print_highlight (stderr, "Setting shading property for %s to FLAT.\n", argv[vtk_file_indices.at (i)]); - p->setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_SHADING, pcl::visualization::PCL_VISUALIZER_SHADING_FLAT, cloud_name); + p->setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_SHADING, pcl::visualization::PCL_VISUALIZER_SHADING_FLAT, cloud_name); } else if (shadings[i] == "gouraud") { print_highlight (stderr, "Setting shading property for %s to GOURAUD.\n", argv[vtk_file_indices.at (i)]); - p->setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_SHADING, pcl::visualization::PCL_VISUALIZER_SHADING_GOURAUD, cloud_name); + p->setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_SHADING, pcl::visualization::PCL_VISUALIZER_SHADING_GOURAUD, cloud_name); } else if (shadings[i] == "phong") { print_highlight (stderr, "Setting shading property for %s to PHONG.\n", argv[vtk_file_indices.at (i)]); - p->setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_SHADING, pcl::visualization::PCL_VISUALIZER_SHADING_PHONG, cloud_name); + p->setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_SHADING, pcl::visualization::PCL_VISUALIZER_SHADING_PHONG, cloud_name); } } } @@ -622,11 +622,11 @@ main (int argc, char** argv) std::string cloud_name_normals_pc = std::string(argv[p_file_indices.at (i)]) + "-" + std::to_string(i) + "-normals"; int factor = (std::min)(normals, pc); p->addPointCloudNormals (cloud_xyz, cloud_normals, factor, normals_scale, cloud_name_normals_pc, viewport); - p->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0, cloud_name_normals_pc); - p->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, 3, cloud_name_normals_pc); + p->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0, cloud_name_normals_pc); + p->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, 3, cloud_name_normals_pc); cloud_name_normals_pc += "-pc"; p->addPointCloudPrincipalCurvatures (cloud_xyz, cloud_normals, cloud_pc, factor, pc_scale, cloud_name_normals_pc, viewport); - p->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, 3, cloud_name_normals_pc); + p->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, 3, cloud_name_normals_pc); } // Add every dimension as a possible color @@ -672,15 +672,15 @@ main (int argc, char** argv) if (use_immediate_rendering) // Set immediate mode rendering ON - p->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_IMMEDIATE_RENDERING, 1.0, cloud_name); + p->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_IMMEDIATE_RENDERING, 1.0, cloud_name); // Change the cloud rendered point size if (!psize.empty ()) - p->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, psize.at (i), cloud_name); + p->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, psize.at (i), cloud_name); // Change the cloud rendered opacity if (!opaque.empty ()) - p->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY, opaque.at (i), cloud_name); + p->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, opaque.at (i), cloud_name); // Reset camera viewpoint to center of cloud if camera parameters were not passed manually and this is the first loaded cloud if (i == 0 && !p->cameraParamsSet () && !p->cameraFileLoaded ()) diff --git a/tools/real_sense_viewer.cpp b/tools/real_sense_viewer.cpp index 92450abbc6e..fe155cc121f 100644 --- a/tools/real_sense_viewer.cpp +++ b/tools/real_sense_viewer.cpp @@ -182,7 +182,7 @@ class RealSenseViewer if (!viewer_.updatePointCloud (new_cloud_, "cloud")) { viewer_.addPointCloud (new_cloud_, "cloud"); - viewer_.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 2, "cloud"); + viewer_.setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, 2, "cloud"); } displaySettings (); last_cloud_ = new_cloud_; diff --git a/visualization/include/pcl/visualization/common/common.h b/visualization/include/pcl/visualization/common/common.h index 67f33740758..c583bf8e8f6 100644 --- a/visualization/include/pcl/visualization/common/common.h +++ b/visualization/include/pcl/visualization/common/common.h @@ -98,7 +98,7 @@ namespace pcl viewScreenArea (const Eigen::Vector3d &eye, const Eigen::Vector3d &min_bb, const Eigen::Vector3d &max_bb, const Eigen::Matrix4d &view_projection_matrix, int width, int height); /** \brief Set of rendering properties. */ - enum RenderingProperties + enum class RenderingProperties { PCL_VISUALIZER_POINT_SIZE, /**< integer starting from 1 */ PCL_VISUALIZER_OPACITY, /**< Float going from 0.0 (transparent) to 1.0 (opaque) */ diff --git a/visualization/include/pcl/visualization/pcl_visualizer.h b/visualization/include/pcl/visualization/pcl_visualizer.h index 4d1d9290e4a..dae24f34ff8 100644 --- a/visualization/include/pcl/visualization/pcl_visualizer.h +++ b/visualization/include/pcl/visualization/pcl_visualizer.h @@ -1147,35 +1147,32 @@ namespace pcl * \param[in] val2 the second value to be set * \param[in] val3 the third value to be set * \param[in] id the point cloud object id (default: cloud) - * \param[in] viewport the view port where the Point Cloud's rendering properties should be modified (default: all) * \note The list of properties can be found in \ref pcl::visualization::LookUpTableRepresentationProperties. */ bool - setPointCloudRenderingProperties (int property, double val1, double val2, double val3, - const std::string &id = "cloud", int viewport = 0); + setPointCloudRenderingProperties (RenderingProperties property, double val1, double val2, double val3, + const std::string &id = "cloud"); /** \brief Set the rendering properties of a PointCloud (2x values - e.g., LUT minmax values) * \param[in] property the property type * \param[in] val1 the first value to be set * \param[in] val2 the second value to be set * \param[in] id the point cloud object id (default: cloud) - * \param[in] viewport the view port where the Point Cloud's rendering properties should be modified (default: all) * \note The list of properties can be found in \ref pcl::visualization::LookUpTableRepresentationProperties. */ bool - setPointCloudRenderingProperties (int property, double val1, double val2, - const std::string &id = "cloud", int viewport = 0); + setPointCloudRenderingProperties (RenderingProperties property, double val1, double val2, + const std::string &id = "cloud"); /** \brief Set the rendering properties of a PointCloud * \param[in] property the property type * \param[in] value the value to be set * \param[in] id the point cloud object id (default: cloud) - * \param[in] viewport the view port where the Point Cloud's rendering properties should be modified (default: all) * \note The list of properties can be found in \ref pcl::visualization::LookUpTableRepresentationProperties. */ bool - setPointCloudRenderingProperties (int property, double value, - const std::string &id = "cloud", int viewport = 0); + setPointCloudRenderingProperties (RenderingProperties property, double value, + const std::string &id = "cloud"); /** \brief Get the rendering properties of a PointCloud * \param[in] property the property type @@ -1184,7 +1181,7 @@ namespace pcl * \note The list of properties can be found in \ref pcl::visualization::LookUpTableRepresentationProperties. */ bool - getPointCloudRenderingProperties (int property, double &value, + getPointCloudRenderingProperties (RenderingProperties property, double &value, const std::string &id = "cloud"); /** \brief Get the rendering properties of a PointCloud @@ -1216,7 +1213,7 @@ namespace pcl * \note The list of properties can be found in \ref pcl::visualization::LookUpTableRepresentationProperties. */ bool - setShapeRenderingProperties (int property, double value, + setShapeRenderingProperties (RenderingProperties property, double value, const std::string &id, int viewport = 0); /** \brief Set the rendering properties of a shape (2x values - e.g., LUT minmax values) @@ -1228,7 +1225,7 @@ namespace pcl * \note When using \ref addPolygonMesh you you should use \ref setPointCloudRenderingProperties */ bool - setShapeRenderingProperties (int property, double val1, double val2, + setShapeRenderingProperties (RenderingProperties property, double val1, double val2, const std::string &id, int viewport = 0); /** \brief Set the rendering properties of a shape (3x values - e.g., RGB) @@ -1241,7 +1238,7 @@ namespace pcl * \note When using \ref addPolygonMesh you you should use \ref setPointCloudRenderingProperties */ bool - setShapeRenderingProperties (int property, double val1, double val2, double val3, + setShapeRenderingProperties (RenderingProperties property, double val1, double val2, double val3, const std::string &id, int viewport = 0); /** \brief Returns true when the user tried to close the window */ diff --git a/visualization/src/cloud_viewer.cpp b/visualization/src/cloud_viewer.cpp index afe884ac235..b19a9405f47 100644 --- a/visualization/src/cloud_viewer.cpp +++ b/visualization/src/cloud_viewer.cpp @@ -68,9 +68,9 @@ namespace pcl pop (const Handler &handler) { double psize = 1.0, opacity = 1.0, linesize =1.0; - viewer->getPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, linesize, cloud_name); - viewer->getPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, cloud_name); - viewer->getPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, psize, cloud_name); + viewer->getPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, linesize, cloud_name); + viewer->getPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, opacity, cloud_name); + viewer->getPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, psize, cloud_name); if (!viewer->updatePointCloud (cloud, handler, cloud_name)) { @@ -79,9 +79,9 @@ namespace pcl } // viewer->removePointCloud (cloud_name); - viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, linesize, cloud_name); - viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, cloud_name); - viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, psize, cloud_name); + viewer->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, linesize, cloud_name); + viewer->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_OPACITY, opacity, cloud_name); + viewer->setPointCloudRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_POINT_SIZE, psize, cloud_name); popped_ = true; } diff --git a/visualization/src/pcl_visualizer.cpp b/visualization/src/pcl_visualizer.cpp index f37d31da8e3..c5235b91aae 100644 --- a/visualization/src/pcl_visualizer.cpp +++ b/visualization/src/pcl_visualizer.cpp @@ -1335,7 +1335,7 @@ pcl::visualization::PCLVisualizer::setBackgroundColor ( ///////////////////////////////////////////////////////////////////////////////////////////// bool pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties ( - int property, double val1, double val2, double val3, const std::string &id, int) + RenderingProperties property, double val1, double val2, double val3, const std::string &id) { // Check to see if this ID entry already exists (has it been already added to the visualizer?) auto am_it = cloud_actor_map_->find (id); @@ -1350,22 +1350,18 @@ pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties ( if (!actor) return (false); - switch (property) + if (property == RenderingProperties::PCL_VISUALIZER_COLOR) { - case PCL_VISUALIZER_COLOR: - { if (val1 > 1.0 || val2 > 1.0 || val3 > 1.0) PCL_WARN ("[setPointCloudRenderingProperties] Colors go from 0.0 to 1.0!\n"); actor->GetProperty ()->SetColor (val1, val2, val3); actor->GetMapper ()->ScalarVisibilityOff (); actor->Modified (); - break; - } - default: - { + } + else + { pcl::console::print_error ("[setPointCloudRenderingProperties] Unknown property (%d) specified!\n", property); return (false); - } } return (true); } @@ -1373,7 +1369,7 @@ pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties ( ///////////////////////////////////////////////////////////////////////////////////////////// bool pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties ( - int property, double val1, double val2, const std::string &id, int) + RenderingProperties property, double val1, double val2, const std::string &id) { // Check to see if this ID entry already exists (has it been already added to the visualizer?) auto am_it = cloud_actor_map_->find (id); @@ -1388,17 +1384,15 @@ pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties ( if (!actor) return (false); - switch (property) + if (property == RenderingProperties::PCL_VISUALIZER_LUT_RANGE) { - case PCL_VISUALIZER_LUT_RANGE: - { // Check if the mapper has scalars if (!actor->GetMapper ()->GetInput ()->GetPointData ()->GetScalars ()) - break; + return (false); // 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; + return (false); // Check that range values are correct if (val1 >= val2) @@ -1411,20 +1405,18 @@ pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties ( actor->GetMapper ()->GetLookupTable ()->SetRange (val1, val2); actor->GetMapper()->UseLookupTableScalarRangeOn (); style_->updateLookUpTableDisplay (false); - break; - } - default: - { + } + else + { pcl::console::print_error ("[setPointCloudRenderingProperties] Unknown property (%d) specified!\n", property); return (false); - } } return (true); } ///////////////////////////////////////////////////////////////////////////////////////////// bool -pcl::visualization::PCLVisualizer::getPointCloudRenderingProperties (int property, double &value, const std::string &id) +pcl::visualization::PCLVisualizer::getPointCloudRenderingProperties (RenderingProperties property, double &value, const std::string &id) { // Check to see if this ID entry already exists (has it been already added to the visualizer?) auto am_it = cloud_actor_map_->find (id); @@ -1438,19 +1430,19 @@ pcl::visualization::PCLVisualizer::getPointCloudRenderingProperties (int propert switch (property) { - case PCL_VISUALIZER_POINT_SIZE: + case RenderingProperties::PCL_VISUALIZER_POINT_SIZE: { value = actor->GetProperty ()->GetPointSize (); actor->Modified (); break; } - case PCL_VISUALIZER_OPACITY: + case RenderingProperties::PCL_VISUALIZER_OPACITY: { value = actor->GetProperty ()->GetOpacity (); actor->Modified (); break; } - case PCL_VISUALIZER_LINE_WIDTH: + case RenderingProperties::PCL_VISUALIZER_LINE_WIDTH: { value = actor->GetProperty ()->GetLineWidth (); actor->Modified (); @@ -1482,25 +1474,21 @@ pcl::visualization::PCLVisualizer::getPointCloudRenderingProperties (RenderingPr if (!actor) return (false); - switch (property) + if (property == RenderingProperties::PCL_VISUALIZER_COLOR) { - case PCL_VISUALIZER_COLOR: - { double rgb[3]; actor->GetProperty ()->GetColor (rgb); val1 = rgb[0]; val2 = rgb[1]; val3 = rgb[2]; - break; - } - default: - { + } + else + { pcl::console::print_error ("[getPointCloudRenderingProperties] " "Property (%d) is either unknown or it requires a different " "number of variables to retrieve its contents.\n", property); return (false); - } } return (true); } @@ -1508,7 +1496,7 @@ pcl::visualization::PCLVisualizer::getPointCloudRenderingProperties (RenderingPr ///////////////////////////////////////////////////////////////////////////////////////////// bool pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties ( - int property, double value, const std::string &id, int) + RenderingProperties property, double value, const std::string &id) { // Check to see if this ID entry already exists (has it been already added to the visualizer?) auto am_it = cloud_actor_map_->find (id); @@ -1525,13 +1513,13 @@ pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties ( switch (property) { - case PCL_VISUALIZER_POINT_SIZE: + case RenderingProperties::PCL_VISUALIZER_POINT_SIZE: { actor->GetProperty ()->SetPointSize (float (value)); actor->Modified (); break; } - case PCL_VISUALIZER_OPACITY: + case RenderingProperties::PCL_VISUALIZER_OPACITY: { actor->GetProperty ()->SetOpacity (value); actor->Modified (); @@ -1542,18 +1530,18 @@ pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties ( // handle larger datasets. The default value is immediate mode off. If you // are having problems rendering a large dataset you might want to consider // using immediate more rendering. - case PCL_VISUALIZER_IMMEDIATE_RENDERING: + case RenderingProperties::PCL_VISUALIZER_IMMEDIATE_RENDERING: { actor->Modified (); break; } - case PCL_VISUALIZER_LINE_WIDTH: + case RenderingProperties::PCL_VISUALIZER_LINE_WIDTH: { actor->GetProperty ()->SetLineWidth (float (value)); actor->Modified (); break; } - case PCL_VISUALIZER_LUT: + case RenderingProperties::PCL_VISUALIZER_LUT: { // Check if the mapper has scalars if (!actor->GetMapper ()->GetInput ()->GetPointData ()->GetScalars ()) @@ -1577,7 +1565,7 @@ pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties ( style_->updateLookUpTableDisplay (false); break; } - case PCL_VISUALIZER_LUT_RANGE: + case RenderingProperties::PCL_VISUALIZER_LUT_RANGE: { // Check if the mapper has scalars if (!actor->GetMapper ()->GetInput ()->GetPointData ()->GetScalars ()) @@ -1643,7 +1631,7 @@ pcl::visualization::PCLVisualizer::setPointCloudSelected (const bool selected, c ///////////////////////////////////////////////////////////////////////////////////////////// bool pcl::visualization::PCLVisualizer::setShapeRenderingProperties ( - int property, double val1, double val2, double val3, const std::string &id, int) + RenderingProperties property, double val1, double val2, double val3, const std::string &id, int) { // Check to see if this ID entry already exists (has it been already added to the visualizer?) auto am_it = shape_actor_map_->find (id); @@ -1658,10 +1646,8 @@ pcl::visualization::PCLVisualizer::setShapeRenderingProperties ( if (!actor) return (false); - switch (property) + if (property == RenderingProperties::PCL_VISUALIZER_COLOR) { - case PCL_VISUALIZER_COLOR: - { if (val1 > 1.0 || val2 > 1.0 || val3 > 1.0) PCL_WARN ("[setShapeRenderingProperties] Colors go from 0.0 to 1.0!\n"); @@ -1676,13 +1662,11 @@ pcl::visualization::PCLVisualizer::setShapeRenderingProperties ( actor->GetProperty ()->SetDiffuse (0.8); actor->GetProperty ()->SetSpecular (0.8); actor->Modified (); - break; - } - default: - { + } + else + { pcl::console::print_error ("[setShapeRenderingProperties] Unknown property (%d) specified!\n", property); return (false); - } } return (true); } @@ -1690,7 +1674,7 @@ pcl::visualization::PCLVisualizer::setShapeRenderingProperties ( ///////////////////////////////////////////////////////////////////////////////////////////// bool pcl::visualization::PCLVisualizer::setShapeRenderingProperties ( - int property, double val1, double val2, const std::string &id, int) + RenderingProperties property, double val1, double val2, const std::string &id, int) { // Check to see if this ID entry already exists (has it been already added to the visualizer?) auto am_it = shape_actor_map_->find (id); @@ -1705,17 +1689,15 @@ pcl::visualization::PCLVisualizer::setShapeRenderingProperties ( if (!actor) return (false); - switch (property) + if (property == RenderingProperties::PCL_VISUALIZER_LUT_RANGE) { - case PCL_VISUALIZER_LUT_RANGE: - { // Check if the mapper has scalars if (!actor->GetMapper ()->GetInput ()->GetPointData ()->GetScalars ()) - break; + return (false); // 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; + return (false); // Check that range values are correct if (val1 >= val2) @@ -1728,13 +1710,11 @@ pcl::visualization::PCLVisualizer::setShapeRenderingProperties ( actor->GetMapper ()->GetLookupTable ()->SetRange (val1, val2); actor->GetMapper()->UseLookupTableScalarRangeOn (); style_->updateLookUpTableDisplay (false); - break; - } - default: - { + } + else + { pcl::console::print_error ("[setShapeRenderingProperties] Unknown property (%d) specified!\n", property); return (false); - } } return (true); } @@ -1742,7 +1722,7 @@ pcl::visualization::PCLVisualizer::setShapeRenderingProperties ( ///////////////////////////////////////////////////////////////////////////////////////////// bool pcl::visualization::PCLVisualizer::setShapeRenderingProperties ( - int property, double value, const std::string &id, int) + RenderingProperties property, double value, const std::string &id, int) { // Check to see if this ID entry already exists (has it been already added to the visualizer?) auto am_it = shape_actor_map_->find (id); @@ -1759,25 +1739,25 @@ pcl::visualization::PCLVisualizer::setShapeRenderingProperties ( switch (property) { - case PCL_VISUALIZER_POINT_SIZE: + case RenderingProperties::PCL_VISUALIZER_POINT_SIZE: { actor->GetProperty ()->SetPointSize (float (value)); actor->Modified (); break; } - case PCL_VISUALIZER_OPACITY: + case RenderingProperties::PCL_VISUALIZER_OPACITY: { actor->GetProperty ()->SetOpacity (value); actor->Modified (); break; } - case PCL_VISUALIZER_LINE_WIDTH: + case RenderingProperties::PCL_VISUALIZER_LINE_WIDTH: { actor->GetProperty ()->SetLineWidth (float (value)); actor->Modified (); break; } - case PCL_VISUALIZER_FONT_SIZE: + case RenderingProperties::PCL_VISUALIZER_FONT_SIZE: { vtkTextActor* text_actor = vtkTextActor::SafeDownCast (am_it->second); if (!text_actor) @@ -1787,7 +1767,7 @@ pcl::visualization::PCLVisualizer::setShapeRenderingProperties ( text_actor->Modified (); break; } - case PCL_VISUALIZER_REPRESENTATION: + case RenderingProperties::PCL_VISUALIZER_REPRESENTATION: { switch (int (value)) { @@ -1810,7 +1790,7 @@ pcl::visualization::PCLVisualizer::setShapeRenderingProperties ( actor->Modified (); break; } - case PCL_VISUALIZER_SHADING: + case RenderingProperties::PCL_VISUALIZER_SHADING: { switch (int (value)) { @@ -1847,7 +1827,7 @@ pcl::visualization::PCLVisualizer::setShapeRenderingProperties ( actor->Modified (); break; } - case PCL_VISUALIZER_LUT: + case RenderingProperties::PCL_VISUALIZER_LUT: { // Check if the mapper has scalars if (!actor->GetMapper ()->GetInput ()->GetPointData ()->GetScalars ()) @@ -1871,7 +1851,7 @@ pcl::visualization::PCLVisualizer::setShapeRenderingProperties ( style_->updateLookUpTableDisplay (false); break; } - case PCL_VISUALIZER_LUT_RANGE: + case RenderingProperties::PCL_VISUALIZER_LUT_RANGE: { // Check if the mapper has scalars if (!actor->GetMapper ()->GetInput ()->GetPointData ()->GetScalars ()) diff --git a/visualization/test/test_shapes.cpp b/visualization/test/test_shapes.cpp index f318665cf96..fa8063c03a6 100644 --- a/visualization/test/test_shapes.cpp +++ b/visualization/test/test_shapes.cpp @@ -26,13 +26,13 @@ main (int , char **) //p.addPolygon (cloud, "polygon"); p.addPolygon (cloud, 1.0, 0.0, 0.0, "polygon", 0); - p.setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, 10, "polygon"); + p.setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, 10, "polygon"); p.addLine ((*cloud)[0], (*cloud)[1], 0.0, 1.0, 0.0); - p.setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, 50, "line"); + p.setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, 50, "line"); p.addSphere ((*cloud)[0], 1, 0.0, 1.0, 0.0); - p.setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, 5, "sphere"); + p.setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, 5, "sphere"); // p.removePolygon ("poly"); p.addText ("text", 200, 200, 1.0, 0, 0, "text"); diff --git a/visualization/test/test_shapes_multiport.cpp b/visualization/test/test_shapes_multiport.cpp index 9adf3b22bfb..19b8b16483b 100644 --- a/visualization/test/test_shapes_multiport.cpp +++ b/visualization/test/test_shapes_multiport.cpp @@ -30,13 +30,13 @@ main (int , char **) //p.addPolygon (cloud, "polygon"); p.addPolygon (cloud, 1.0, 0.0, 0.0, "polygon", leftPort); - p.setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, 10, "polygon", leftPort); + p.setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, 10, "polygon", leftPort); p.addLine ((*cloud)[0], (*cloud)[1], 0.0, 1.0, 0.0, "line", leftPort); - p.setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, 50, "line", leftPort); + p.setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, 50, "line", leftPort); p.addSphere ((*cloud)[0], 1, 0.0, 1.0, 0.0, "sphere", leftPort); - p.setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, 5, "sphere", leftPort); + p.setShapeRenderingProperties (pcl::visualization::RenderingProperties::PCL_VISUALIZER_LINE_WIDTH, 5, "sphere", leftPort); // p.removePolygon ("poly"); p.addText ("text", 200, 200, 1.0, 0, 0, "text", leftPort);