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
425325fa
Commit
425325fa
authored
Feb 17, 2010
by
Sebastian Eichelbaum
Browse files
[MERGE]
parents
3b49df9f
8543fd54
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
2275 additions
and
426 deletions
+2275
-426
src/modules/distanceMap/WMDistanceMap.cpp
src/modules/distanceMap/WMDistanceMap.cpp
+7
-0
src/modules/distanceMap/WMDistanceMap.h
src/modules/distanceMap/WMDistanceMap.h
+6
-0
src/modules/distanceMap/WMDistanceMapIsosurface.cpp
src/modules/distanceMap/WMDistanceMapIsosurface.cpp
+15
-6
src/modules/distanceMap/WMDistanceMapIsosurface.h
src/modules/distanceMap/WMDistanceMapIsosurface.h
+8
-7
src/modules/distanceMap/distancemap.png
src/modules/distanceMap/distancemap.png
+0
-0
src/modules/distanceMap/distancemap.xpm
src/modules/distanceMap/distancemap.xpm
+1779
-382
src/modules/distanceMap/distancemapIsosurface.png
src/modules/distanceMap/distancemapIsosurface.png
+0
-0
src/modules/distanceMap/distancemapIsosurface.xpm
src/modules/distanceMap/distancemapIsosurface.xpm
+450
-0
src/modules/marchingCubes/WMMarchingCubes.cpp
src/modules/marchingCubes/WMMarchingCubes.cpp
+10
-25
src/modules/marchingCubes/WMMarchingCubes.h
src/modules/marchingCubes/WMMarchingCubes.h
+0
-6
No files found.
src/modules/distanceMap/WMDistanceMap.cpp
View file @
425325fa
...
...
@@ -28,6 +28,7 @@
#include <vector>
#include "WMDistanceMap.h"
#include "distancemap.xpm"
#include "../../kernel/WKernel.h"
#include "../../kernel/WModuleFactory.h"
...
...
@@ -54,6 +55,12 @@ boost::shared_ptr< WModule > WMDistanceMap::factory() const
return
boost
::
shared_ptr
<
WModule
>
(
new
WMDistanceMap
()
);
}
const
char
**
WMDistanceMap
::
getXPMIcon
()
const
{
return
distancemap_xpm
;
}
const
std
::
string
WMDistanceMap
::
getName
()
const
{
return
"Distance Map"
;
...
...
src/modules/distanceMap/WMDistanceMap.h
View file @
425325fa
...
...
@@ -75,6 +75,12 @@ public:
*/
virtual
boost
::
shared_ptr
<
WModule
>
factory
()
const
;
/**
* Get the icon for this module in XPM format.
*/
virtual
const
char
**
getXPMIcon
()
const
;
protected:
/**
* Entry point after loading the module. Runs in separate thread.
...
...
src/modules/distanceMap/WMDistanceMapIsosurface.cpp
View file @
425325fa
...
...
@@ -29,7 +29,7 @@
#include "WMDistanceMap.h"
#include "WMDistanceMapIsosurface.h"
#include "distancemap.xpm"
#include "distancemap
Isosurface
.xpm"
#include "../../kernel/WKernel.h"
#include "../../kernel/WModuleFactory.h"
...
...
@@ -63,7 +63,7 @@ boost::shared_ptr< WModule > WMDistanceMapIsosurface::factory() const
const
char
**
WMDistanceMapIsosurface
::
getXPMIcon
()
const
{
return
distancemap_xpm
;
return
distancemap
Isosurface
_xpm
;
}
void
WMDistanceMapIsosurface
::
moduleMain
()
...
...
@@ -80,9 +80,17 @@ void WMDistanceMapIsosurface::moduleMain()
// now wait for it to be ready
m_marchingCubesModule
->
isReady
().
wait
();
m_marchingCubesModule
->
getProperties
()
->
findProp
(
"Iso Value"
)
->
setValue
<
float
>
(
0.5
);
m_properties
->
addProperty
(
m_marchingCubesModule
->
getProperties
()
->
findProp
(
"active"
)
);
m_properties
->
addProperty
(
m_marchingCubesModule
->
getProperties
()
->
findProp
(
"Iso Value"
)
);
boost
::
shared_ptr
<
WProperties2
>
mcProps
=
m_marchingCubesModule
->
getProperties2
();
m_isoValueProp
=
mcProps
->
getProperty
(
"Iso Value"
)
->
toPropDouble
();
m_isoValueProp
->
set
(
0.5
);
m_isoValueProp
->
setMin
(
0.0
);
m_isoValueProp
->
setMax
(
1.0
);
m_properties2
->
addProperty
(
m_isoValueProp
);
m_useTextureProp
=
mcProps
->
getProperty
(
"Use Texture"
)
->
toPropBool
();
m_useTextureProp
->
set
(
true
);
m_properties2
->
addProperty
(
m_useTextureProp
);
//////////////////////////////////////////////////////////////////////////////////
// Distance Map
...
...
@@ -164,7 +172,8 @@ void WMDistanceMapIsosurface::properties()
{
}
void
WMDistanceMapIsosurface
::
slotPropertyChanged
(
std
::
string
/*propertyName*/
)
void
WMDistanceMapIsosurface
::
activate
(
)
{
m_marchingCubesModule
->
getProperties2
()
->
getProperty
(
"active"
)
->
toPropBool
()
->
set
(
m_active
->
get
()
);
}
src/modules/distanceMap/WMDistanceMapIsosurface.h
View file @
425325fa
...
...
@@ -68,13 +68,6 @@ public:
*/
virtual
const
char
**
getXPMIcon
()
const
;
/**
* Determine what to do if a property was changed.
* \param propertyName Name of the property.
*/
void
slotPropertyChanged
(
std
::
string
propertyName
);
protected:
/**
* Entry point after loading the module. Runs in separate thread.
...
...
@@ -91,8 +84,16 @@ protected:
*/
virtual
void
properties
();
/**
* Callback for m_active. Overwrite this in your modules to handle m_active changes separately.
*/
virtual
void
activate
();
private:
WPropDouble
m_isoValueProp
;
//!< Property holding the value for the distance.
WPropBool
m_useTextureProp
;
//!< Property indicating whether to use texturing with scalar data sets.
/**
* The description of the module. This is used for the container.
*/
...
...
src/modules/distanceMap/distancemap.png
View replaced file @
3b49df9f
View file @
425325fa
10.1 KB
|
W:
|
H:
13.3 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/modules/distanceMap/distancemap.xpm
View file @
425325fa
This diff is collapsed.
Click to expand it.
src/modules/distanceMap/distancemapIsosurface.png
0 → 100644
View file @
425325fa
15.2 KB
src/modules/distanceMap/distancemapIsosurface.xpm
0 → 100644
View file @
425325fa
This diff is collapsed.
Click to expand it.
src/modules/marchingCubes/WMMarchingCubes.cpp
View file @
425325fa
...
...
@@ -175,38 +175,23 @@ void WMMarchingCubes::connectors()
void
WMMarchingCubes
::
properties
()
{
// {
// // If set in config file use standard isovalue from config file
// double tmpIsoValue;
// if( WPreferences::getPreference( "modules.MC.isoValue", &tmpIsoValue ) )
// {
// m_properties->addDouble( "Iso Value", tmpIsoValue )->connect( boost::bind( &WMMarchingCubes::slotPropertyChanged, this, _1 ) );
// }
// else
// {
// m_properties->addDouble( "Iso Value", m_tIsoLevel )->connect( boost::bind( &WMMarchingCubes::slotPropertyChanged, this, _1 ) );
// }
// }
m_isoValueProp
=
m_properties2
->
addProperty
(
"Iso Value"
,
"The surface will show the area that has this value."
,
100.
,
m_recompute
);
m_isoValueProp
->
setMin
(
wlimits
::
MIN_DOUBLE
);
m_isoValueProp
->
setMax
(
wlimits
::
MAX_DOUBLE
);
{
// If set in config file use standard isovalue from config file
double
tmpIsoValue
;
if
(
WPreferences
::
getPreference
(
"modules.MC.isoValue"
,
&
tmpIsoValue
)
)
{
m_isoValueProp
->
set
(
tmpIsoValue
);
}
}
m_opacityProp
=
m_properties2
->
addProperty
(
"Opacity %"
,
"Opaqueness of surface."
,
100
);
m_opacityProp
->
setMin
(
0
);
m_opacityProp
->
setMax
(
100
);
m_useTextureProp
=
m_properties2
->
addProperty
(
"Use Texture"
,
"Use texturing of the surface?"
,
false
);
}
void
WMMarchingCubes
::
slotPropertyChanged
(
std
::
string
propertyName
)
{
if
(
propertyName
==
"active"
)
{
}
else
{
std
::
cout
<<
propertyName
<<
std
::
endl
;
assert
(
0
&&
"This property name is not supported by this function yet."
);
}
m_useTextureProp
=
m_properties2
->
addProperty
(
"Use Texture"
,
"Use texturing of the surface?"
,
false
);
}
void
WMMarchingCubes
::
generateSurfacePre
(
double
isoValue
)
...
...
src/modules/marchingCubes/WMMarchingCubes.h
View file @
425325fa
...
...
@@ -121,12 +121,6 @@ public:
*/
virtual
const
std
::
string
getDescription
()
const
;
/**
* Determine what to do if a property was changed.
* \param propertyName Name of the property.
*/
void
slotPropertyChanged
(
std
::
string
propertyName
);
/**
* Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
* should never be initialized or modified in some other way. A simple new instance is required.
...
...
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