Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
f606c298
Commit
f606c298
authored
Nov 25, 2010
by
Alexander Wiebel
Browse files
[CHANGE] refactored some code into separate function
parent
75a5a032
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
10 deletions
+22
-10
src/graphicsEngine/WPickHandler.cpp
src/graphicsEngine/WPickHandler.cpp
+14
-9
src/graphicsEngine/WPickHandler.h
src/graphicsEngine/WPickHandler.h
+8
-1
No files found.
src/graphicsEngine/WPickHandler.cpp
View file @
f606c298
...
...
@@ -162,6 +162,19 @@ std::string extractSuitableName( osgUtil::LineSegmentIntersector::Intersections:
return
""
;
// This line will not be reached.
}
void
WPickHandler
::
updatePickInfoModifierKeys
(
WPickInfo
*
pickInfo
)
{
if
(
m_shift
)
{
pickInfo
->
setModifierKey
(
WPickInfo
::
SHIFT
);
}
if
(
m_ctrl
)
{
pickInfo
->
setModifierKey
(
WPickInfo
::
STRG
);
}
}
void
WPickHandler
::
pick
(
osgViewer
::
View
*
view
,
const
osgGA
::
GUIEventAdapter
&
ea
)
{
osgUtil
::
LineSegmentIntersector
::
Intersections
intersections
;
...
...
@@ -171,15 +184,7 @@ void WPickHandler::pick( osgViewer::View* view, const osgGA::GUIEventAdapter& ea
WPickInfo
pickInfo
;
if
(
m_shift
)
{
pickInfo
.
setModifierKey
(
WPickInfo
::
SHIFT
);
}
if
(
m_ctrl
)
{
pickInfo
.
setModifierKey
(
WPickInfo
::
STRG
);
}
updatePickInfoModifierKeys
(
&
pickInfo
);
// if we are in another viewer than the main view we just need the pixel position
if
(
m_viewerName
!=
""
&&
m_viewerName
!=
"main"
)
...
...
src/graphicsEngine/WPickHandler.h
View file @
f606c298
...
...
@@ -128,7 +128,14 @@ protected:
private:
boost
::
signals2
::
signal1
<
void
,
WPickInfo
>
m_pickSignal
;
//!< One can register to this signal to receive pick events.
/**
* Sets the current modifiers to the provided pickInfo
*
* \param pickInfo This pickInfo will be updated.
*/
void
updatePickInfoModifierKeys
(
WPickInfo
*
pickInfo
);
boost
::
signals2
::
signal1
<
void
,
WPickInfo
>
m_pickSignal
;
//!< One can register to this signal to receive pick events.
};
#endif // WPICKHANDLER_H
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