Skip to content

Commit

Permalink
Merge branch 'AddRemovePointAndRerender' into FixUpdatePointCloud
Browse files Browse the repository at this point in the history
  • Loading branch information
larshg committed May 3, 2020
2 parents f21f977 + 20738c4 commit 8607dc0
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/visualization/test_visualization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

#include <pcl/test/gtest.h>

#include <pcl/common/generate.h>
#include <pcl/point_types.h>
#include <pcl/io/pcd_io.h>
#include <pcl/features/normal_3d.h>
Expand All @@ -60,6 +61,26 @@ PointCloud<PointNormal>::Ptr cloud_with_normals1 (new PointCloud<PointNormal>);
search::KdTree<PointXYZ>::Ptr tree3;
search::KdTree<PointNormal>::Ptr tree4;

////////////////////////////////////////////////////////////////////////////////
TEST(PCL, PCLVisualizer_updatePointCloud)
{
pcl::common::CloudGenerator<pcl::PointXYZRGB, pcl::common::UniformGenerator<float> > generator;

pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGB>());
int result = generator.fill(3, 1, *cloud);

// Setup a basic viewport window
pcl::visualization::PCLVisualizer::Ptr viewer(new pcl::visualization::PCLVisualizer("3D Viewer"));
pcl::visualization::PointCloudColorHandlerCustom<pcl::PointXYZRGB> color_green(cloud, 0, 225, 100);
viewer->addPointCloud<pcl::PointXYZRGB>(cloud, color_green, "sample cloud");

// remove points one by one)
while (!cloud->empty()) {
cloud->erase(cloud->end() - 1);
viewer->updatePointCloud(cloud, "sample cloud");
viewer->spinOnce(100);
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TEST (PCL, PCLVisualizer_camera)
{
Expand Down

0 comments on commit 8607dc0

Please sign in to comment.