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
b2cd526e
Commit
b2cd526e
authored
Dec 13, 2013
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed extra code
parent
84d6fe39
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
25 deletions
+9
-25
interactor_style.cpp
modules/viz/src/interactor_style.cpp
+9
-19
interactor_style.hpp
modules/viz/src/interactor_style.hpp
+0
-6
No files found.
modules/viz/src/interactor_style.cpp
View file @
b2cd526e
...
...
@@ -63,11 +63,6 @@ void cv::viz::InteractorStyle::Initialize()
win_pos_
=
Vec2i
(
0
,
0
);
max_win_size_
=
Vec2i
(
-
1
,
-
1
);
// Create the image filter and PNG writer objects
wif_
=
vtkSmartPointer
<
vtkWindowToImageFilter
>::
New
();
snapshot_writer_
=
vtkSmartPointer
<
vtkPNGWriter
>::
New
();
snapshot_writer_
->
SetInputConnection
(
wif_
->
GetOutputPort
());
init_
=
true
;
stereo_anaglyph_mask_default_
=
true
;
...
...
@@ -84,11 +79,14 @@ void cv::viz::InteractorStyle::Initialize()
void
cv
::
viz
::
InteractorStyle
::
saveScreenshot
(
const
String
&
file
)
{
FindPokedRenderer
(
Interactor
->
GetEventPosition
()[
0
],
Interactor
->
GetEventPosition
()[
1
]);
wif_
->
SetInput
(
Interactor
->
GetRenderWindow
());
wif_
->
Modified
();
// Update the WindowToImageFilter
snapshot_writer_
->
Modified
();
snapshot_writer_
->
SetFileName
(
file
.
c_str
());
snapshot_writer_
->
Write
();
vtkSmartPointer
<
vtkWindowToImageFilter
>
wif
=
vtkSmartPointer
<
vtkWindowToImageFilter
>::
New
();
wif
->
SetInput
(
Interactor
->
GetRenderWindow
());
vtkSmartPointer
<
vtkPNGWriter
>
snapshot_writer
=
vtkSmartPointer
<
vtkPNGWriter
>::
New
();
snapshot_writer
->
SetInputConnection
(
wif
->
GetOutputPort
());
snapshot_writer
->
SetFileName
(
file
.
c_str
());
snapshot_writer
->
Write
();
}
//////////////////////////////////////////////////////////////////////////////////////////////
...
...
@@ -196,21 +194,13 @@ int cv::viz::InteractorStyle::getModifiers()
}
//////////////////////////////////////////////////////////////////////////////////////////////
void
cv
::
viz
::
InteractorStyle
::
OnKeyDown
()
void
cv
::
viz
::
InteractorStyle
::
OnKeyDown
()
{
CV_Assert
(
"Interactor style not initialized. Please call Initialize() before continuing"
&&
init_
);
CV_Assert
(
"No renderer given! Use SetRendererCollection() before continuing."
&&
renderer_
);
FindPokedRenderer
(
Interactor
->
GetEventPosition
()[
0
],
Interactor
->
GetEventPosition
()[
1
]);
if
(
wif_
->
GetInput
()
==
NULL
)
{
wif_
->
SetInput
(
Interactor
->
GetRenderWindow
());
wif_
->
Modified
();
snapshot_writer_
->
Modified
();
}
// Save the initial windows width/height
if
(
win_size_
[
0
]
==
-
1
||
win_size_
[
1
]
==
-
1
)
win_size_
=
Vec2i
(
Interactor
->
GetRenderWindow
()
->
GetSize
());
...
...
modules/viz/src/interactor_style.hpp
View file @
b2cd526e
...
...
@@ -79,12 +79,6 @@ namespace cv
Vec2i
win_pos_
;
Vec2i
max_win_size_
;
/** \brief A PNG writer for screenshot captures. */
vtkSmartPointer
<
vtkPNGWriter
>
snapshot_writer_
;
/** \brief Internal window to image filter. Needed by \a snapshot_writer_. */
vtkSmartPointer
<
vtkWindowToImageFilter
>
wif_
;
/** \brief Interactor style internal method. Gets called whenever a key is pressed. */
virtual
void
OnChar
();
...
...
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