diff --git a/modules/viz/src/shapes.cpp b/modules/viz/src/shapes.cpp index c177a9b673..bcd6870df1 100644 --- a/modules/viz/src/shapes.cpp +++ b/modules/viz/src/shapes.cpp @@ -45,14 +45,6 @@ #include "precomp.hpp" -namespace cv -{ - namespace viz - { - template Vec<_Tp, 3>* vtkpoints_data(vtkSmartPointer& points); - } -} - /////////////////////////////////////////////////////////////////////////////////////////////// /// line widget implementation cv::viz::WLine::WLine(const Point3d &pt1, const Point3d &pt2, const Color &color) @@ -350,7 +342,7 @@ cv::viz::WCoordinateSystem::WCoordinateSystem(double scale) polydata->GetPointData()->SetScalars(colors); vtkSmartPointer tube_filter = vtkSmartPointer::New(); - VtkUtils::SetInputData(tube_filter, polydata); + tube_filter->SetInputConnection(polydata->GetProducerPort()); tube_filter->SetRadius(axes->GetScaleFactor() / 50.0); tube_filter->SetNumberOfSides(6); @@ -445,11 +437,7 @@ namespace cv { namespace viz { namespace // Extract the edges so we have the grid vtkSmartPointer filter = vtkSmartPointer::New(); -#if VTK_MAJOR_VERSION <= 5 filter->SetInputConnection(grid->GetProducerPort()); -#else - filter->SetInputData(grid); -#endif filter->Update(); return filter->GetOutput(); } @@ -461,11 +449,7 @@ cv::viz::WGrid::WGrid(const Vec2i &dimensions, const Vec2d &spacing, const Color vtkSmartPointer grid = GridUtils::createGrid(dimensions, spacing); vtkSmartPointer mapper = vtkSmartPointer::New(); -#if VTK_MAJOR_VERSION <= 5 mapper->SetInputConnection(grid->GetProducerPort()); -#else - mapper->SetInputData(grid); -#endif vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); diff --git a/modules/viz/src/vizcore.cpp b/modules/viz/src/vizcore.cpp index ffb2d84f55..a6b2fffaa1 100644 --- a/modules/viz/src/vizcore.cpp +++ b/modules/viz/src/vizcore.cpp @@ -64,27 +64,6 @@ cv::Affine3d cv::viz::makeCameraPose(const Vec3d& position, const Vec3d& focal_p return makeTransformToGlobal(u, v, n, position); } -namespace cv { namespace viz -{ - template Vec<_Tp, 3>* vtkpoints_data(vtkSmartPointer& points); - - template<> Vec3f* vtkpoints_data(vtkSmartPointer& points) - { - CV_Assert(points->GetDataType() == VTK_FLOAT); - vtkDataArray *data = points->GetData(); - float *pointer = static_cast(data)->GetPointer(0); - return reinterpret_cast(pointer); - } - - template<> Vec3d* vtkpoints_data(vtkSmartPointer& points) - { - CV_Assert(points->GetDataType() == VTK_DOUBLE); - vtkDataArray *data = points->GetData(); - double *pointer = static_cast(data)->GetPointer(0); - return reinterpret_cast(pointer); - } -}} - /////////////////////////////////////////////////////////////////////////////////////////////// /// VizStorage implementation @@ -308,11 +287,7 @@ void cv::viz::computeNormals(const Mesh3d& mesh, OutputArray _normals) vtkSmartPointer polydata = getPolyData(WMesh(mesh)); vtkSmartPointer normal_generator = vtkSmartPointer::New(); -#if VTK_MAJOR_VERSION <= 5 - normal_generator->SetInput(polydata); -#else - normal_generator->SetInputData(polydata); -#endif + normal_generator->SetInputConnection(polydata->GetProducerPort()); normal_generator->ComputePointNormalsOn(); normal_generator->ComputeCellNormalsOff();