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
4aa61dee
Commit
4aa61dee
authored
Aug 31, 2013
by
ozantonkal
Committed by
Ozan Tonkal
Sep 05, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor refactoring interactor_style
parent
af8a918e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
21 deletions
+6
-21
interactor_style.cpp
modules/viz/src/interactor_style.cpp
+6
-21
No files found.
modules/viz/src/interactor_style.cpp
View file @
4aa61dee
#include "precomp.hpp"
#include "precomp.hpp"
#include "interactor_style.h"
#include "interactor_style.h"
//#include <q/visualization/vtk/vtkVertexBufferObjectMapper.h>
using
namespace
cv
;
using
namespace
cv
;
//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
...
@@ -227,7 +224,7 @@ cv::viz::InteractorStyle::OnKeyDown ()
...
@@ -227,7 +224,7 @@ cv::viz::InteractorStyle::OnKeyDown ()
{
{
for
(
actor
->
InitPathTraversal
();
vtkAssemblyPath
*
path
=
actor
->
GetNextPath
();
)
for
(
actor
->
InitPathTraversal
();
vtkAssemblyPath
*
path
=
actor
->
GetNextPath
();
)
{
{
vtk
SmartPointer
<
vtkActor
>
apart
=
reinterpret_cast
<
vtkActor
*>
(
path
->
GetLastNode
()
->
GetViewProp
());
vtk
Actor
*
apart
=
reinterpret_cast
<
vtkActor
*>
(
path
->
GetLastNode
()
->
GetViewProp
());
apart
->
GetProperty
()
->
SetRepresentationToPoints
();
apart
->
GetProperty
()
->
SetRepresentationToPoints
();
}
}
}
}
...
@@ -250,15 +247,12 @@ cv::viz::InteractorStyle::OnKeyDown ()
...
@@ -250,15 +247,12 @@ cv::viz::InteractorStyle::OnKeyDown ()
cam
->
GetFocalPoint
(
focal
);
cam
->
GetFocalPoint
(
focal
);
cam
->
GetPosition
(
pos
);
cam
->
GetPosition
(
pos
);
cam
->
GetViewUp
(
view
);
cam
->
GetViewUp
(
view
);
#ifndef M_PI
# define M_PI 3.14159265358979323846 // pi
#endif
int
*
win_pos
=
Interactor
->
GetRenderWindow
()
->
GetPosition
();
int
*
win_pos
=
Interactor
->
GetRenderWindow
()
->
GetPosition
();
int
*
win_size
=
Interactor
->
GetRenderWindow
()
->
GetSize
();
int
*
win_size
=
Interactor
->
GetRenderWindow
()
->
GetSize
();
ofs_cam
<<
clip
[
0
]
<<
","
<<
clip
[
1
]
<<
"/"
<<
focal
[
0
]
<<
","
<<
focal
[
1
]
<<
","
<<
focal
[
2
]
<<
"/"
<<
ofs_cam
<<
clip
[
0
]
<<
","
<<
clip
[
1
]
<<
"/"
<<
focal
[
0
]
<<
","
<<
focal
[
1
]
<<
","
<<
focal
[
2
]
<<
"/"
<<
pos
[
0
]
<<
","
<<
pos
[
1
]
<<
","
<<
pos
[
2
]
<<
"/"
<<
view
[
0
]
<<
","
<<
view
[
1
]
<<
","
<<
view
[
2
]
<<
"/"
<<
pos
[
0
]
<<
","
<<
pos
[
1
]
<<
","
<<
pos
[
2
]
<<
"/"
<<
view
[
0
]
<<
","
<<
view
[
1
]
<<
","
<<
view
[
2
]
<<
"/"
<<
cam
->
GetViewAngle
()
/
180.0
*
M
_PI
<<
"/"
<<
win_size
[
0
]
<<
","
<<
win_size
[
1
]
<<
"/"
<<
win_pos
[
0
]
<<
","
<<
win_pos
[
1
]
cam
->
GetViewAngle
()
/
180.0
*
CV
_PI
<<
"/"
<<
win_size
[
0
]
<<
","
<<
win_size
[
1
]
<<
"/"
<<
win_pos
[
0
]
<<
","
<<
win_pos
[
1
]
<<
endl
;
<<
endl
;
ofs_cam
.
close
();
ofs_cam
.
close
();
...
@@ -302,7 +296,7 @@ cv::viz::InteractorStyle::OnKeyDown ()
...
@@ -302,7 +296,7 @@ cv::viz::InteractorStyle::OnKeyDown ()
{
{
for
(
actor
->
InitPathTraversal
();
vtkAssemblyPath
*
path
=
actor
->
GetNextPath
();
)
for
(
actor
->
InitPathTraversal
();
vtkAssemblyPath
*
path
=
actor
->
GetNextPath
();
)
{
{
vtk
SmartPointer
<
vtkActor
>
apart
=
reinterpret_cast
<
vtkActor
*>
(
path
->
GetLastNode
()
->
GetViewProp
());
vtk
Actor
*
apart
=
reinterpret_cast
<
vtkActor
*>
(
path
->
GetLastNode
()
->
GetViewProp
());
float
psize
=
apart
->
GetProperty
()
->
GetPointSize
();
float
psize
=
apart
->
GetProperty
()
->
GetPointSize
();
if
(
psize
<
63.0
f
)
if
(
psize
<
63.0
f
)
apart
->
GetProperty
()
->
SetPointSize
(
psize
+
1.0
f
);
apart
->
GetProperty
()
->
SetPointSize
(
psize
+
1.0
f
);
...
@@ -323,7 +317,7 @@ cv::viz::InteractorStyle::OnKeyDown ()
...
@@ -323,7 +317,7 @@ cv::viz::InteractorStyle::OnKeyDown ()
{
{
for
(
actor
->
InitPathTraversal
();
vtkAssemblyPath
*
path
=
actor
->
GetNextPath
();
)
for
(
actor
->
InitPathTraversal
();
vtkAssemblyPath
*
path
=
actor
->
GetNextPath
();
)
{
{
vtk
SmartPointer
<
vtkActor
>
apart
=
static_cast
<
vtkActor
*>
(
path
->
GetLastNode
()
->
GetViewProp
());
vtk
Actor
*
apart
=
static_cast
<
vtkActor
*>
(
path
->
GetLastNode
()
->
GetViewProp
());
float
psize
=
apart
->
GetProperty
()
->
GetPointSize
();
float
psize
=
apart
->
GetProperty
()
->
GetPointSize
();
if
(
psize
>
1.0
f
)
if
(
psize
>
1.0
f
)
apart
->
GetProperty
()
->
SetPointSize
(
psize
-
1.0
f
);
apart
->
GetProperty
()
->
SetPointSize
(
psize
-
1.0
f
);
...
@@ -651,17 +645,8 @@ void cv::viz::InteractorStyle::OnMouseWheelBackward ()
...
@@ -651,17 +645,8 @@ void cv::viz::InteractorStyle::OnMouseWheelBackward ()
//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
void
cv
::
viz
::
InteractorStyle
::
OnTimer
()
void
cv
::
viz
::
InteractorStyle
::
OnTimer
()
{
{
if
(
!
init_
)
CV_Assert
(
"Interactor style not initialized."
&&
init_
);
{
CV_Assert
(
"Renderer has not been set."
&&
renderer_
);
std
::
cout
<<
"[PCLVisualizerInteractorStyle] Interactor style not initialized. Please call Initialize () before continuing.
\n
"
<<
std
::
endl
;
return
;
}
if
(
!
renderer_
)
{
std
::
cout
<<
"[PCLVisualizerInteractorStyle] No renderer collection given! Use SetRendererCollection () before continuing."
<<
std
::
endl
;
return
;
}
renderer_
->
Render
();
renderer_
->
Render
();
Interactor
->
Render
();
Interactor
->
Render
();
}
}
...
...
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