Fixed ref counting bug, minor formatting
This commit is contained in:
parent
45cdc41763
commit
9d684a39da
@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include <opencv2/core.hpp>
|
||||
#include <map>
|
||||
#include <ctime>
|
||||
#include <list>
|
||||
@ -153,5 +152,8 @@
|
||||
#endif
|
||||
|
||||
|
||||
#include <q/viz3d_impl.hpp>
|
||||
#include <opencv2/core.hpp>
|
||||
#include "opencv2/viz/widget_accessor.hpp"
|
||||
#include <opencv2/viz/widgets.hpp>
|
||||
#include <opencv2/calib3d.hpp>
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include "precomp.hpp"
|
||||
#include <opencv2/calib3d.hpp>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// line widget implementation
|
||||
@ -135,15 +134,13 @@ temp_viz::ArrowWidget::ArrowWidget(const Point3f& pt1, const Point3f& pt2, const
|
||||
}
|
||||
|
||||
// Apply the transforms
|
||||
vtkSmartPointer<vtkTransform> transform =
|
||||
vtkSmartPointer<vtkTransform>::New();
|
||||
vtkSmartPointer<vtkTransform> transform = vtkSmartPointer<vtkTransform>::New();
|
||||
transform->Translate(startPoint);
|
||||
transform->Concatenate(matrix);
|
||||
transform->Scale(length, length, length);
|
||||
|
||||
// Transform the polydata
|
||||
vtkSmartPointer<vtkTransformPolyDataFilter> transformPD =
|
||||
vtkSmartPointer<vtkTransformPolyDataFilter>::New();
|
||||
vtkSmartPointer<vtkTransformPolyDataFilter> transformPD = vtkSmartPointer<vtkTransformPolyDataFilter>::New();
|
||||
transformPD->SetTransform(transform);
|
||||
transformPD->SetInputConnection(arrowSource->GetOutputPort());
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include "precomp.hpp"
|
||||
#include <q/viz3d_impl.hpp>
|
||||
|
||||
namespace temp_viz
|
||||
{
|
||||
@ -865,12 +864,10 @@ bool temp_viz::Viz3d::VizImpl::addPolygon (const cv::Mat& cloud, const Color& co
|
||||
return (true);
|
||||
}
|
||||
|
||||
#include "opencv2/viz/widget_accessor.hpp"
|
||||
|
||||
void temp_viz::Viz3d::VizImpl::showWidget(const String &id, const Widget &widget)
|
||||
{
|
||||
WidgetActorMap::iterator wam_itr = widget_actor_map_->find(id);
|
||||
bool exists = !(wam_itr == widget_actor_map_->end());
|
||||
bool exists = wam_itr != widget_actor_map_->end();
|
||||
if (exists)
|
||||
{
|
||||
// Remove it if it exists and add it again
|
||||
@ -883,14 +880,11 @@ void temp_viz::Viz3d::VizImpl::showWidget(const String &id, const Widget &widget
|
||||
bool temp_viz::Viz3d::VizImpl::removeWidget(const String &id)
|
||||
{
|
||||
WidgetActorMap::iterator wam_itr = widget_actor_map_->find(id);
|
||||
bool exists = !(wam_itr == widget_actor_map_->end());
|
||||
bool exists = wam_itr != widget_actor_map_->end();
|
||||
|
||||
if (!exists)
|
||||
{
|
||||
std::cout << "[removeWidget] A widget with id <" << id << "> does not exist!" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
return std::cout << "[removeWidget] A widget with id <" << id << "> does not exist!" << std::endl, false;
|
||||
|
||||
if (!removeActorFromRenderer (wam_itr->second.actor))
|
||||
return false;
|
||||
|
||||
|
@ -136,6 +136,7 @@ void temp_viz::Widget::release()
|
||||
if (impl_ && CV_XADD(&impl_->ref_counter, -1) == 1)
|
||||
{
|
||||
delete impl_;
|
||||
impl_ = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user