From c6a8bd65a8cd22db4907f57fad5ec65c1c9a9405 Mon Sep 17 00:00:00 2001 From: Anatoly Baksheev Date: Thu, 11 Jul 2013 13:54:36 +0400 Subject: [PATCH] fixed some warnings for windows minor buitification --- modules/viz/include/opencv2/viz/widgets.hpp | 6 +++--- modules/viz/src/interactor_style.cpp | 2 +- modules/viz/src/precomp.hpp | 21 +++++++++++++++++++ modules/viz/src/q/interactor_style.h | 2 +- modules/viz/src/q/viz3d_impl.hpp | 6 +++++- modules/viz/src/simple_widgets.cpp | 5 ----- modules/viz/src/viz3d_impl.cpp | 23 +-------------------- 7 files changed, 32 insertions(+), 33 deletions(-) diff --git a/modules/viz/include/opencv2/viz/widgets.hpp b/modules/viz/include/opencv2/viz/widgets.hpp index 06750238e..0471ff986 100644 --- a/modules/viz/include/opencv2/viz/widgets.hpp +++ b/modules/viz/include/opencv2/viz/widgets.hpp @@ -142,8 +142,8 @@ namespace temp_viz class CV_EXPORTS CloudWidget : public Widget3D { public: - CloudWidget(InputArray _cloud, InputArray _colors); - CloudWidget(InputArray _cloud, const Color &color = Color::white()); + CloudWidget(InputArray cloud, InputArray colors); + CloudWidget(InputArray cloud, const Color &color = Color::white()); private: struct CreateCloudWidget; @@ -152,7 +152,7 @@ namespace temp_viz class CV_EXPORTS CloudNormalsWidget : public Widget3D { public: - CloudNormalsWidget(InputArray _cloud, InputArray _normals, int level = 100, float scale = 0.02f, const Color &color = Color::white()); + CloudNormalsWidget(InputArray cloud, InputArray normals, int level = 100, float scale = 0.02f, const Color &color = Color::white()); private: struct ApplyCloudNormals; diff --git a/modules/viz/src/interactor_style.cpp b/modules/viz/src/interactor_style.cpp index 62d2d2084..6e7bc7490 100644 --- a/modules/viz/src/interactor_style.cpp +++ b/modules/viz/src/interactor_style.cpp @@ -78,7 +78,7 @@ void temp_viz::InteractorStyle::OnChar () else if (key.find ("XF86ZoomOut") != std::string::npos) zoomOut (); - bool keymod = false; + int keymod = false; switch (modifier_) { case KB_MOD_ALT: diff --git a/modules/viz/src/precomp.hpp b/modules/viz/src/precomp.hpp index 7f3588e6b..4a53d7a4a 100644 --- a/modules/viz/src/precomp.hpp +++ b/modules/viz/src/precomp.hpp @@ -157,3 +157,24 @@ #include "opencv2/viz/widget_accessor.hpp" #include #include + +namespace temp_viz +{ + template Vec<_Tp, 3>* vtkpoints_data(vtkSmartPointer& points); + + template<> static inline 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<> static inline 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); + } +} diff --git a/modules/viz/src/q/interactor_style.h b/modules/viz/src/q/interactor_style.h index e6c8c3b86..267b2b619 100644 --- a/modules/viz/src/q/interactor_style.h +++ b/modules/viz/src/q/interactor_style.h @@ -28,7 +28,7 @@ namespace temp_viz * \author Radu B. Rusu * \ingroup visualization */ - class CV_EXPORTS InteractorStyle : public vtkInteractorStyleTrackballCamera + class InteractorStyle : public vtkInteractorStyleTrackballCamera { public: diff --git a/modules/viz/src/q/viz3d_impl.hpp b/modules/viz/src/q/viz3d_impl.hpp index b028812fb..c2b79b429 100644 --- a/modules/viz/src/q/viz3d_impl.hpp +++ b/modules/viz/src/q/viz3d_impl.hpp @@ -12,7 +12,7 @@ namespace temp_viz { -class CV_EXPORTS Viz3d::VizImpl +struct Viz3d::VizImpl { public: typedef cv::Ptr Ptr; @@ -366,6 +366,10 @@ struct ApplyAffine result[2] = (_Tp)(m[8] * v[0] + m[9] * v[1] + m[10] * v[2] + m[11]); return result; } + +private: + ApplyAffine(const ApplyAffine&); + ApplyAffine& operator=(const ApplyAffine&); }; } diff --git a/modules/viz/src/simple_widgets.cpp b/modules/viz/src/simple_widgets.cpp index 49e9f6811..fb863de4d 100644 --- a/modules/viz/src/simple_widgets.cpp +++ b/modules/viz/src/simple_widgets.cpp @@ -1,10 +1,5 @@ #include "precomp.hpp" -namespace temp_viz -{ - template Vec<_Tp, 3>* vtkpoints_data(vtkSmartPointer& points); -} - /////////////////////////////////////////////////////////////////////////////////////////////// /// line widget implementation temp_viz::LineWidget::LineWidget(const Point3f &pt1, const Point3f &pt2, const Color &color) diff --git a/modules/viz/src/viz3d_impl.cpp b/modules/viz/src/viz3d_impl.cpp index 1a1fca699..d04348e3e 100644 --- a/modules/viz/src/viz3d_impl.cpp +++ b/modules/viz/src/viz3d_impl.cpp @@ -1,26 +1,5 @@ #include "precomp.hpp" -namespace temp_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); - } -} - void temp_viz::Viz3d::VizImpl::setFullScreen (bool mode) { if (window_) @@ -577,4 +556,4 @@ temp_viz::Affine3f temp_viz::Viz3d::VizImpl::getWidgetPose(const String &id) con vtkSmartPointer matrix = actor->GetUserMatrix(); Matx44f matrix_cv = convertToMatx(matrix); return Affine3f(matrix_cv); -} \ No newline at end of file +}