Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
9d684a39
Commit
9d684a39
authored
Jul 05, 2013
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed ref counting bug, minor formatting
parent
45cdc417
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
16 deletions
+10
-16
precomp.hpp
modules/viz/src/precomp.hpp
+3
-1
simple_widgets.cpp
modules/viz/src/simple_widgets.cpp
+2
-5
viz3d_impl.cpp
modules/viz/src/viz3d_impl.cpp
+4
-10
widget.cpp
modules/viz/src/widget.cpp
+1
-0
No files found.
modules/viz/src/precomp.hpp
View file @
9d684a39
#pragma once
#pragma once
#include <opencv2/core.hpp>
#include <map>
#include <map>
#include <ctime>
#include <ctime>
#include <list>
#include <list>
...
@@ -153,5 +152,8 @@
...
@@ -153,5 +152,8 @@
#endif
#endif
#include <q/viz3d_impl.hpp>
#include <opencv2/core.hpp>
#include "opencv2/viz/widget_accessor.hpp"
#include "opencv2/viz/widget_accessor.hpp"
#include <opencv2/viz/widgets.hpp>
#include <opencv2/viz/widgets.hpp>
#include <opencv2/calib3d.hpp>
modules/viz/src/simple_widgets.cpp
View file @
9d684a39
#include "precomp.hpp"
#include "precomp.hpp"
#include <opencv2/calib3d.hpp>
///////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////
/// line widget implementation
/// line widget implementation
...
@@ -135,15 +134,13 @@ temp_viz::ArrowWidget::ArrowWidget(const Point3f& pt1, const Point3f& pt2, const
...
@@ -135,15 +134,13 @@ temp_viz::ArrowWidget::ArrowWidget(const Point3f& pt1, const Point3f& pt2, const
}
}
// Apply the transforms
// Apply the transforms
vtkSmartPointer
<
vtkTransform
>
transform
=
vtkSmartPointer
<
vtkTransform
>
transform
=
vtkSmartPointer
<
vtkTransform
>::
New
();
vtkSmartPointer
<
vtkTransform
>::
New
();
transform
->
Translate
(
startPoint
);
transform
->
Translate
(
startPoint
);
transform
->
Concatenate
(
matrix
);
transform
->
Concatenate
(
matrix
);
transform
->
Scale
(
length
,
length
,
length
);
transform
->
Scale
(
length
,
length
,
length
);
// Transform the polydata
// Transform the polydata
vtkSmartPointer
<
vtkTransformPolyDataFilter
>
transformPD
=
vtkSmartPointer
<
vtkTransformPolyDataFilter
>
transformPD
=
vtkSmartPointer
<
vtkTransformPolyDataFilter
>::
New
();
vtkSmartPointer
<
vtkTransformPolyDataFilter
>::
New
();
transformPD
->
SetTransform
(
transform
);
transformPD
->
SetTransform
(
transform
);
transformPD
->
SetInputConnection
(
arrowSource
->
GetOutputPort
());
transformPD
->
SetInputConnection
(
arrowSource
->
GetOutputPort
());
...
...
modules/viz/src/viz3d_impl.cpp
View file @
9d684a39
#include "precomp.hpp"
#include "precomp.hpp"
#include <q/viz3d_impl.hpp>
namespace
temp_viz
namespace
temp_viz
{
{
...
@@ -865,12 +864,10 @@ bool temp_viz::Viz3d::VizImpl::addPolygon (const cv::Mat& cloud, const Color& co
...
@@ -865,12 +864,10 @@ bool temp_viz::Viz3d::VizImpl::addPolygon (const cv::Mat& cloud, const Color& co
return
(
true
);
return
(
true
);
}
}
#include "opencv2/viz/widget_accessor.hpp"
void
temp_viz
::
Viz3d
::
VizImpl
::
showWidget
(
const
String
&
id
,
const
Widget
&
widget
)
void
temp_viz
::
Viz3d
::
VizImpl
::
showWidget
(
const
String
&
id
,
const
Widget
&
widget
)
{
{
WidgetActorMap
::
iterator
wam_itr
=
widget_actor_map_
->
find
(
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
)
if
(
exists
)
{
{
// Remove it if it exists and add it again
// 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
...
@@ -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
)
bool
temp_viz
::
Viz3d
::
VizImpl
::
removeWidget
(
const
String
&
id
)
{
{
WidgetActorMap
::
iterator
wam_itr
=
widget_actor_map_
->
find
(
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
)
if
(
!
exists
)
{
return
std
::
cout
<<
"[removeWidget] A widget with id <"
<<
id
<<
"> does not exist!"
<<
std
::
endl
,
false
;
std
::
cout
<<
"[removeWidget] A widget with id <"
<<
id
<<
"> does not exist!"
<<
std
::
endl
;
return
false
;
}
if
(
!
removeActorFromRenderer
(
wam_itr
->
second
.
actor
))
if
(
!
removeActorFromRenderer
(
wam_itr
->
second
.
actor
))
return
false
;
return
false
;
...
...
modules/viz/src/widget.cpp
View file @
9d684a39
...
@@ -136,6 +136,7 @@ void temp_viz::Widget::release()
...
@@ -136,6 +136,7 @@ void temp_viz::Widget::release()
if
(
impl_
&&
CV_XADD
(
&
impl_
->
ref_counter
,
-
1
)
==
1
)
if
(
impl_
&&
CV_XADD
(
&
impl_
->
ref_counter
,
-
1
)
==
1
)
{
{
delete
impl_
;
delete
impl_
;
impl_
=
0
;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment