From f480eca6685b8ef1cf1cd8772a55397b58a2c60a Mon Sep 17 00:00:00 2001 From: Anatoly Baksheev Date: Sat, 13 Jul 2013 01:49:59 +0400 Subject: [PATCH] removed Affine3f from coordinate frame constructor --- modules/viz/include/opencv2/viz/widgets.hpp | 4 ++-- modules/viz/src/simple_widgets.cpp | 16 +--------------- modules/viz/src/viz_main.cpp | 2 +- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/modules/viz/include/opencv2/viz/widgets.hpp b/modules/viz/include/opencv2/viz/widgets.hpp index 0471ff9861..d44e22f04c 100644 --- a/modules/viz/include/opencv2/viz/widgets.hpp +++ b/modules/viz/include/opencv2/viz/widgets.hpp @@ -103,13 +103,13 @@ namespace temp_viz class CV_EXPORTS CoordinateSystemWidget : public Widget3D { public: - CoordinateSystemWidget(double scale, const Affine3f& affine); + CoordinateSystemWidget(double scale = 1.0); }; class CV_EXPORTS PolyLineWidget : public Widget3D { public: - PolyLineWidget(InputArray _points, const Color &color = Color::white()); + PolyLineWidget(InputArray points, const Color &color = Color::white()); private: struct CopyImpl; diff --git a/modules/viz/src/simple_widgets.cpp b/modules/viz/src/simple_widgets.cpp index d9184d365b..35c972fc0a 100644 --- a/modules/viz/src/simple_widgets.cpp +++ b/modules/viz/src/simple_widgets.cpp @@ -283,7 +283,7 @@ template<> temp_viz::CubeWidget temp_viz::Widget::cast() /////////////////////////////////////////////////////////////////////////////////////////////// /// coordinate system widget implementation -temp_viz::CoordinateSystemWidget::CoordinateSystemWidget(double scale, const Affine3f& affine) +temp_viz::CoordinateSystemWidget::CoordinateSystemWidget(double scale) { vtkSmartPointer axes = vtkSmartPointer::New (); axes->SetOrigin (0, 0, 0); @@ -313,20 +313,6 @@ temp_viz::CoordinateSystemWidget::CoordinateSystemWidget(double scale, const Aff vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); - - cv::Vec3d t = affine.translation(); - actor->SetPosition (t[0], t[1], t[2]); - - cv::Matx33f m = affine.rotation(); - - cv::Vec3f rvec; - cv::Rodrigues(m, rvec); - - float r_angle = cv::norm(rvec); - rvec *= 1.f/r_angle; - - actor->SetOrientation(0,0,0); - actor->RotateWXYZ(r_angle*180/CV_PI,rvec[0], rvec[1], rvec[2]); WidgetAccessor::setProp(*this, actor); } diff --git a/modules/viz/src/viz_main.cpp b/modules/viz/src/viz_main.cpp index 442a5ff8e7..5dcc7c41ce 100644 --- a/modules/viz/src/viz_main.cpp +++ b/modules/viz/src/viz_main.cpp @@ -7,7 +7,7 @@ #ifndef __APPLE__ vtkRenderWindowInteractor* vtkRenderWindowInteractorFixNew () { - return (vtkRenderWindowInteractor::New ()); + return vtkRenderWindowInteractor::New(); } #endif