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
0bbaf5d4
Commit
0bbaf5d4
authored
Aug 22, 2013
by
ozantonkal
Committed by
Ozan Tonkal
Sep 05, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removeAllWidgets implementation, removed other remove methods
parent
e106dcc6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
112 deletions
+7
-112
viz3d.hpp
modules/viz/include/opencv2/viz/viz3d.hpp
+1
-0
viz3d.cpp
modules/viz/src/viz3d.cpp
+1
-0
viz3d_impl.cpp
modules/viz/src/viz3d_impl.cpp
+4
-95
viz3d_impl.hpp
modules/viz/src/viz3d_impl.hpp
+1
-17
No files found.
modules/viz/include/opencv2/viz/viz3d.hpp
View file @
0bbaf5d4
...
...
@@ -37,6 +37,7 @@ namespace cv
void
showWidget
(
const
String
&
id
,
const
Widget
&
widget
,
const
Affine3f
&
pose
=
Affine3f
::
Identity
());
void
removeWidget
(
const
String
&
id
);
Widget
getWidget
(
const
String
&
id
)
const
;
void
removeAllWidgets
();
void
setWidgetPose
(
const
String
&
id
,
const
Affine3f
&
pose
);
void
updateWidgetPose
(
const
String
&
id
,
const
Affine3f
&
pose
);
...
...
modules/viz/src/viz3d.cpp
View file @
0bbaf5d4
...
...
@@ -79,6 +79,7 @@ void cv::viz::Viz3d::registerMouseCallback(MouseCallback callback, void* cookie)
void
cv
::
viz
::
Viz3d
::
showWidget
(
const
String
&
id
,
const
Widget
&
widget
,
const
Affine3f
&
pose
)
{
impl_
->
showWidget
(
id
,
widget
,
pose
);
}
void
cv
::
viz
::
Viz3d
::
removeWidget
(
const
String
&
id
)
{
impl_
->
removeWidget
(
id
);
}
cv
::
viz
::
Widget
cv
::
viz
::
Viz3d
::
getWidget
(
const
String
&
id
)
const
{
return
impl_
->
getWidget
(
id
);
}
void
cv
::
viz
::
Viz3d
::
removeAllWidgets
()
{
impl_
->
removeAllWidgets
();
}
void
cv
::
viz
::
Viz3d
::
setWidgetPose
(
const
String
&
id
,
const
Affine3f
&
pose
)
{
impl_
->
setWidgetPose
(
id
,
pose
);
}
void
cv
::
viz
::
Viz3d
::
updateWidgetPose
(
const
String
&
id
,
const
Affine3f
&
pose
)
{
impl_
->
updateWidgetPose
(
id
,
pose
);
}
cv
::
Affine3f
cv
::
viz
::
Viz3d
::
getWidgetPose
(
const
String
&
id
)
const
{
return
impl_
->
getWidgetPose
(
id
);
}
...
...
modules/viz/src/viz3d_impl.cpp
View file @
0bbaf5d4
...
...
@@ -128,104 +128,13 @@ void cv::viz::Viz3d::VizImpl::spinOnce (int time, bool force_redraw)
}
}
/////////////////////////////////////////////////////////////////////////////////////////////
bool
cv
::
viz
::
Viz3d
::
VizImpl
::
removePointCloud
(
const
std
::
string
&
id
)
{
CloudActorMap
::
iterator
am_it
=
cloud_actor_map_
->
find
(
id
);
if
(
am_it
==
cloud_actor_map_
->
end
())
return
false
;
if
(
removeActorFromRenderer
(
am_it
->
second
.
actor
))
return
cloud_actor_map_
->
erase
(
am_it
),
true
;
return
false
;
}
/////////////////////////////////////////////////////////////////////////////////////////////
bool
cv
::
viz
::
Viz3d
::
VizImpl
::
removeShape
(
const
std
::
string
&
id
)
{
// Check to see if the given ID entry exists
ShapeActorMap
::
iterator
am_it
=
shape_actor_map_
->
find
(
id
);
// Extra step: check if there is a cloud with the same ID
CloudActorMap
::
iterator
ca_it
=
cloud_actor_map_
->
find
(
id
);
bool
shape
=
true
;
// Try to find a shape first
if
(
am_it
==
shape_actor_map_
->
end
())
{
// There is no cloud or shape with this ID, so just exit
if
(
ca_it
==
cloud_actor_map_
->
end
())
return
false
;
// Cloud found, set shape to false
shape
=
false
;
}
// Remove the pointer/ID pair to the global actor map
if
(
shape
)
{
if
(
removeActorFromRenderer
(
am_it
->
second
))
{
shape_actor_map_
->
erase
(
am_it
);
return
(
true
);
}
}
else
{
if
(
removeActorFromRenderer
(
ca_it
->
second
.
actor
))
{
cloud_actor_map_
->
erase
(
ca_it
);
return
true
;
}
}
return
false
;
}
/////////////////////////////////////////////////////////////////////////////////////////////
bool
cv
::
viz
::
Viz3d
::
VizImpl
::
removeText3D
(
const
std
::
string
&
id
)
{
// Check to see if the given ID entry exists
ShapeActorMap
::
iterator
am_it
=
shape_actor_map_
->
find
(
id
);
if
(
am_it
==
shape_actor_map_
->
end
())
return
false
;
// Remove it from all renderers
if
(
removeActorFromRenderer
(
am_it
->
second
))
return
shape_actor_map_
->
erase
(
am_it
),
true
;
return
false
;
}
/////////////////////////////////////////////////////////////////////////////////////////////
bool
cv
::
viz
::
Viz3d
::
VizImpl
::
removeAllPointClouds
()
{
// Check to see if the given ID entry exists
CloudActorMap
::
iterator
am_it
=
cloud_actor_map_
->
begin
();
while
(
am_it
!=
cloud_actor_map_
->
end
()
)
{
if
(
removePointCloud
(
am_it
->
first
))
am_it
=
cloud_actor_map_
->
begin
();
else
++
am_it
;
}
return
(
true
);
}
/////////////////////////////////////////////////////////////////////////////////////////////
bool
cv
::
viz
::
Viz3d
::
VizImpl
::
removeAllShapes
()
//////////////////////////////////////////////////////////////////////////////////////////
void
cv
::
viz
::
Viz3d
::
VizImpl
::
removeAllWidgets
()
{
// Check to see if the given ID entry exists
ShapeActorMap
::
iterator
am_it
=
shape_actor_map_
->
begin
();
while
(
am_it
!=
shape_actor_map_
->
end
())
{
if
(
removeShape
(
am_it
->
first
))
am_it
=
shape_actor_map_
->
begin
();
else
++
am_it
;
}
return
(
true
);
widget_actor_map_
->
clear
();
renderer_
->
RemoveAllViewProps
();
}
//////////////////////////////////////////////////////////////////////////////////////////
bool
cv
::
viz
::
Viz3d
::
VizImpl
::
removeActorFromRenderer
(
const
vtkSmartPointer
<
vtkLODActor
>
&
actor
)
{
...
...
modules/viz/src/viz3d_impl.hpp
View file @
0bbaf5d4
...
...
@@ -17,23 +17,7 @@ public:
VizImpl
(
const
String
&
name
);
virtual
~
VizImpl
();
//to refactor
bool
removePointCloud
(
const
String
&
id
=
"cloud"
);
inline
bool
removePolygonMesh
(
const
String
&
id
=
"polygon"
)
{
return
removePointCloud
(
id
);
}
bool
removeShape
(
const
String
&
id
=
"cloud"
);
bool
removeText3D
(
const
String
&
id
=
"cloud"
);
bool
removeAllPointClouds
();
//create Viz3d::removeAllWidgets()
bool
removeAllShapes
();
void
removeAllWidgets
();
//to refactor
bool
addPolygonMesh
(
const
Mesh3d
&
mesh
,
const
cv
::
Mat
&
mask
,
const
String
&
id
=
"polygon"
);
...
...
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