25 #ifndef WMISOSURFACE_H
26 #define WMISOSURFACE_H
29 #include <shared_mutex>
34 #include <osg/Uniform>
36 #include "core/dataHandler/WDataSetScalar.h"
37 #include "core/dataHandler/WGridRegular3D.h"
38 #include "core/graphicsEngine/WGEManagedGroupNode.h"
39 #include "core/graphicsEngine/WTriangleMesh.h"
40 #include "core/graphicsEngine/shaders/WGEShader.h"
41 #include "core/kernel/WModule.h"
42 #include "core/kernel/WModuleInputData.h"
43 #include "core/kernel/WModuleOutputData.h"
72 virtual const std::string
getName()
const;
86 virtual std::shared_ptr< WModule >
factory()
const;
146 std::shared_ptr< WModuleInputData< WDataSetScalar > >
m_input;
147 std::shared_ptr< WModuleOutputData< WTriangleMesh > >
m_output;
155 std::shared_ptr< WGridRegular3D >
m_grid;
Module implementing the marching cubes algorithm with consistent triangulation for data given on regu...
void updateGraphicsCallback()
updates textures and shader parameters when called (usually from the callback)
WPropInt m_nbVertices
Info-property showing the number of vertices in the mesh.
bool m_moduleNodeInserted
ensures that the above module node gets inserted once the first triangle mesh has been calculated.
virtual void moduleMain()
Entry point after loading the module.
osg::ref_ptr< osg::Geode > m_surfaceGeode
Pointer to geode containing the surface.
std::shared_ptr< WModuleInputData< WDataSetScalar > > m_input
Input connector required by this module.
virtual const std::string getName() const
Gives back the name of this module.
std::shared_mutex m_updateLock
Lock to prevent concurrent threads trying to update the osg node.
osg::ref_ptr< WGEManagedGroupNode > m_moduleNode
Pointer to the module's group node. We need it to be able to update it for callback.
void renderMesh()
Prepares and commits everything for rendering with the OSG.
std::shared_ptr< WCondition > m_recompute
This condition denotes whether we need to recompute the surface.
WPropBool m_useMarchingLego
Property indicating whether to use interpolated or non interpolated triangulation.
std::shared_ptr< const WDataSetScalar > m_dataSet
pointer to dataSet to be able to access it throughout the whole module.
virtual void properties()
Initialize the properties for this module.
WMIsosurface()
Standard constructor.
bool m_firstDataProcessed
Indicates if we already processed the first arrived data. This helps us to reset the isovalue only th...
virtual const std::string getDescription() const
Gives back a description of this module.
virtual void connectors()
Initialize the connectors this module is using.
std::shared_ptr< WTriangleMesh > m_triMesh
This triangle mesh is provided as output through the connector.
friend class WMIsosurfaceTest
Only UnitTests may be friends.
virtual const char ** getXPMIcon() const
Get the icon for this module in XPM format.
std::shared_ptr< WModuleOutputData< WTriangleMesh > > m_output
Input connector required by this module.
std::shared_ptr< WGridRegular3D > m_grid
pointer to grid, because we need to access the grid for the dimensions of the texture.
osg::ref_ptr< WGEShader > m_shader
The shader.
WPropInt m_nbTriangles
Info-property showing the number of triangles in the mesh.
virtual std::shared_ptr< WModule > factory() const
Due to the prototype design pattern used to build modules, this method returns a new instance of this...
static const int m_triTable[256][16]
Lookup table for triangles used in the construction of the isosurface.
void generateSurfacePre(double isoValue)
Kind of a convenience function for generate surface.
WPropColor m_surfaceColor
Property determining the color for the surface if no textures are displayed.
WPropBool m_useTextureProp
Property indicating whether to use texturing with scalar data sets.
~WMIsosurface()
Destructor.
WPropInt m_opacityProp
Property holding the opacity valueassigned to the surface.
static const unsigned int m_edgeTable[256]
Lookup table for edges used in the construction of the isosurface.
WPropDouble m_isoValueProp
Property holding the iso value.
Class representing a single module of OpenWalnut.