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
b24f41d4
Commit
b24f41d4
authored
Oct 08, 2010
by
Alexander Wiebel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CLEAN] changed to use new FunctorCallback. this makes inner class
superfluous
parent
229862c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
41 deletions
+13
-41
src/modules/vectorPlot/WMVectorPlot.cpp
src/modules/vectorPlot/WMVectorPlot.cpp
+8
-10
src/modules/vectorPlot/WMVectorPlot.h
src/modules/vectorPlot/WMVectorPlot.h
+5
-31
No files found.
src/modules/vectorPlot/WMVectorPlot.cpp
View file @
b24f41d4
...
...
@@ -160,7 +160,7 @@ void WMVectorPlot::moduleMain()
m_rootNode
=
newRootNode
;
m_rootNode
->
setNodeMask
(
m_active
->
get
()
?
0xFFFFFFFF
:
0x0
);
m_rootNode
->
addUpdateCallback
(
new
SafeUpdateCallback
(
this
)
);
m_rootNode
->
addUpdateCallback
(
new
WGEFunctorCallback
<
osg
::
Node
>
(
boost
::
bind
(
&
WMVectorPlot
::
updateCallback
,
this
)
)
);
m_shader
=
osg
::
ref_ptr
<
WShader
>
(
new
WShader
(
"WMVectorPlot"
,
m_localPath
)
);
m_shader
->
apply
(
m_rootNode
);
...
...
@@ -398,20 +398,18 @@ osg::ref_ptr<osg::Geometry> WMVectorPlot::buildPlotSlices()
}
void
WMVectorPlot
::
SafeUpdateCallback
::
operator
()(
osg
::
Node
*
node
,
osg
::
NodeVisitor
*
nv
)
void
WMVectorPlot
::
updateCallback
(
)
{
wmath
::
WPosition
current
=
WKernel
::
getRunningKernel
()
->
getSelectionManager
()
->
getCrosshair
()
->
getPosition
();
wmath
::
WPosition
old
(
m_
module
->
m_xSlice
->
get
(),
m_module
->
m_ySlice
->
get
(),
m_module
->
m_zSlice
->
get
()
);
wmath
::
WPosition
old
(
m_
xSlice
->
get
(),
m_ySlice
->
get
(),
m_zSlice
->
get
()
);
if
(
(
old
!=
current
)
||
m_
module
->
m_coloringMode
->
changed
()
||
m_module
->
m_aColor
->
changed
()
||
m_module
->
m_projectOnSlice
->
changed
()
||
m_
module
->
m_showonX
->
changed
()
||
m_module
->
m_showonY
->
changed
()
||
m_module
->
m_showonZ
->
changed
()
)
if
(
(
old
!=
current
)
||
m_
coloringMode
->
changed
()
||
m_aColor
->
changed
()
||
m_projectOnSlice
->
changed
()
||
m_
showonX
->
changed
()
||
m_showonY
->
changed
()
||
m_showonZ
->
changed
()
)
{
osg
::
ref_ptr
<
osg
::
Drawable
>
old
=
osg
::
ref_ptr
<
osg
::
Drawable
>
(
m_
module
->
m_
rootNode
->
getDrawable
(
0
)
);
m_
module
->
m_
rootNode
->
removeDrawable
(
old
);
m_
module
->
m_rootNode
->
addDrawable
(
m_module
->
buildPlotSlices
()
);
osg
::
ref_ptr
<
osg
::
Drawable
>
old
=
osg
::
ref_ptr
<
osg
::
Drawable
>
(
m_rootNode
->
getDrawable
(
0
)
);
m_rootNode
->
removeDrawable
(
old
);
m_
rootNode
->
addDrawable
(
buildPlotSlices
()
);
}
traverse
(
node
,
nv
);
}
...
...
src/modules/vectorPlot/WMVectorPlot.h
View file @
b24f41d4
...
...
@@ -115,6 +115,11 @@ private:
*/
osg
::
ref_ptr
<
osg
::
Geometry
>
buildPlotSlices
();
/**
* The update callback that is called for the osg node of this module.
*/
void
updateCallback
();
/**
* Transforms the given vertices according to m_matrix
* \param verts These vertices will be transformed.
...
...
@@ -159,37 +164,6 @@ private:
osg
::
ref_ptr
<
WShader
>
m_shader
;
//!< the shader object for this module
wmath
::
WMatrix
<
double
>
m_mat
;
//!< The 4x4 transformation matrix for the glyph vertices.
/**
* Node callback to change the color of the shapes inside the root node. For more details on this class, refer to the documentation in
* moduleMain().
*/
class
SafeUpdateCallback
:
public
osg
::
NodeCallback
{
public:
// NOLINT
/**
* Constructor.
*
* \param module just set the creating module as pointer for later reference.
*/
explicit
SafeUpdateCallback
(
WMVectorPlot
*
module
)
:
m_module
(
module
)
{
};
/**
* operator () - called during the update traversal.
*
* \param node the osg node
* \param nv the node visitor
*/
virtual
void
operator
()(
osg
::
Node
*
node
,
osg
::
NodeVisitor
*
nv
);
/**
* Pointer used to access members of the module to modify the node.
*/
WMVectorPlot
*
m_module
;
};
};
#endif // WMVECTORPLOT_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