From 7410593d55d09524cff5e9cd6584fa68a95a2996 Mon Sep 17 00:00:00 2001 From: Anatoly Baksheev Date: Sun, 19 Jan 2014 00:13:47 +0400 Subject: [PATCH] fixed warnigns and compiler errors for Ubuntu --- modules/viz/src/clouds.cpp | 4 +-- modules/viz/src/shapes.cpp | 6 ++-- modules/viz/src/vtk/vtkCloudMatSource.cpp | 48 +++++++++++++++---------------- modules/viz/src/vtk/vtkImageMatSource.cpp | 2 +- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/modules/viz/src/clouds.cpp b/modules/viz/src/clouds.cpp index b8567dd..4b84e8e 100644 --- a/modules/viz/src/clouds.cpp +++ b/modules/viz/src/clouds.cpp @@ -219,7 +219,7 @@ void cv::viz::WCloudCollection::addCloud(InputArray cloud, InputArray colors, co mapper->ImmediateModeRenderingOff(); VtkUtils::SetInputData(mapper, polydata); - actor->SetNumberOfCloudPoints(std::max(1, polydata->GetNumberOfPoints()/10)); + actor->SetNumberOfCloudPoints(std::max(1, polydata->GetNumberOfPoints()/10)); actor->GetProperty()->SetInterpolationToFlat(); actor->GetProperty()->BackfaceCullingOn(); actor->SetMapper(mapper); @@ -236,7 +236,7 @@ void cv::viz::WCloudCollection::addCloud(InputArray cloud, InputArray colors, co VtkUtils::SetInputData(mapper, append_filter->GetOutput()); - actor->SetNumberOfCloudPoints(std::max(1, actor->GetNumberOfCloudPoints() + polydata->GetNumberOfPoints()/10)); + actor->SetNumberOfCloudPoints(std::max(1, actor->GetNumberOfCloudPoints() + polydata->GetNumberOfPoints()/10)); } void cv::viz::WCloudCollection::addCloud(InputArray cloud, const Color &color, const Affine3d &pose) diff --git a/modules/viz/src/shapes.cpp b/modules/viz/src/shapes.cpp index 9011d0b..cc3a51c 100644 --- a/modules/viz/src/shapes.cpp +++ b/modules/viz/src/shapes.cpp @@ -1064,9 +1064,9 @@ cv::viz::WTrajectorySpheres::WTrajectorySpheres(InputArray _path, double line_le line_source->SetPoint1(curr.val); line_source->SetPoint2(lend.val); line_source->Update(); - vtkSmartPointer polydata = line_source->GetOutput(); - polydata->GetCellData()->SetScalars(VtkUtils::FillScalars(polydata->GetNumberOfCells(), c)); - VtkUtils::AddInputData(append_filter, polydata); + vtkSmartPointer polydata_ = line_source->GetOutput(); + polydata_->GetCellData()->SetScalars(VtkUtils::FillScalars(polydata_->GetNumberOfCells(), c)); + VtkUtils::AddInputData(append_filter, polydata_); } } append_filter->Update(); diff --git a/modules/viz/src/vtk/vtkCloudMatSource.cpp b/modules/viz/src/vtk/vtkCloudMatSource.cpp index 9a341b7..e950a0d 100644 --- a/modules/viz/src/vtk/vtkCloudMatSource.cpp +++ b/modules/viz/src/vtk/vtkCloudMatSource.cpp @@ -116,17 +116,17 @@ int cv::viz::vtkCloudMatSource::SetColorCloudNormals(InputArray _cloud, InputArr CV_Assert(_normals.channels() == 3 || _normals.channels() == 4); CV_Assert(_normals.size() == _cloud.size()); - Mat cloud = _cloud.getMat(); - Mat normals = _normals.getMat(); - - if (normals.depth() == CV_32F && cloud.depth() == CV_32F) - filterNanNormalsCopy(normals, cloud, total); - else if (normals.depth() == CV_32F && cloud.depth() == CV_64F) - filterNanNormalsCopy(normals, cloud, total); - else if (normals.depth() == CV_64F && cloud.depth() == CV_32F) - filterNanNormalsCopy(normals, cloud, total); - else if (normals.depth() == CV_64F && cloud.depth() == CV_64F) - filterNanNormalsCopy(normals, cloud, total); + Mat c = _cloud.getMat(); + Mat n = _normals.getMat(); + + if (n.depth() == CV_32F && c.depth() == CV_32F) + filterNanNormalsCopy(n, c, total); + else if (n.depth() == CV_32F && c.depth() == CV_64F) + filterNanNormalsCopy(n, c, total); + else if (n.depth() == CV_64F && c.depth() == CV_32F) + filterNanNormalsCopy(n, c, total); + else if (n.depth() == CV_64F && c.depth() == CV_64F) + filterNanNormalsCopy(n, c, total); else CV_Assert(!"Unsupported normals/cloud type"); @@ -143,17 +143,17 @@ int cv::viz::vtkCloudMatSource::SetColorCloudNormalsTCoords(InputArray _cloud, I CV_Assert(_tcoords.depth() == CV_32F || _tcoords.depth() == CV_64F); CV_Assert(_tcoords.channels() == 2 && _tcoords.size() == _cloud.size()); - Mat cloud = _cloud.getMat(); - Mat tcoords = _tcoords.getMat(); - - if (tcoords.depth() == CV_32F && cloud.depth() == CV_32F) - filterNanTCoordsCopy(tcoords, cloud, total); - else if (tcoords.depth() == CV_32F && cloud.depth() == CV_64F) - filterNanTCoordsCopy(tcoords, cloud, total); - else if (tcoords.depth() == CV_64F && cloud.depth() == CV_32F) - filterNanTCoordsCopy(tcoords, cloud, total); - else if (tcoords.depth() == CV_64F && cloud.depth() == CV_64F) - filterNanTCoordsCopy(tcoords, cloud, total); + Mat cl = _cloud.getMat(); + Mat tc = _tcoords.getMat(); + + if (tc.depth() == CV_32F && cl.depth() == CV_32F) + filterNanTCoordsCopy(tc, cl, total); + else if (tc.depth() == CV_32F && cl.depth() == CV_64F) + filterNanTCoordsCopy(tc, cl, total); + else if (tc.depth() == CV_64F && cl.depth() == CV_32F) + filterNanTCoordsCopy(tc, cl, total); + else if (tc.depth() == CV_64F && cl.depth() == CV_64F) + filterNanTCoordsCopy(tc, cl, total); else CV_Assert(!"Unsupported tcoords/cloud type"); @@ -241,7 +241,7 @@ void cv::viz::vtkCloudMatSource::filterNanColorsCopy(const Mat& cloud_colors, co template void cv::viz::vtkCloudMatSource::filterNanNormalsCopy(const Mat& cloud_normals, const Mat& mask, int total) { - normals = vtkSmartPointer< VtkDepthTraits<_Tn>::array_type >::New(); + normals = vtkSmartPointer< typename VtkDepthTraits<_Tn>::array_type >::New(); normals->SetName("Normals"); normals->SetNumberOfComponents(3); normals->SetNumberOfTuples(total); @@ -267,7 +267,7 @@ template void cv::viz::vtkCloudMatSource::filterNanTCoordsCopy(const Mat& _tcoords, const Mat& mask, int total) { typedef Vec<_Tn, 2> Vec2; - tcoords = vtkSmartPointer< VtkDepthTraits<_Tn>::array_type >::New(); + tcoords = vtkSmartPointer< typename VtkDepthTraits<_Tn>::array_type >::New(); tcoords->SetName("TextureCoordinates"); tcoords->SetNumberOfComponents(2); tcoords->SetNumberOfTuples(total); diff --git a/modules/viz/src/vtk/vtkImageMatSource.cpp b/modules/viz/src/vtk/vtkImageMatSource.cpp index 54500cb..58a5642 100644 --- a/modules/viz/src/vtk/vtkImageMatSource.cpp +++ b/modules/viz/src/vtk/vtkImageMatSource.cpp @@ -78,7 +78,7 @@ int cv::viz::vtkImageMatSource::RequestData(vtkInformation*, vtkInformationVecto void cv::viz::vtkImageMatSource::SetImage(InputArray _image) { - CV_Assert(_image.depth() == CV_8U && _image.channels() == 1 || _image.channels() == 3 || _image.channels() == 4); + CV_Assert(_image.depth() == CV_8U && (_image.channels() == 1 || _image.channels() == 3 || _image.channels() == 4)); Mat image = _image.getMat(); -- 2.7.4