Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenWalnut Core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
44
Issues
44
List
Boards
Labels
Service Desk
Milestones
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
31c48716
Commit
31c48716
authored
Jul 20, 2017
by
Alexander Wiebel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[REFAC] made members private and changed type of m_paintMode
parent
2577c723
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
18 deletions
+39
-18
src/core/graphicsEngine/WPickHandler.cpp
src/core/graphicsEngine/WPickHandler.cpp
+19
-5
src/core/graphicsEngine/WPickHandler.h
src/core/graphicsEngine/WPickHandler.h
+19
-12
src/core/kernel/WSelectionManager.cpp
src/core/kernel/WSelectionManager.cpp
+1
-1
No files found.
src/core/graphicsEngine/WPickHandler.cpp
View file @
31c48716
...
...
@@ -27,6 +27,7 @@
#include "../common/WLogger.h"
#include "WPickHandler.h"
#include "../common/WAssert.h"
const
std
::
string
WPickHandler
::
unpickString
=
"unpick"
;
...
...
@@ -36,7 +37,7 @@ WPickHandler::WPickHandler()
m_shift
(
false
),
m_ctrl
(
false
),
m_viewerName
(
""
),
m_paintMode
(
0
),
m_paintMode
(
false
),
m_mouseButton
(
WPickInfo
::
NOMOUSE
),
m_inPickMode
(
false
),
m_scrollWheel
(
0
)
...
...
@@ -49,7 +50,7 @@ WPickHandler::WPickHandler( std::string viewerName )
m_shift
(
false
),
m_ctrl
(
false
),
m_viewerName
(
viewerName
),
m_paintMode
(
0
),
m_paintMode
(
false
),
m_mouseButton
(
WPickInfo
::
NOMOUSE
),
m_inPickMode
(
false
),
m_scrollWheel
(
0
)
...
...
@@ -87,7 +88,7 @@ bool WPickHandler::handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAda
pick
(
view
,
ea
);
}
}
if
(
(
buttonMask
==
osgGA
::
GUIEventAdapter
::
LEFT_MOUSE_BUTTON
)
&&
(
m_paintMode
==
1
)
)
if
(
(
buttonMask
==
osgGA
::
GUIEventAdapter
::
LEFT_MOUSE_BUTTON
)
&&
(
m_paintMode
)
)
{
m_mouseButton
=
WPickInfo
::
MOUSE_LEFT
;
osgViewer
::
View
*
view
=
static_cast
<
osgViewer
::
View
*
>
(
&
aa
);
...
...
@@ -260,7 +261,7 @@ void WPickHandler::pick( osgViewer::View* view, const osgGA::GUIEventAdapter& ea
{
std
::
string
nodeName
=
extractSuitableName
(
hitr
);
// now we skip everything that starts with an underscore if not in paint mode
if
(
nodeName
[
0
]
==
'_'
&&
(
m_paintMode
==
0
)
)
if
(
nodeName
[
0
]
==
'_'
&&
(
!
m_paintMode
)
)
{
++
hitr
;
}
...
...
@@ -355,7 +356,20 @@ void WPickHandler::pick( osgViewer::View* view, const osgGA::GUIEventAdapter& ea
m_pickSignal
(
getHitResult
()
);
}
void
WPickHandler
::
setPaintMode
(
bool
paintMode
)
{
m_paintMode
=
paintMode
;
}
void
WPickHandler
::
setPaintMode
(
int
mode
)
{
m_paintMode
=
mode
;
WAssert
(
mode
==
1
||
mode
==
0
,
"Unexpected value"
);
if
(
mode
==
1
)
{
m_paintMode
=
true
;
}
else
{
m_paintMode
=
false
;
}
}
src/core/graphicsEngine/WPickHandler.h
View file @
31c48716
...
...
@@ -90,9 +90,16 @@ public:
/**
* setter for paint mode
* \deprecated use variant taking bool instead.
* \param mode the paint mode
*/
void
setPaintMode
(
int
mode
);
OW_API_DEPRECATED
void
setPaintMode
(
int
mode
);
/**
* Set in paint mode
* \param paintMode Should we switch to paint mode?
*/
void
setPaintMode
(
bool
paintMode
);
static
const
std
::
string
unpickString
;
//!< The string indicating picking has stopped.
...
...
@@ -108,27 +115,27 @@ protected:
*/
virtual
~
WPickHandler
();
private:
/**
* Sets the current modifiers to the provided pickInfo
*
* \param pickInfo This pickInfo will be updated.
*/
void
updatePickInfoModifierKeys
(
WPickInfo
*
pickInfo
);
boost
::
signals2
::
signal
<
void
(
WPickInfo
)
>
m_pickSignal
;
//!< One can register to this signal to receive pick events.
WPickInfo
m_hitResult
;
//!< Textual representation of the result of a pick.
WPickInfo
m_startPick
;
//!< indicates what was first picked. Should be "" after unpick.
bool
m_shift
;
//!< is shift pressed?
bool
m_ctrl
;
//!< is ctrl pressed?
std
::
string
m_viewerName
;
//!< which viewer sends the signal
int
m_paintMode
;
//!< the paint mode
bool
m_paintMode
;
//!< the paint mode
WPickInfo
::
WMouseButton
m_mouseButton
;
//!< stores mouse button that initiated the pick
bool
m_inPickMode
;
//!< if true, the pick handler currently is in pick mode.
int32_t
m_scrollWheel
;
//!< the virtual value of the scrollwheel
private:
/**
* Sets the current modifiers to the provided pickInfo
*
* \param pickInfo This pickInfo will be updated.
*/
void
updatePickInfoModifierKeys
(
WPickInfo
*
pickInfo
);
boost
::
signals2
::
signal
<
void
(
WPickInfo
)
>
m_pickSignal
;
//!< One can register to this signal to receive pick events.
};
#endif // WPICKHANDLER_H
src/core/kernel/WSelectionManager.cpp
View file @
31c48716
...
...
@@ -140,7 +140,7 @@ void WSelectionManager::setPaintMode( WPaintMode mode )
osg
::
static_pointer_cast
<
WGEZoomTrackballManipulator
>
(
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getViewer
()
->
getCameraManipulator
()
)
->
setPaintMode
(
mode
);
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getViewer
()
->
getPickHandler
()
->
setPaintMode
(
mode
);
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getViewer
()
->
getPickHandler
()
->
setPaintMode
(
mode
==
PAINTMODE_PAINT
);
}
WPaintMode
WSelectionManager
::
getPaintMode
()
...
...
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