From 639896b309d630e15ec022c1461696886c16d27e Mon Sep 17 00:00:00 2001 From: matlabbe Date: Mon, 21 Nov 2016 19:10:30 -0500 Subject: [PATCH] CloudViewer: fixed dark textures --- guilib/src/CloudViewer.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/guilib/src/CloudViewer.cpp b/guilib/src/CloudViewer.cpp index eb186f0b..96918dea 100644 --- a/guilib/src/CloudViewer.cpp +++ b/guilib/src/CloudViewer.cpp @@ -52,7 +52,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#if PCL_VERSION_COMPARE(<, 1, 7, 2) #include #include #include @@ -60,7 +59,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#endif #ifdef RTABMAP_OCTOMAP #include @@ -792,7 +790,6 @@ void CloudViewer::removeOctomap() #endif } -#if PCL_VERSION_COMPARE(<, 1, 7, 2) // Copied from PCL 1.8 int textureFromTexMaterial (const pcl::TexMaterial& tex_mat, vtkTexture* vtk_tex) @@ -913,20 +910,13 @@ int textureFromTexMaterial (const pcl::TexMaterial& tex_mat, return (0); } -#endif bool CloudViewer::addTextureMesh ( const pcl::TextureMesh &mesh, const std::string &id, int viewport) { -#if PCL_VERSION_COMPARE(>=, 1, 7, 2) - if(!_visualizer->addTextureMesh(mesh, id, viewport)) - { - return false; - } -#else - // Copied from PCL 1.8 + // Copied from PCL 1.8, modified to ignore vertex color pcl::visualization::CloudActorMap::iterator am_it = _visualizer->getCloudActorMap()->find (id); if (am_it != _visualizer->getCloudActorMap()->end ()) @@ -982,8 +972,8 @@ bool CloudViewer::addTextureMesh ( vtkSmartPointer colors = vtkSmartPointer::New (); bool has_color = false; vtkSmartPointer transformation = vtkSmartPointer::New (); - if ((pcl::getFieldIndex(mesh.cloud, "rgba") != -1) || - (pcl::getFieldIndex(mesh.cloud, "rgb") != -1)) + if (0)//(pcl::getFieldIndex(mesh.cloud, "rgba") != -1) || + //(pcl::getFieldIndex(mesh.cloud, "rgb") != -1)) { pcl::PointCloud cloud; pcl::fromPCLPointCloud2(mesh.cloud, cloud); @@ -1160,8 +1150,6 @@ bool CloudViewer::addTextureMesh ( // Save the viewpoint transformation matrix to the global actor map (*_visualizer->getCloudActorMap())[id].viewpoint_transformation_ = transformation; -#endif - _visualizer->getCloudActorMap()->find(id)->second.actor->GetProperty()->SetLighting(_aSetLighting->isChecked()); _visualizer->getCloudActorMap()->find(id)->second.actor->GetProperty()->SetEdgeVisibility(_aSetEdgeVisibility->isChecked()); return true;