Commit 2d3fb5be authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE #252] made ROI filter mode optional. It is on by default.

parent 27407a27
......@@ -54,7 +54,6 @@
#include "core/kernel/WKernel.h"
#include "WMFiberDisplaySimple.h"
#include "WMFiberDisplaySimple.xpm"
// This line is needed by the module loader to actually find your module. You need to add this to your module too. Do NOT add a ";" here.
W_LOADABLE_MODULE( WMFiberDisplaySimple )
......@@ -74,11 +73,6 @@ boost::shared_ptr< WModule > WMFiberDisplaySimple::factory() const
return boost::shared_ptr< WModule >( new WMFiberDisplaySimple() );
}
const char** WMFiberDisplaySimple::getXPMIcon() const
{
return WMFiberDisplaySimple_xpm;
}
const std::string WMFiberDisplaySimple::getName() const
{
return "Fiber Display Simple";
......@@ -86,7 +80,7 @@ const std::string WMFiberDisplaySimple::getName() const
const std::string WMFiberDisplaySimple::getDescription() const
{
return "Display fibers. This module, unlike the full-fletched Fiber Display, can't handle ROIs. It simply draws fibers.";
return "Display fibers. This module allows filtering by ROIs and provides full fletched graphical output.";
}
void WMFiberDisplaySimple::connectors()
......@@ -114,6 +108,8 @@ void WMFiberDisplaySimple::properties()
{
m_propCondition = boost::shared_ptr< WCondition >( new WCondition() );
m_roiFiltering = m_properties->addProperty( "ROI Filtering", "When active, you can use the ROI mechanism to filter fibers.", true );
m_coloringGroup = m_properties->addPropertyGroup( "Coloring", "Options for defining the coloring of the lines." );
m_illuminationEnable = m_coloringGroup->addProperty( "Illumination", "Enable line illumination.", true );
m_plainColorMode = m_coloringGroup->addProperty( "Use plain color",
......@@ -258,6 +254,11 @@ void WMFiberDisplaySimple::moduleMain()
new WGEShaderPropertyDefineOptions< WPropBool >( m_colormapEnabled, "COLORMAPPING_DISABLED", "COLORMAPPING_ENABLED" ) )
);
// ROI Filter support:
defineTmp = WGEShaderPreprocessor::SPtr(
new WGEShaderPropertyDefineOptions< WPropBool >( m_roiFiltering, "BITFIELD_DISABLED", "BITFIELD_ENABLED" ) );
m_shader->addPreprocessor( defineTmp );
m_endCapShader->addPreprocessor( defineTmp );
m_shader->addBindAttribLocation( "a_bitfield", 6 );
// get notified about data changes
......
......@@ -76,12 +76,6 @@ public:
*/
virtual boost::shared_ptr< WModule > factory() const;
/**
* Get the icon for this module in XPM format.
* \return The icon.
*/
virtual const char** getXPMIcon() const;
protected:
/**
* Entry point after loading the module. Runs in separate thread.
......@@ -156,6 +150,11 @@ private:
*/
WPropBool m_illuminationEnable;
/**
* Allow disabling ROI filter mode.
*/
WPropBool m_roiFiltering;
/**
* Group containing several coloring options
*/
......
......@@ -63,10 +63,12 @@ uniform float u_colormapRatio = 1.0;
*/
void main()
{
#ifdef BITFIELD_ENABLED
if( v_discard > 0.0 )
{
discard;
}
#endif
#ifdef CLIPPLANE_ENABLED
// discard fragment if too far from plane
......
......@@ -52,7 +52,9 @@ uniform float u_tubeSize;
/**
* This vertex attribute is the bitmask denoting whether to show the fiber or not
*/
in float a_bitfield;
#ifdef BITFIELD_ENABLED
in float a_bitfield;
#endif
/////////////////////////////////////////////////////////////////////////////
// Attributes
......@@ -140,7 +142,9 @@ void main()
v_clusterColor = gl_SecondaryColor.rgb;
#endif
#ifdef BITFIELD_ENABLED
v_discard = 1.0 - a_bitfield;
#endif
// Simply project the vertex afterwards
gl_Position = gl_ProjectionMatrix * v_vertex;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment