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
7dc5332a
Commit
7dc5332a
authored
Jul 01, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6745 from alalek:viz_samples
parents
330e4bb4
8184535d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
5 deletions
+31
-5
types.hpp
modules/core/include/opencv2/core/types.hpp
+12
-0
CMakeLists.txt
samples/cpp/CMakeLists.txt
+9
-4
creating_widgets.cpp
samples/cpp/tutorial_code/viz/creating_widgets.cpp
+9
-0
launching_viz.cpp
samples/cpp/tutorial_code/viz/launching_viz.cpp
+1
-1
No files found.
modules/core/include/opencv2/core/types.hpp
View file @
7dc5332a
...
...
@@ -231,7 +231,11 @@ public:
//! conversion to another data type
template
<
typename
_Tp2
>
operator
Point3_
<
_Tp2
>
()
const
;
//! conversion to cv::Vec<>
#if OPENCV_ABI_COMPATIBILITY > 300
template
<
typename
_Tp2
>
operator
Vec
<
_Tp2
,
3
>
()
const
;
#else
operator
Vec
<
_Tp
,
3
>
()
const
;
#endif
//! dot product
_Tp
dot
(
const
Point3_
&
pt
)
const
;
...
...
@@ -1326,11 +1330,19 @@ Point3_<_Tp>::operator Point3_<_Tp2>() const
return
Point3_
<
_Tp2
>
(
saturate_cast
<
_Tp2
>
(
x
),
saturate_cast
<
_Tp2
>
(
y
),
saturate_cast
<
_Tp2
>
(
z
));
}
#if OPENCV_ABI_COMPATIBILITY > 300
template
<
typename
_Tp
>
template
<
typename
_Tp2
>
inline
Point3_
<
_Tp
>::
operator
Vec
<
_Tp2
,
3
>
()
const
{
return
Vec
<
_Tp2
,
3
>
(
x
,
y
,
z
);
}
#else
template
<
typename
_Tp
>
inline
Point3_
<
_Tp
>::
operator
Vec
<
_Tp
,
3
>
()
const
{
return
Vec
<
_Tp
,
3
>
(
x
,
y
,
z
);
}
#endif
template
<
typename
_Tp
>
inline
Point3_
<
_Tp
>&
Point3_
<
_Tp
>::
operator
=
(
const
Point3_
&
pt
)
...
...
samples/cpp/CMakeLists.txt
View file @
7dc5332a
...
...
@@ -31,7 +31,8 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
endif
()
if
(
CMAKE_COMPILER_IS_GNUCXX AND NOT ENABLE_NOISY_WARNINGS
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-Wno-unused-function"
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-Wno-unused-function -Wno-missing-declarations"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-unused-function -Wno-missing-declarations"
)
endif
()
# ---------------------------------------------
...
...
@@ -57,8 +58,10 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
ocv_target_link_libraries
(
${
the_target
}
opencv_cudaarithm opencv_cudafilters
)
endif
()
if
(
HAVE_opencv_ocl
)
ocv_target_link_libraries
(
${
the_target
}
opencv_ocl
)
if
(
"
${
srcs
}
"
MATCHES
"viz/"
AND VTK_USE_FILE
)
include
(
${
VTK_USE_FILE
}
)
ocv_target_link_libraries
(
${
the_target
}
${
VTK_LIBRARIES
}
)
add_definitions
(
-DUSE_VTK
)
endif
()
set_target_properties
(
${
the_target
}
PROPERTIES
...
...
@@ -88,7 +91,9 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
ocv_list_filterout
(
cpp_samples
"/gpu/"
)
endif
()
ocv_list_filterout
(
cpp_samples
"viz"
)
if
(
NOT TARGET opencv_viz
)
ocv_list_filterout
(
cpp_samples
"/viz/"
)
endif
()
if
(
NOT HAVE_IPP_A
)
ocv_list_filterout
(
cpp_samples
"/ippasync/"
)
...
...
samples/cpp/tutorial_code/viz/creating_widgets.cpp
View file @
7dc5332a
...
...
@@ -4,6 +4,14 @@
* @author Ozan Cagri Tonkal
*/
#ifndef USE_VTK
#include <iostream>
int
main
()
{
std
::
cout
<<
"This sample requires direct compilation with VTK. Stop"
<<
std
::
endl
;
return
0
;
}
#else
#include <opencv2/viz.hpp>
#include <opencv2/viz/widget_accessor.hpp>
#include <iostream>
...
...
@@ -111,3 +119,4 @@ int main()
return
0
;
}
#endif
samples/cpp/tutorial_code/viz/launching_viz.cpp
View file @
7dc5332a
...
...
@@ -41,7 +41,7 @@ int main()
cout
<<
"First event loop is over"
<<
endl
;
/// Access window via its name
viz
::
Viz3d
sameWindow
=
viz
::
get
(
"Viz Demo"
);
viz
::
Viz3d
sameWindow
=
viz
::
get
WindowByName
(
"Viz Demo"
);
/// Start event loop
sameWindow
.
spin
();
...
...
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