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
f6e1a093
Commit
f6e1a093
authored
Aug 24, 2013
by
ozantonkal
Committed by
Ozan Tonkal
Sep 05, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement window relevant methods in Viz3d
parent
4f416352
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
65 deletions
+18
-65
viz3d.hpp
modules/viz/include/opencv2/viz/viz3d.hpp
+5
-3
viz3d.cpp
modules/viz/src/viz3d.cpp
+5
-2
viz3d_impl.cpp
modules/viz/src/viz3d_impl.cpp
+0
-30
viz3d_impl.hpp
modules/viz/src/viz3d_impl.hpp
+8
-30
No files found.
modules/viz/include/opencv2/viz/viz3d.hpp
View file @
f6e1a093
...
...
@@ -24,8 +24,6 @@ namespace cv
Viz3d
&
operator
=
(
const
Viz3d
&
);
~
Viz3d
();
void
setBackgroundColor
(
const
Color
&
color
=
Color
::
black
());
void
showWidget
(
const
String
&
id
,
const
Widget
&
widget
,
const
Affine3f
&
pose
=
Affine3f
::
Identity
());
void
removeWidget
(
const
String
&
id
);
Widget
getWidget
(
const
String
&
id
)
const
;
...
...
@@ -45,8 +43,12 @@ namespace cv
Size
getWindowSize
()
const
;
void
setWindowSize
(
const
Size
&
window_size
);
String
getWindowName
()
const
;
void
saveScreenshot
(
const
String
&
file
);
void
setWindowPosition
(
int
x
,
int
y
);
void
setFullScreen
(
bool
mode
);
void
setWindowName
(
const
String
&
name
);
void
setBackgroundColor
(
const
Color
&
color
=
Color
::
black
());
void
spin
();
void
spinOnce
(
int
time
=
1
,
bool
force_redraw
=
false
);
...
...
modules/viz/src/viz3d.cpp
View file @
f6e1a093
...
...
@@ -42,8 +42,6 @@ void cv::viz::Viz3d::release()
}
}
void
cv
::
viz
::
Viz3d
::
setBackgroundColor
(
const
Color
&
color
)
{
impl_
->
setBackgroundColor
(
color
);
}
void
cv
::
viz
::
Viz3d
::
spin
()
{
impl_
->
spin
();
}
void
cv
::
viz
::
Viz3d
::
spinOnce
(
int
time
,
bool
force_redraw
)
{
impl_
->
spinOnce
(
time
,
force_redraw
);
}
bool
cv
::
viz
::
Viz3d
::
wasStopped
()
const
{
return
impl_
->
wasStopped
();
}
...
...
@@ -73,6 +71,11 @@ void cv::viz::Viz3d::converTo3DRay(const Point3d &window_coord, Point3d &origin,
cv
::
Size
cv
::
viz
::
Viz3d
::
getWindowSize
()
const
{
return
impl_
->
getWindowSize
();
}
void
cv
::
viz
::
Viz3d
::
setWindowSize
(
const
Size
&
window_size
)
{
impl_
->
setWindowSize
(
window_size
.
width
,
window_size
.
height
);
}
cv
::
String
cv
::
viz
::
Viz3d
::
getWindowName
()
const
{
return
impl_
->
getWindowName
();
}
void
cv
::
viz
::
Viz3d
::
saveScreenshot
(
const
String
&
file
)
{
impl_
->
saveScreenshot
(
file
);
}
void
cv
::
viz
::
Viz3d
::
setWindowPosition
(
int
x
,
int
y
)
{
impl_
->
setWindowPosition
(
x
,
y
);
}
void
cv
::
viz
::
Viz3d
::
setFullScreen
(
bool
mode
)
{
impl_
->
setFullScreen
(
mode
);
}
void
cv
::
viz
::
Viz3d
::
setWindowName
(
const
String
&
name
)
{
impl_
->
setWindowName
(
name
);
}
void
cv
::
viz
::
Viz3d
::
setBackgroundColor
(
const
Color
&
color
)
{
impl_
->
setBackgroundColor
(
color
);
}
void
cv
::
viz
::
Viz3d
::
setRenderingProperty
(
int
property
,
double
value
,
const
String
&
id
)
{
getWidget
(
id
).
setRenderingProperty
(
property
,
value
);
}
double
cv
::
viz
::
Viz3d
::
getRenderingProperty
(
int
property
,
const
String
&
id
)
{
return
getWidget
(
id
).
getRenderingProperty
(
property
);
}
...
...
modules/viz/src/viz3d_impl.cpp
View file @
f6e1a093
...
...
@@ -249,30 +249,6 @@ void cv::viz::Viz3d::VizImpl::setBackgroundColor (const Color& color)
renderer_
->
SetBackground
(
c
.
val
);
}
/////////////////////////////////////////////////////////////////////////////////////////////
void
cv
::
viz
::
Viz3d
::
VizImpl
::
initCameraParameters
()
{
Vec2i
window_size
(
window_
->
GetScreenSize
());
window_size
/=
2
;
Camera
camera_temp
(
Vec2f
(
0.0
,
0.8575
),
Size
(
window_size
[
0
],
window_size
[
1
]));
setCamera
(
camera_temp
);
setViewerPose
(
makeCameraPose
(
Vec3f
(
0.0
f
,
0.0
f
,
0.0
f
),
Vec3f
(
0.0
f
,
0.0
f
,
1.0
f
),
Vec3f
(
0.0
f
,
1.0
f
,
0.0
f
)));
}
/////////////////////////////////////////////////////////////////////////////////////////////
bool
cv
::
viz
::
Viz3d
::
VizImpl
::
cameraParamsSet
()
const
{
return
(
camera_set_
);
}
/////////////////////////////////////////////////////////////////////////////////////////////
void
cv
::
viz
::
Viz3d
::
VizImpl
::
updateCamera
()
{
std
::
cout
<<
"[cv::viz::PCLVisualizer::updateCamera()] This method was deprecated, just re-rendering all scenes now."
<<
std
::
endl
;
//rens_->InitTraversal ();
// Update the camera parameters
renderer_
->
Render
();
}
/////////////////////////////////////////////////////////////////////////////////////////////
void
cv
::
viz
::
Viz3d
::
VizImpl
::
setCamera
(
const
Camera
&
camera
)
{
...
...
@@ -379,12 +355,6 @@ void cv::viz::Viz3d::VizImpl::converTo3DRay(const Point3d &window_coord, Point3d
direction
=
normalize
(
Vec3d
(
world_pt
.
val
)
-
cam_pos
);
}
/////////////////////////////////////////////////////////////////////////////////////////////
void
cv
::
viz
::
Viz3d
::
VizImpl
::
resetCamera
()
{
renderer_
->
ResetCamera
();
}
/////////////////////////////////////////////////////////////////////////////////////////////
void
cv
::
viz
::
Viz3d
::
VizImpl
::
resetCameraViewpoint
(
const
std
::
string
&
id
)
{
...
...
modules/viz/src/viz3d_impl.hpp
View file @
f6e1a093
...
...
@@ -16,8 +16,15 @@ public:
VizImpl
(
const
String
&
name
);
virtual
~
VizImpl
();
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
);
Affine3f
getWidgetPose
(
const
String
&
id
)
const
;
void
setRenderingProperty
(
int
property
,
double
value
,
const
String
&
id
);
double
getRenderingProperty
(
int
property
,
const
String
&
id
);
...
...
@@ -51,29 +58,16 @@ public:
void
setCamera
(
const
Camera
&
camera
);
Camera
getCamera
()
const
;
void
initCameraParameters
();
/** \brief Initialize camera parameters with some default values. */
bool
cameraParamsSet
()
const
;
/** \brief Checks whether the camera parameters were manually loaded from file.*/
void
updateCamera
();
/** \brief Update camera parameters and render. */
void
resetCamera
();
/** \brief Reset camera parameters and render. */
/** \brief Reset the camera direction from {0, 0, 0} to the center_{x, y, z} of a given dataset.
* \param[in] id the point cloud object id (default: cloud) */
void
resetCameraViewpoint
(
const
String
&
id
=
"cloud"
);
//to implement Viz3d set/getViewerPose()
void
setViewerPose
(
const
Affine3f
&
pose
);
Affine3f
getViewerPose
();
void
convertToWindowCoordinates
(
const
Point3d
&
pt
,
Point3d
&
window_coord
);
void
converTo3DRay
(
const
Point3d
&
window_coord
,
Point3d
&
origin
,
Vec3d
&
direction
);
//to implemnt in Viz3d
void
saveScreenshot
(
const
String
&
file
);
void
setWindowPosition
(
int
x
,
int
y
);
Size
getWindowSize
()
const
;
...
...
@@ -89,22 +83,6 @@ public:
void
registerKeyboardCallback
(
KeyboardCallback
callback
,
void
*
cookie
=
0
);
void
registerMouseCallback
(
MouseCallback
callback
,
void
*
cookie
=
0
);
//declare above (to move to up)
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
setWidgetPose
(
const
String
&
id
,
const
Affine3f
&
pose
);
void
updateWidgetPose
(
const
String
&
id
,
const
Affine3f
&
pose
);
Affine3f
getWidgetPose
(
const
String
&
id
)
const
;
private
:
vtkSmartPointer
<
vtkRenderWindowInteractor
>
interactor_
;
...
...
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