fix crucial bug in get method, hide add and remove methods from user

pull/1453/head
Ozan Tonkal 12 years ago
parent 2969ec0274
commit 286f81f305
  1. 7
      modules/viz/include/opencv2/viz.hpp
  2. 4
      modules/viz/src/viz.cpp

@ -101,8 +101,6 @@ namespace cv
static void release();
Viz3d get(const String &window_name);
void add(Viz3d window);
void remove(const String &window_name);
//! window names automatically have Viz - prefix even though not provided by the users
static void generateWindowName(const String &window_name, String &output);
@ -111,9 +109,14 @@ namespace cv
VizAccessor(); // Singleton
~VizAccessor();
void add(Viz3d window);
void remove(const String &window_name);
static VizAccessor * instance_;
static bool is_instantiated_;
static VizMap viz_map_;
friend class Viz3d;
};
} /* namespace viz */
} /* namespace cv */

@ -126,7 +126,7 @@ cv::viz::Viz3d cv::viz::VizAccessor::get(const String & window_name)
VizMap::iterator vm_itr = viz_map_.find(name);
bool exists = vm_itr != viz_map_.end();
if (exists) return vm_itr->second;
else return viz_map_.insert(VizPair(window_name, Viz3d(window_name))).first->second;
else return Viz3d(window_name);
}
void cv::viz::VizAccessor::add(Viz3d window)
@ -135,7 +135,7 @@ void cv::viz::VizAccessor::add(Viz3d window)
VizMap::iterator vm_itr = viz_map_.find(window_name);
bool exists = vm_itr != viz_map_.end();
if (exists) return ;
viz_map_.insert(std::pair<String,Viz3d>(window_name, window));
viz_map_.insert(VizPair(window_name, window));
}
void cv::viz::VizAccessor::remove(const String &window_name)

Loading…
Cancel
Save