25 #ifndef WMTRIANGLEMESHRENDERER_H
26 #define WMTRIANGLEMESHRENDERER_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;
195 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_mainComponentOnly
En/Disable display of only the main component (biggest vertices number)
void renderMesh(std::shared_ptr< WTriangleMesh > mesh)
Render the mesh.
WPropInt m_nbTriangles
Info-property showing the number of triangles in the mesh.
osg::ref_ptr< osg::Uniform > m_colorMapTransformation
OSG Uniform for the transformation matrix which transforms the mesh.
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.
virtual const std::string getDescription() const
Gives back a description of this module.
double getIntervallCenterMiddle(double min, double max) const
Calculates the center point of a given interval.
WPropBool m_showCoordinateSystem
Enables mesh's coordinate system.
WPropDouble m_scaleY
The mesh's scale value in Y direction.
WPropGroup m_groupTransformation
A group wich contains all transformation tools.
void setToDefault()
Set the transformation tool to default.
WPropGroup m_coloringGroup
Group for all color and colormapping options.
WPropDouble m_scaleZ
The mesh's scale value in Z direction.
virtual void connectors()
Initialize the connectors this module is using.
WPropDouble m_rotateY
The mesh's rotate value around Y.
void updateTransformation()
Updates the transformation matrix of the main node.
virtual const std::string getName() const
Gives back the name of this module.
WPropDouble m_translateY
The mesh's translate value along X.
WPropDouble m_opacity
The mesh's opacity value.
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.
WPropDouble m_translateX
The mesh's translate value along X.
WPropDouble m_scaleX
The mesh's scale value in X direction.
WPropDouble m_colormapRatio
Set Colormap Ratio.
WGEManagedGroupNode::SPtr m_moduleNode
The node containing all geometry nodes.
WPropBool m_colormap
Turn Colormapping on/off.
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.
std::shared_ptr< WModuleInputData< WColoredVertices > > m_colorMapInput
A map for mapping each vertex to a color.
virtual ~WMTriangleMeshRenderer()
Destructor.
WPropDouble m_translateZ
The mesh's translate value along X.
WPropInt m_nbVertices
Info-property showing the number of vertices in the mesh.
WVector3d m_meshCenter
Center of the mesh.
WMTriangleMeshRenderer()
Constructor.
WPropColor m_color
The color of the mesh to be rendered.
virtual void properties()
Initialize the properties for this module.
double getMedian(double x, double y, double z) const
Gets the median of three values.
WPropSelection m_renderingMode
Which rendering mode should be used?
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...
WPropSelection m_colorMode
Which color mode should be used?
WPropBool m_scale
If true, the mesh scale properties are linked.
WPropTrigger m_setDefault
Set the transformation tool to default.
WPropDouble m_rotateX
The mesh's rotate value around X.
virtual const char ** getXPMIcon() const
Get the icon for this module in XPM format.
virtual void moduleMain()
Entry point after loading the module.
WPropDouble m_rotateZ
The mesh's rotate value around Z.
Class representing a single module of OpenWalnut.
Triangle mesh data structure allowing for convenient access of the elements.