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
64566e61
Commit
64566e61
authored
Jan 08, 2014
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor
parent
0d702b83
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
33 deletions
+6
-33
interactor_style.cpp
modules/viz/src/interactor_style.cpp
+2
-6
vizimpl.cpp
modules/viz/src/vizimpl.cpp
+4
-27
No files found.
modules/viz/src/interactor_style.cpp
View file @
64566e61
...
@@ -298,12 +298,8 @@ void cv::viz::InteractorStyle::OnKeyDown()
...
@@ -298,12 +298,8 @@ void cv::viz::InteractorStyle::OnKeyDown()
{
{
vtkSmartPointer
<
vtkCamera
>
cam
=
Interactor
->
GetRenderWindow
()
->
GetRenderers
()
->
GetFirstRenderer
()
->
GetActiveCamera
();
vtkSmartPointer
<
vtkCamera
>
cam
=
Interactor
->
GetRenderWindow
()
->
GetRenderers
()
->
GetFirstRenderer
()
->
GetActiveCamera
();
Vec2d
clip
;
Vec2d
clip
(
cam
->
GetClippingRange
());
Vec3d
focal
,
pos
,
view
;
Vec3d
focal
(
cam
->
GetFocalPoint
()),
pos
(
cam
->
GetPosition
()),
view
(
cam
->
GetViewUp
());
cam
->
GetClippingRange
(
clip
.
val
);
cam
->
GetFocalPoint
(
focal
.
val
);
cam
->
GetPosition
(
pos
.
val
);
cam
->
GetViewUp
(
view
.
val
);
Vec2i
win_pos
(
Interactor
->
GetRenderWindow
()
->
GetPosition
());
Vec2i
win_pos
(
Interactor
->
GetRenderWindow
()
->
GetPosition
());
Vec2i
win_size
(
Interactor
->
GetRenderWindow
()
->
GetSize
());
Vec2i
win_size
(
Interactor
->
GetRenderWindow
()
->
GetSize
());
double
angle
=
cam
->
GetViewAngle
()
/
180.0
*
CV_PI
;
double
angle
=
cam
->
GetViewAngle
()
/
180.0
*
CV_PI
;
...
...
modules/viz/src/vizimpl.cpp
View file @
64566e61
...
@@ -45,18 +45,9 @@
...
@@ -45,18 +45,9 @@
#include "precomp.hpp"
#include "precomp.hpp"
#if (1 || !defined __APPLE__) && !defined _MSC_VER
vtkRenderWindowInteractor
*
vtkRenderWindowInteractorFixNew
();
vtkRenderWindowInteractor
*
vtkRenderWindowInteractorFixNew
()
{
return
vtkRenderWindowInteractor
::
New
();
}
#endif
/////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////
cv
::
viz
::
Viz3d
::
VizImpl
::
VizImpl
(
const
String
&
name
)
cv
::
viz
::
Viz3d
::
VizImpl
::
VizImpl
(
const
String
&
name
)
:
s_lastDone_
(
0.0
),
style_
(
vtkSmartPointer
<
cv
::
viz
::
InteractorStyle
>::
New
()),
widget_actor_map_
(
new
WidgetActorMap
)
:
s_lastDone_
(
0.0
),
style_
(
vtkSmartPointer
<
InteractorStyle
>::
New
()),
widget_actor_map_
(
new
WidgetActorMap
)
{
{
renderer_
=
vtkSmartPointer
<
vtkRenderer
>::
New
();
renderer_
=
vtkSmartPointer
<
vtkRenderer
>::
New
();
window_
=
vtkSmartPointer
<
vtkRenderWindow
>::
New
();
window_
=
vtkSmartPointer
<
vtkRenderWindow
>::
New
();
...
@@ -72,12 +63,7 @@ cv::viz::Viz3d::VizImpl::VizImpl(const String &name)
...
@@ -72,12 +63,7 @@ cv::viz::Viz3d::VizImpl::VizImpl(const String &name)
style_
->
setWidgetActorMap
(
widget_actor_map_
);
style_
->
setWidgetActorMap
(
widget_actor_map_
);
style_
->
UseTimersOn
();
style_
->
UseTimersOn
();
/////////////////////////////////////////////////
#if (1 || !defined __APPLE__) && !defined _MSC_VER
interactor_
=
vtkSmartPointer
<
vtkRenderWindowInteractor
>::
Take
(
vtkRenderWindowInteractorFixNew
());
#else
interactor_
=
vtkSmartPointer
<
vtkRenderWindowInteractor
>::
New
();
interactor_
=
vtkSmartPointer
<
vtkRenderWindowInteractor
>::
New
();
#endif
window_
->
AlphaBitPlanesOff
();
window_
->
AlphaBitPlanesOff
();
window_
->
PointSmoothingOff
();
window_
->
PointSmoothingOff
();
...
@@ -88,7 +74,7 @@ cv::viz::Viz3d::VizImpl::VizImpl(const String &name)
...
@@ -88,7 +74,7 @@ cv::viz::Viz3d::VizImpl::VizImpl(const String &name)
interactor_
->
SetRenderWindow
(
window_
);
interactor_
->
SetRenderWindow
(
window_
);
interactor_
->
SetInteractorStyle
(
style_
);
interactor_
->
SetInteractorStyle
(
style_
);
interactor_
->
SetDesiredUpdateRate
(
30
.0
);
interactor_
->
SetDesiredUpdateRate
(
24
.0
);
// Initialize and create timer, also create window
// Initialize and create timer, also create window
interactor_
->
Initialize
();
interactor_
->
Initialize
();
...
@@ -401,10 +387,7 @@ void cv::viz::Viz3d::VizImpl::converTo3DRay(const Point3d &window_coord, Point3d
...
@@ -401,10 +387,7 @@ void cv::viz::Viz3d::VizImpl::converTo3DRay(const Point3d &window_coord, Point3d
{
{
Vec4d
world_pt
;
Vec4d
world_pt
;
vtkInteractorObserver
::
ComputeDisplayToWorld
(
renderer_
,
window_coord
.
x
,
window_coord
.
y
,
window_coord
.
z
,
world_pt
.
val
);
vtkInteractorObserver
::
ComputeDisplayToWorld
(
renderer_
,
window_coord
.
x
,
window_coord
.
y
,
window_coord
.
z
,
world_pt
.
val
);
Vec3d
cam_pos
(
renderer_
->
GetActiveCamera
()
->
GetPosition
());
vtkCamera
&
active_camera
=
*
renderer_
->
GetActiveCamera
();
Vec3d
cam_pos
;
active_camera
.
GetPosition
(
cam_pos
.
val
);
origin
=
cam_pos
;
origin
=
cam_pos
;
direction
=
normalize
(
Vec3d
(
world_pt
.
val
)
-
cam_pos
);
direction
=
normalize
(
Vec3d
(
world_pt
.
val
)
-
cam_pos
);
}
}
...
@@ -479,7 +462,6 @@ void cv::viz::Viz3d::VizImpl::setRepresentation(int representation)
...
@@ -479,7 +462,6 @@ void cv::viz::Viz3d::VizImpl::setRepresentation(int representation)
}
}
}
}
//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
void
cv
::
viz
::
Viz3d
::
VizImpl
::
setFullScreen
(
bool
mode
)
void
cv
::
viz
::
Viz3d
::
VizImpl
::
setFullScreen
(
bool
mode
)
{
{
...
@@ -488,12 +470,7 @@ void cv::viz::Viz3d::VizImpl::setFullScreen(bool mode)
...
@@ -488,12 +470,7 @@ void cv::viz::Viz3d::VizImpl::setFullScreen(bool mode)
}
}
//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
cv
::
String
cv
::
viz
::
Viz3d
::
VizImpl
::
getWindowName
()
const
cv
::
String
cv
::
viz
::
Viz3d
::
VizImpl
::
getWindowName
()
const
{
return
window_
?
window_
->
GetWindowName
()
:
""
;
}
{
return
(
window_
?
window_
->
GetWindowName
()
:
""
);
}
//////////////////////////////////////////////////////////////////////////////////////////////
void
cv
::
viz
::
Viz3d
::
VizImpl
::
setWindowPosition
(
const
Point
&
position
)
{
window_
->
SetPosition
(
position
.
x
,
position
.
y
);
}
void
cv
::
viz
::
Viz3d
::
VizImpl
::
setWindowPosition
(
const
Point
&
position
)
{
window_
->
SetPosition
(
position
.
x
,
position
.
y
);
}
void
cv
::
viz
::
Viz3d
::
VizImpl
::
setWindowSize
(
const
Size
&
window_size
)
{
window_
->
SetSize
(
window_size
.
width
,
window_size
.
height
);
}
void
cv
::
viz
::
Viz3d
::
VizImpl
::
setWindowSize
(
const
Size
&
window_size
)
{
window_
->
SetSize
(
window_size
.
width
,
window_size
.
height
);
}
cv
::
Size
cv
::
viz
::
Viz3d
::
VizImpl
::
getWindowSize
()
const
{
return
Size
(
window_
->
GetSize
()[
0
],
window_
->
GetSize
()[
1
]);
}
cv
::
Size
cv
::
viz
::
Viz3d
::
VizImpl
::
getWindowSize
()
const
{
return
Size
(
window_
->
GetSize
()[
0
],
window_
->
GetSize
()[
1
]);
}
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