25 #ifndef WMSURFACEILLUSTRATOR_H
26 #define WMSURFACEILLUSTRATOR_H
31 #include <osg/Uniform>
33 #include "core/common/datastructures/WColoredVertices.h"
34 #include "core/common/math/linearAlgebra/WVectorFixed.h"
35 #include "core/graphicsEngine/WGEManagedGroupNode.h"
36 #include "core/kernel/WModule.h"
37 #include "core/kernel/WModuleInputData.h"
38 #include "core/kernel/WModuleOutputData.h"
67 virtual const std::string
getName()
const;
81 virtual std::shared_ptr< WModule >
factory()
const;
117 void updateMinMax(
double& minX,
double& maxX,
double& minY,
double& maxY,
double& minZ,
double& maxZ,
const osg::Vec3d& vector )
const;
128 double getMedian(
double x,
double y,
double z )
const;
190 void renderMesh( std::shared_ptr< WTriangleMesh > mesh );
osg::ref_ptr< WGEManagedGroupNode > SPtr
Shared pointer.
Class encapsulating the OSG Program class for a more convenient way of adding and modifying shader.
This module renders the triangle mesh given at its input connector as a surface.
WPropBool m_colormap
Turn Colormapping on/off.
std::shared_ptr< WCondition > m_propCondition
A condition used to notify about changes in several properties.
WPropBool m_showOutline
Toggle showing outline instead fo surface.
WPropInt m_nbTriangles
Info-property showing the number of triangles in the mesh.
WPropTrigger m_setDefault
Set the transformation tool to default.
WPropSelection m_colorMode
Which colormode should be used?
osg::ref_ptr< osg::Uniform > m_colorMapTransformation
OSG Uniform for the transformation matrix which transforms the mesh.
std::shared_ptr< WModuleInputData< WColoredVertices > > m_colorMapInput
A map for mapping each vertex to a color.
WGEManagedGroupNode::SPtr m_moduleNode
The node containing all geometry nodes.
WPropInt m_nbVertices
Info-property showing the number of vertices in the mesh.
virtual void properties()
Initialize the properties for this module.
virtual const std::string getDescription() const
Gives back a description of this module.
virtual const char ** getXPMIcon() const
Get the icon for this module in XPM format.
void renderMesh(std::shared_ptr< WTriangleMesh > mesh)
Render the mesh.
void updateMinMax(double &minX, double &maxX, double &minY, double &maxY, double &minZ, double &maxZ, const osg::Vec3d &vector) const
Calculates the bounding box of a vector and increases the specified one if needed.
WPropGroup m_groupTransformation
A group wich contains all transformation tools.
WPropColor m_color
The color of the mesh to be rendered.
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...
virtual void connectors()
Initialize the connectors this module is using.
WMSurfaceIllustrator()
Constructor.
WPropDouble m_parameterWidth
Set width of selected surface parameter interval.
WPropDouble m_parameterCenter
Set center of selected surface parameter.
virtual void moduleMain()
Entry point after loading the module.
WPropDouble m_opacity
The mesh's opacity value.
osg::ref_ptr< WGEShader > m_shader
The shader for the mesh.
std::shared_ptr< WModuleInputData< WTriangleMesh > > m_meshInput
An input connector used to get meshes from other modules.
double getMedian(double x, double y, double z) const
Gets the median of three values.
WPropSelection m_illustrationMode
Select the type of illustration applied in the shader.
virtual ~WMSurfaceIllustrator()
Destructor.
WVector3d m_meshCenter
Center of the mesh.
WPropGroup m_coloringGroup
Group for all color and colormapping options.
virtual const std::string getName() const
Gives back the name of this module.
Class representing a single module of OpenWalnut.
Triangle mesh data structure allowing for convenient access of the elements.