From: Anatoly Baksheev Date: Sun, 24 Nov 2013 16:06:54 +0000 (+0400) Subject: removed unused code X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~3647^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fb62a66b6962d1d0d9df4f085d05d1952f402093;p=platform%2Fupstream%2Fopencv.git removed unused code --- diff --git a/modules/viz/src/interactor_style.h b/modules/viz/src/interactor_style.hpp similarity index 100% rename from modules/viz/src/interactor_style.h rename to modules/viz/src/interactor_style.hpp diff --git a/modules/viz/src/precomp.hpp b/modules/viz/src/precomp.hpp index 1b685e8..57b421d 100644 --- a/modules/viz/src/precomp.hpp +++ b/modules/viz/src/precomp.hpp @@ -70,7 +70,7 @@ #include #include #include -#include +//#include #include #include #include @@ -105,7 +105,6 @@ #include #include #include -#include #include #include #include @@ -119,6 +118,7 @@ #include #include #include +#include #if defined __GNUC__ && defined __DEPRECATED_DISABLED__ #define __DEPRECATED @@ -136,7 +136,6 @@ namespace cv { typedef std::map > WidgetActorMap; typedef std::map VizMap; - typedef std::pair VizPair; class VizStorage { @@ -162,7 +161,7 @@ namespace cv } } -#include "interactor_style.h" +#include "interactor_style.hpp" #include "viz3d_impl.hpp" diff --git a/modules/viz/src/viz.cpp b/modules/viz/src/viz.cpp index 703da98..4b88d7d 100644 --- a/modules/viz/src/viz.cpp +++ b/modules/viz/src/viz.cpp @@ -125,7 +125,7 @@ void cv::viz::VizStorage::add(Viz3d window) String window_name = window.getWindowName(); VizMap::iterator vm_itr = storage.find(window_name); CV_Assert(vm_itr == storage.end()); - storage.insert(VizPair(window_name, window)); + storage.insert(std::make_pair(window_name, window)); } bool cv::viz::VizStorage::windowExists(const String &window_name) diff --git a/modules/viz/src/viz3d_impl.cpp b/modules/viz/src/viz3d_impl.cpp index 14107c5..d868c48 100644 --- a/modules/viz/src/viz3d_impl.cpp +++ b/modules/viz/src/viz3d_impl.cpp @@ -95,9 +95,9 @@ cv::viz::Viz3d::VizImpl::VizImpl(const String &name) timer_id_ = interactor_->CreateRepeatingTimer(5000L); // Set a simple PointPicker - vtkSmartPointer pp = vtkSmartPointer::New(); - pp->SetTolerance(pp->GetTolerance() * 2); - interactor_->SetPicker(pp); + //vtkSmartPointer pp = vtkSmartPointer::New(); + //pp->SetTolerance(pp->GetTolerance() * 2); + //interactor_->SetPicker(pp); exit_main_loop_timer_callback_ = vtkSmartPointer::New(); exit_main_loop_timer_callback_->viz_ = this; @@ -112,8 +112,7 @@ cv::viz::Viz3d::VizImpl::VizImpl(const String &name) ////////////////////////////// - String window_name; - VizAccessor::generateWindowName(name, window_name); + String window_name = VizStorage::generateWindowName(name); window_->SetWindowName(window_name.c_str()); } @@ -314,45 +313,6 @@ bool cv::viz::Viz3d::VizImpl::removeActorFromRenderer(const vtkSmartPointer &data, vtkSmartPointer &actor, bool use_scalars) -{ - if (!actor) - actor = vtkSmartPointer::New(); - - vtkSmartPointer mapper = vtkSmartPointer::New(); -#if VTK_MAJOR_VERSION <= 5 - mapper->SetInput(data); -#else - mapper->SetInputData(data); -#endif - - if (use_scalars) - { - vtkSmartPointer scalars = data->GetPointData()->GetScalars(); - if (scalars) - { - cv::Vec3d minmax(scalars->GetRange()); - mapper->SetScalarRange(minmax.val); - mapper->SetScalarModeToUsePointData(); - - // interpolation OFF, if data is a vtkPolyData that contains only vertices, ON for anything else. - vtkPolyData* polyData = vtkPolyData::SafeDownCast(data); - bool interpolation = (polyData && polyData->GetNumberOfCells() != polyData->GetNumberOfVerts()); - - mapper->SetInterpolateScalarsBeforeMapping(interpolation); - mapper->ScalarVisibilityOn(); - } - } - mapper->ImmediateModeRenderingOff(); - - actor->SetNumberOfCloudPoints(int(std::max(1, data->GetNumberOfPoints() / 10))); - actor->GetProperty()->SetInterpolationToFlat(); - actor->GetProperty()->BackfaceCullingOn(); - - actor->SetMapper(mapper); -} - ////////////////////////////////////////////////////////////////////////////////////////////// void cv::viz::Viz3d::VizImpl::setBackgroundColor(const Color& color) { @@ -542,48 +502,6 @@ void cv::viz::Viz3d::VizImpl::setRepresentation(int representation) } } -////////////////////////////////////////////////////////////////////////////////////////////// -void cv::viz::Viz3d::VizImpl::updateCells(vtkSmartPointer &cells, vtkSmartPointer &initcells, vtkIdType nr_points) -{ - // If no init cells and cells has not been initialized... - if (!cells) - cells = vtkSmartPointer::New(); - - // If we have less values then we need to recreate the array - if (cells->GetNumberOfTuples() < nr_points) - { - cells = vtkSmartPointer::New(); - - // If init cells is given, and there's enough data in it, use it - if (initcells && initcells->GetNumberOfTuples() >= nr_points) - { - cells->DeepCopy(initcells); - cells->SetNumberOfComponents(2); - cells->SetNumberOfTuples(nr_points); - } - else - { - // If the number of tuples is still too small, we need to recreate the array - cells->SetNumberOfComponents(2); - cells->SetNumberOfTuples(nr_points); - vtkIdType *cell = cells->GetPointer(0); - // Fill it with 1s - std::fill(cell, cell + nr_points * 2, 1); - cell++; - for (vtkIdType i = 0; i < nr_points; ++i, cell += 2) - *cell = i; - // Save the results in initcells - initcells = vtkSmartPointer::New(); - initcells->DeepCopy(cells); - } - } - else - { - // The assumption here is that the current set of cells has more data than needed - cells->SetNumberOfComponents(2); - cells->SetNumberOfTuples(nr_points); - } -} ////////////////////////////////////////////////////////////////////////////////////////////// void cv::viz::Viz3d::VizImpl::setFullScreen(bool mode) diff --git a/modules/viz/src/viz3d_impl.hpp b/modules/viz/src/viz3d_impl.hpp index 88f8424..59f45a8 100644 --- a/modules/viz/src/viz3d_impl.hpp +++ b/modules/viz/src/viz3d_impl.hpp @@ -52,7 +52,6 @@ struct cv::viz::Viz3d::VizImpl { public: - typedef cv::Ptr Ptr; typedef Viz3d::KeyboardCallback KeyboardCallback; typedef Viz3d::MouseCallback MouseCallback; @@ -181,9 +180,6 @@ private: bool camera_set_; bool removeActorFromRenderer(const vtkSmartPointer &actor); - - void createActorFromVTKDataSet(const vtkSmartPointer &data, vtkSmartPointer &actor, bool use_scalars = true); - void updateCells(vtkSmartPointer &cells, vtkSmartPointer &initcells, vtkIdType nr_points); };