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
29a2ceb5
Commit
29a2ceb5
authored
Jul 01, 2012
by
Alexander Wiebel
Browse files
[CHANGE] finished renaming WMMarchingCubes to WMIsosurface
parent
5ebd81da
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
37 additions
and
37 deletions
+37
-37
src/modules/distanceMapIsosurface/WMDistanceMapIsosurface.cpp
...modules/distanceMapIsosurface/WMDistanceMapIsosurface.cpp
+9
-9
src/modules/distanceMapIsosurface/WMDistanceMapIsosurface.h
src/modules/distanceMapIsosurface/WMDistanceMapIsosurface.h
+2
-2
src/modules/isosurface/WMIsosurface.cpp
src/modules/isosurface/WMIsosurface.cpp
+18
-18
src/modules/isosurface/WMIsosurface.h
src/modules/isosurface/WMIsosurface.h
+7
-7
src/modules/isosurface/WMIsosurface.xpm
src/modules/isosurface/WMIsosurface.xpm
+0
-0
src/modules/isosurface/shaders/WMIsosurface-fragment.glsl
src/modules/isosurface/shaders/WMIsosurface-fragment.glsl
+0
-0
src/modules/isosurface/shaders/WMIsosurface-vertex.glsl
src/modules/isosurface/shaders/WMIsosurface-vertex.glsl
+0
-0
src/modules/modules-base.toolbox
src/modules/modules-base.toolbox
+1
-1
No files found.
src/modules/distanceMapIsosurface/WMDistanceMapIsosurface.cpp
View file @
29a2ceb5
...
...
@@ -71,18 +71,18 @@ const char** WMDistanceMapIsosurface::getXPMIcon() const
void
WMDistanceMapIsosurface
::
moduleMain
()
{
//////////////////////////////////////////////////////////////////////////////////
//
Marching Cubes
//
Isosurface
//////////////////////////////////////////////////////////////////////////////////
// create an instance using the prototypes
m_
marchingCubes
Module
=
WModuleFactory
::
getModuleFactory
()
->
create
(
WModuleFactory
::
getModuleFactory
()
->
getPrototypeByName
(
"Isosurface"
)
);
m_
isosurface
Module
=
WModuleFactory
::
getModuleFactory
()
->
create
(
WModuleFactory
::
getModuleFactory
()
->
getPrototypeByName
(
"Isosurface"
)
);
// add the
marching cubes
to the container
add
(
m_
marchingCubes
Module
);
// add the
isosurface
to the container
add
(
m_
isosurface
Module
);
// now wait for it to be ready
m_
marchingCubes
Module
->
isReady
().
wait
();
boost
::
shared_ptr
<
WProperties
>
mcProps
=
m_
marchingCubes
Module
->
getProperties
();
m_
isosurface
Module
->
isReady
().
wait
();
boost
::
shared_ptr
<
WProperties
>
mcProps
=
m_
isosurface
Module
->
getProperties
();
m_isoValueProp
=
mcProps
->
getProperty
(
"Iso value"
)
->
toPropDouble
();
m_isoValueProp
->
set
(
0.2
);
m_isoValueProp
->
setMin
(
0.0
);
...
...
@@ -120,9 +120,9 @@ void WMDistanceMapIsosurface::moduleMain()
// NOTE: you can use the WModuleContainer::applyModule functions here, which, in this case, is possible, since the connectors
// can be connected unambiguously (one to one connection). But to show how hard wiring works, we do it manually here.
m_
marchingCubes
Module
->
getInputConnector
(
"values"
)
->
connect
(
m_distanceMapModule
->
getOutputConnector
(
"out"
)
);
m_
isosurface
Module
->
getInputConnector
(
"values"
)
->
connect
(
m_distanceMapModule
->
getOutputConnector
(
"out"
)
);
// this is the same as doing it the other way around.
// m_distanceMapModule->getOutputConnector( "out" )->connect( m_
marchingCubes
Module->getInputConnector( "values" ) );
// m_distanceMapModule->getOutputConnector( "out" )->connect( m_
isosurface
Module->getInputConnector( "values" ) );
// simple, isn't it? ;-)
//////////////////////////////////////////////////////////////////////////////////
...
...
@@ -182,6 +182,6 @@ void WMDistanceMapIsosurface::requirements()
void
WMDistanceMapIsosurface
::
activate
()
{
m_
marchingCubes
Module
->
getProperties
()
->
getProperty
(
"active"
)
->
toPropBool
()
->
set
(
m_active
->
get
()
);
m_
isosurface
Module
->
getProperties
()
->
getProperty
(
"active"
)
->
toPropBool
()
->
set
(
m_active
->
get
()
);
}
src/modules/distanceMapIsosurface/WMDistanceMapIsosurface.h
View file @
29a2ceb5
...
...
@@ -34,7 +34,7 @@
#include "core/kernel/WModuleOutputForwardData.h"
/**
* Computes a distance map from an anatomy dataset and renders it as isosurface. It is a composition of
marching cubes
and the
* Computes a distance map from an anatomy dataset and renders it as isosurface. It is a composition of
isosurface
and the
* distance map module.
* \ingroup modules
*/
...
...
@@ -100,7 +100,7 @@ private:
boost
::
shared_ptr
<
WModuleInputForwardData
<
WDataSetScalar
>
>
m_input
;
//!< Input connector required by this module.
boost
::
shared_ptr
<
WModuleOutputForwardData
<
WDataSetScalar
>
>
m_output
;
//!< Connector to provide the distance map to other modules.
boost
::
shared_ptr
<
WModule
>
m_
marchingCubes
Module
;
//!< The
marching cubes
module used in this container.
boost
::
shared_ptr
<
WModule
>
m_
isosurface
Module
;
//!< The
isosurface
module used in this container.
boost
::
shared_ptr
<
WModule
>
m_distanceMapModule
;
//!< The distance map module used in this container.
};
...
...
src/modules/isosurface/WM
MarchingCubes
.cpp
→
src/modules/isosurface/WM
Isosurface
.cpp
View file @
29a2ceb5
...
...
@@ -56,13 +56,13 @@
#include "core/graphicsEngine/WGEUtils.h"
#include "core/kernel/WKernel.h"
#include "core/kernel/WSelectionManager.h"
#include "WM
MarchingCubes
.h"
#include "WM
MarchingCubes
.xpm"
#include "WM
Isosurface
.h"
#include "WM
Isosurface
.xpm"
// This line is needed by the module loader to actually find your module.
W_LOADABLE_MODULE
(
WM
MarchingCubes
)
W_LOADABLE_MODULE
(
WM
Isosurface
)
WM
MarchingCubes
::
WMMarchingCubes
()
:
WM
Isosurface
::
WMIsosurface
()
:
WModule
(),
m_recompute
(
boost
::
shared_ptr
<
WCondition
>
(
new
WCondition
()
)
),
m_dataSet
(),
...
...
@@ -73,28 +73,28 @@ WMMarchingCubes::WMMarchingCubes():
// Implement WModule::initializeConnectors instead.
}
WM
MarchingCubes
::~
WMMarchingCubes
()
WM
Isosurface
::~
WMIsosurface
()
{
// cleanup
removeConnectors
();
}
boost
::
shared_ptr
<
WModule
>
WM
MarchingCubes
::
factory
()
const
boost
::
shared_ptr
<
WModule
>
WM
Isosurface
::
factory
()
const
{
return
boost
::
shared_ptr
<
WModule
>
(
new
WM
MarchingCubes
()
);
return
boost
::
shared_ptr
<
WModule
>
(
new
WM
Isosurface
()
);
}
const
char
**
WM
MarchingCubes
::
getXPMIcon
()
const
const
char
**
WM
Isosurface
::
getXPMIcon
()
const
{
return
iso_surface_xpm
;
}
const
std
::
string
WM
MarchingCubes
::
getName
()
const
const
std
::
string
WM
Isosurface
::
getName
()
const
{
return
"Isosurface"
;
}
const
std
::
string
WM
MarchingCubes
::
getDescription
()
const
const
std
::
string
WM
Isosurface
::
getDescription
()
const
{
return
"This module implements the marching cubes"
" algorithm with a consistent triangulation. It allows to compute isosurfaces"
...
...
@@ -102,7 +102,7 @@ const std::string WMMarchingCubes::getDescription() const
" the surface as triangle soup."
;
}
void
WM
MarchingCubes
::
moduleMain
()
void
WM
Isosurface
::
moduleMain
()
{
// use the m_input "data changed" flag
m_moduleState
.
setResetable
(
true
,
true
);
...
...
@@ -180,7 +180,7 @@ void WMMarchingCubes::moduleMain()
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getViewer
()
->
getScene
()
->
remove
(
m_moduleNode
);
}
void
WM
MarchingCubes
::
connectors
()
void
WM
Isosurface
::
connectors
()
{
// initialize connectors
m_input
=
boost
::
shared_ptr
<
WModuleInputData
<
WDataSetScalar
>
>
(
...
...
@@ -200,7 +200,7 @@ void WMMarchingCubes::connectors()
WModule
::
connectors
();
}
void
WM
MarchingCubes
::
properties
()
void
WM
Isosurface
::
properties
()
{
m_nbTriangles
=
m_infoProperties
->
addProperty
(
"Triangles"
,
"The number of triangles in the produced mesh."
,
0
);
m_nbTriangles
->
setMax
(
std
::
numeric_limits
<
int
>::
max
()
);
...
...
@@ -326,7 +326,7 @@ namespace
}
}
// namespace
void
WM
MarchingCubes
::
generateSurfacePre
(
double
isoValue
)
void
WM
Isosurface
::
generateSurfacePre
(
double
isoValue
)
{
debugLog
()
<<
"Isovalue: "
<<
isoValue
;
WAssert
(
(
*
m_dataSet
).
getValueSet
()
->
order
()
==
0
,
"This module only works on scalars."
);
...
...
@@ -362,7 +362,7 @@ void WMMarchingCubes::generateSurfacePre( double isoValue )
}
}
void
WM
MarchingCubes
::
renderMesh
()
void
WM
Isosurface
::
renderMesh
()
{
{
// Remove the previous node in a thread safe way.
...
...
@@ -434,7 +434,7 @@ void WMMarchingCubes::renderMesh()
// ------------------------------------------------
// Shader stuff
osg
::
ref_ptr
<
WGEShader
>
shader
=
osg
::
ref_ptr
<
WGEShader
>
(
new
WGEShader
(
"WM
MarchingCubes
"
,
m_localPath
)
);
osg
::
ref_ptr
<
WGEShader
>
shader
=
osg
::
ref_ptr
<
WGEShader
>
(
new
WGEShader
(
"WM
Isosurface
"
,
m_localPath
)
);
shader
->
addPreprocessor
(
WGEShaderPreprocessor
::
SPtr
(
new
WGEShaderPropertyDefineOptions
<
WPropBool
>
(
m_useTextureProp
,
"COLORMAPPING_DISABLED"
,
"COLORMAPPING_ENABLED"
)
)
);
...
...
@@ -451,10 +451,10 @@ void WMMarchingCubes::renderMesh()
m_moduleNodeInserted
=
true
;
}
m_moduleNode
->
addUpdateCallback
(
new
WGEFunctorCallback
<
osg
::
Node
>
(
boost
::
bind
(
&
WM
MarchingCubes
::
updateGraphicsCallback
,
this
)
)
);
m_moduleNode
->
addUpdateCallback
(
new
WGEFunctorCallback
<
osg
::
Node
>
(
boost
::
bind
(
&
WM
Isosurface
::
updateGraphicsCallback
,
this
)
)
);
}
void
WM
MarchingCubes
::
updateGraphicsCallback
()
void
WM
Isosurface
::
updateGraphicsCallback
()
{
boost
::
unique_lock
<
boost
::
shared_mutex
>
lock
;
lock
=
boost
::
unique_lock
<
boost
::
shared_mutex
>
(
m_updateLock
);
...
...
src/modules/isosurface/WM
MarchingCubes
.h
→
src/modules/isosurface/WM
Isosurface
.h
View file @
29a2ceb5
...
...
@@ -22,8 +22,8 @@
//
//---------------------------------------------------------------------------
#ifndef WM
MARCHINGCUBES
_H
#define WM
MARCHINGCUBES
_H
#ifndef WM
ISOSURFACE
_H
#define WM
ISOSURFACE
_H
#include <map>
#include <string>
...
...
@@ -47,23 +47,23 @@
* given on regular grids with axis-aligned cells.
* \ingroup modules
*/
class
WM
MarchingCubes
:
public
WModule
class
WM
Isosurface
:
public
WModule
{
/**
* Only UnitTests may be friends.
*/
friend
class
WM
MarchingCubes
Test
;
friend
class
WM
Isosurface
Test
;
public:
/**
* Standard constructor.
*/
WM
MarchingCubes
();
WM
Isosurface
();
/**
* Destructor.
*/
~
WM
MarchingCubes
();
~
WM
Isosurface
();
/**
* Gives back the name of this module.
...
...
@@ -162,4 +162,4 @@ private:
osg
::
ref_ptr
<
osg
::
Geode
>
m_surfaceGeode
;
//!< Pointer to geode containing the surface.
};
#endif // WM
MARCHINGCUBES
_H
#endif // WM
ISOSURFACE
_H
src/modules/isosurface/WM
MarchingCubes
.xpm
→
src/modules/isosurface/WM
Isosurface
.xpm
View file @
29a2ceb5
File moved
src/modules/isosurface/shaders/WM
MarchingCubes
-fragment.glsl
→
src/modules/isosurface/shaders/WM
Isosurface
-fragment.glsl
View file @
29a2ceb5
File moved
src/modules/isosurface/shaders/WM
MarchingCubes
-vertex.glsl
→
src/modules/isosurface/shaders/WM
Isosurface
-vertex.glsl
View file @
29a2ceb5
File moved
src/modules/modules-base.toolbox
View file @
29a2ceb5
...
...
@@ -13,8 +13,8 @@ ADD_MODULE( fiberDisplaySimple )
ADD_MODULE( fiberResampling )
ADD_MODULE( gridRenderer )
ADD_MODULE( imageSpaceLIC )
ADD_MODULE( isosurface )
ADD_MODULE( isosurfaceRaytracer )
ADD_MODULE( marchingCubes )
ADD_MODULE( navigationSlices )
ADD_MODULE( scalarOperator )
ADD_MODULE( superquadricGlyphs )
...
...
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