38 #include <osg/StateAttribute>
40 #include "WDemoGeometry.h"
41 #include "WMTemplateColormapping.h"
42 #include "core/graphicsEngine/WGEColormapping.h"
43 #include "core/graphicsEngine/WGEManagedGroupNode.h"
44 #include "core/graphicsEngine/WGERequirement.h"
45 #include "core/graphicsEngine/WGETexture.h"
46 #include "core/graphicsEngine/shaders/WGEShader.h"
47 #include "core/kernel/WKernel.h"
71 return "Template Colormapping";
77 return "Show how to use colormapping in your modules.";
139 osg::ref_ptr< WGEGroupNode > rootNode =
new WGEGroupNode();
149 plane->getOrCreateStateSet()->setMode( GL_BLEND, osg::StateAttribute::ON );
150 plane->getOrCreateStateSet()->setRenderingHint( osg::StateSet::TRANSPARENT_BIN );
153 rootNode->insert( spheres );
154 rootNode->insert( plane );
157 rootNode->getOrCreateStateSet()->setMode( GL_BLEND, osg::StateAttribute::ON );
160 osg::ref_ptr< WGEShader > globalShader(
162 "WMTemplateColormapping",
166 globalShader->apply( rootNode );
virtual void wait() const
Wait for the condition.
void setResetable(bool resetable=true, bool autoReset=true)
Sets the resetable flag.
virtual void add(std::shared_ptr< WCondition > condition)
Adds another condition to the set of conditions to wait for.
Class to encapsulate boost::condition_variable_any.
static void apply(osg::ref_ptr< osg::Node > node, WMatrix4d preTransform=WMatrix4d::identity(), osg::ref_ptr< WGEShader > shader=osg::ref_ptr< WGEShader >(), size_t startTexUnit=0)
Apply the colormapping to the specified node.
Class to wrap around the osg Group node and providing a thread safe add/removal mechanism.
This requirement ensures an up and running WGE.
Class encapsulating the OSG Program class for a more convenient way of adding and modifying shader.
static WKernel * getRunningKernel()
Returns pointer to the currently running kernel.
std::shared_ptr< WGraphicsEngine > getGraphicsEngine() const
Returns pointer to currently running instance of graphics engine.
virtual void moduleMain()
Entry point after loading the module.
virtual void requirements()
Initialize requirements for this module.
virtual ~WMTemplateColormapping()
Destructor.
virtual const std::string getDescription() const
Gives back a description of this module.
std::shared_ptr< WCondition > m_propCondition
A condition for property updates.
virtual const std::string getName() const
Gives back the name of this module.
WMTemplateColormapping()
Constuctor.
virtual void properties()
Initialize the properties for this module.
virtual void connectors()
Initialize the connectors this module is using.
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...
Class representing a single module of OpenWalnut.
boost::filesystem::path m_localPath
The path where the module binary resides in.
Requirements m_requirements
The list of requirements.
virtual void properties()
Initialize properties in this function.
wlog::WStreamedLogger debugLog() const
Logger instance for comfortable debug logging.
void ready()
Call this whenever your module is ready and can react on property changes.
WConditionSet m_moduleState
The internal state of the module.
virtual void connectors()
Initialize connectors in this function.
WBoolFlag m_shutdownFlag
Condition getting fired whenever the thread should quit.
osg::ref_ptr< osg::Node > createSphereGeometry()
Create several spheres.
osg::ref_ptr< osg::Node > createPlaneGeometry()
Create a plane.