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
c5643cb3
Commit
c5643cb3
authored
Oct 07, 2010
by
Alexander Wiebel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CLEAN
#161
] removed some code by using the new WGEFunctorCallback
parent
7a1314ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
41 deletions
+4
-41
src/modules/marchingCubes/WMMarchingCubes.cpp
src/modules/marchingCubes/WMMarchingCubes.cpp
+3
-3
src/modules/marchingCubes/WMMarchingCubes.h
src/modules/marchingCubes/WMMarchingCubes.h
+1
-38
No files found.
src/modules/marchingCubes/WMMarchingCubes.cpp
View file @
c5643cb3
...
...
@@ -51,6 +51,7 @@
#include "../../dataHandler/WSubject.h"
#include "../../dataHandler/WDataTexture3D.h"
#include "../../graphicsEngine/WGEUtils.h"
#include "../../graphicsEngine/callbacks/WGEFunctorCallback.h"
#include "../../kernel/WKernel.h"
#include "../../graphicsEngine/algorithms/WMarchingCubesAlgorithm.h"
...
...
@@ -489,7 +490,7 @@ void WMMarchingCubes::renderMesh()
m_moduleNodeInserted
=
true
;
}
m_moduleNode
->
addUpdateCallback
(
new
SurfaceNodeCallback
(
this
)
);
m_moduleNode
->
addUpdateCallback
(
new
WGEFunctorCallback
<
osg
::
Node
>
(
boost
::
bind
(
&
WMMarchingCubes
::
updateGraphicsCallback
,
this
)
)
);
}
void
WMMarchingCubes
::
notifyTextureChange
()
...
...
@@ -571,7 +572,7 @@ bool WMMarchingCubes::save() const
return
true
;
}
void
WMMarchingCubes
::
updateGraphics
For
Callback
()
void
WMMarchingCubes
::
updateGraphicsCallback
()
{
boost
::
unique_lock
<
boost
::
shared_mutex
>
lock
;
lock
=
boost
::
unique_lock
<
boost
::
shared_mutex
>
(
m_updateLock
);
...
...
@@ -690,4 +691,3 @@ void WMMarchingCubes::updateGraphicsForCallback()
}
lock
.
unlock
();
}
src/modules/marchingCubes/WMMarchingCubes.h
View file @
c5643cb3
...
...
@@ -93,7 +93,7 @@ public:
/**
* updates textures and shader parameters when called (usually from the callback)
*/
void
updateGraphics
For
Callback
();
void
updateGraphicsCallback
();
protected:
/**
...
...
@@ -200,41 +200,4 @@ private:
static
const
int
m_maxNumberOfTextures
=
8
;
//!< We support only 8 textures because some known hardware does not support more texture coordinates.
};
/**
* Adapter object for realizing callbacks of the node representing the isosurface in the osg
*/
class
SurfaceNodeCallback
:
public
osg
::
NodeCallback
{
public:
/**
* Constructor of the callback adapter.
* \param module A function of this module will be called
*/
explicit
SurfaceNodeCallback
(
WMMarchingCubes
*
module
);
/**
* Function that is called by the osg and that call the function in the module.
* \param node The node we are called.
* \param nv the visitor calling us.
*/
virtual
void
operator
()(
osg
::
Node
*
node
,
osg
::
NodeVisitor
*
nv
);
private:
WMMarchingCubes
*
m_module
;
//!< Pointer to the module to which the function that is called belongs to.
};
inline
SurfaceNodeCallback
::
SurfaceNodeCallback
(
WMMarchingCubes
*
module
)
:
m_module
(
module
)
{
}
inline
void
SurfaceNodeCallback
::
operator
()(
osg
::
Node
*
node
,
osg
::
NodeVisitor
*
nv
)
{
if
(
m_module
)
{
m_module
->
updateGraphicsForCallback
();
}
traverse
(
node
,
nv
);
}
#endif // WMMARCHINGCUBES_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