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
286f81f3
Commit
286f81f3
authored
Sep 07, 2013
by
Ozan Tonkal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix crucial bug in get method, hide add and remove methods from user
parent
2969ec02
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
viz.hpp
modules/viz/include/opencv2/viz.hpp
+5
-2
viz.cpp
modules/viz/src/viz.cpp
+2
-2
No files found.
modules/viz/include/opencv2/viz.hpp
View file @
286f81f3
...
@@ -101,8 +101,6 @@ namespace cv
...
@@ -101,8 +101,6 @@ namespace cv
static
void
release
();
static
void
release
();
Viz3d
get
(
const
String
&
window_name
);
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
//! window names automatically have Viz - prefix even though not provided by the users
static
void
generateWindowName
(
const
String
&
window_name
,
String
&
output
);
static
void
generateWindowName
(
const
String
&
window_name
,
String
&
output
);
...
@@ -111,9 +109,14 @@ namespace cv
...
@@ -111,9 +109,14 @@ namespace cv
VizAccessor
();
// Singleton
VizAccessor
();
// Singleton
~
VizAccessor
();
~
VizAccessor
();
void
add
(
Viz3d
window
);
void
remove
(
const
String
&
window_name
);
static
VizAccessor
*
instance_
;
static
VizAccessor
*
instance_
;
static
bool
is_instantiated_
;
static
bool
is_instantiated_
;
static
VizMap
viz_map_
;
static
VizMap
viz_map_
;
friend
class
Viz3d
;
};
};
}
/* namespace viz */
}
/* namespace viz */
}
/* namespace cv */
}
/* namespace cv */
...
...
modules/viz/src/viz.cpp
View file @
286f81f3
...
@@ -126,7 +126,7 @@ cv::viz::Viz3d cv::viz::VizAccessor::get(const String & window_name)
...
@@ -126,7 +126,7 @@ cv::viz::Viz3d cv::viz::VizAccessor::get(const String & window_name)
VizMap
::
iterator
vm_itr
=
viz_map_
.
find
(
name
);
VizMap
::
iterator
vm_itr
=
viz_map_
.
find
(
name
);
bool
exists
=
vm_itr
!=
viz_map_
.
end
();
bool
exists
=
vm_itr
!=
viz_map_
.
end
();
if
(
exists
)
return
vm_itr
->
second
;
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
)
void
cv
::
viz
::
VizAccessor
::
add
(
Viz3d
window
)
...
@@ -135,7 +135,7 @@ 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
);
VizMap
::
iterator
vm_itr
=
viz_map_
.
find
(
window_name
);
bool
exists
=
vm_itr
!=
viz_map_
.
end
();
bool
exists
=
vm_itr
!=
viz_map_
.
end
();
if
(
exists
)
return
;
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
)
void
cv
::
viz
::
VizAccessor
::
remove
(
const
String
&
window_name
)
...
...
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