Commit 6760c018 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[REMOVE #252] deleted old fiberDisplay module. Was obsolete now.

parent 0f8a381c
This diff is collapsed.
......@@ -27,35 +27,32 @@
#include <string>
#include <osg/Geode>
#include "core/dataHandler/WDataSetFibers.h"
#include "core/graphicsEngine/WFiberDrawable.h"
#include "core/graphicsEngine/WROI.h"
#include "core/graphicsEngine/WROIBox.h"
#include "core/graphicsEngine/shaders/WGEShader.h"
#include "core/kernel/WFiberSelector.h"
#include "core/kernel/WModule.h"
#include "core/kernel/WModuleInputData.h"
#include "core/kernel/WModuleOutputData.h"
#include "core/dataHandler/WDataSetFiberClustering.h"
#include "core/dataHandler/WDataSetFibers.h"
#include "core/kernel/WFiberSelector.h"
// forward declarations
class WGEShader;
/**
* Module for drawing fibers
* This modules takes a dataset and equalizes its histogram.
*
* \ingroup modules
*/
class WMFiberDisplay : public WModule
class WMFiberDisplay: public WModule
{
public:
/**
* Constructs new FiberTestModule
* Default constructor.
*/
WMFiberDisplay();
/**
* Destructs this FiberTestModule
* Destructor.
*/
virtual ~WMFiberDisplay();
......@@ -72,28 +69,15 @@ public:
virtual const std::string getDescription() const;
/**
* Due to the prototype design pattern used to build modules, this method
* returns a new instance of this method. NOTE: it should never be
* initialized or modified in some other way. A simple new instance is
* required.
* Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
* should never be initialized or modified in some other way. A simple new instance is required.
*
* \return the prototype used to create every module in OpenWalnut.
*/
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:
/**
* Callback for m_active. Overwrite this in your modules to handle m_active changes separately.
*/
virtual void activate();
/**
* Entry point after loading the module. Runs in separate thread.
*/
virtual void moduleMain();
......@@ -108,168 +92,215 @@ protected:
*/
virtual void properties();
private:
/**
* Redraws the scene.
* Geometry update callback. Handles fiber cluster filtering
*
* \param geometry the geometry instance to handle
*/
void geometryUpdate( osg::Drawable* geometry );
/**
* If true, the geometryUpdate() callback will upload a new filter attribute array.
*/
void update();
bool m_fiberClusteringUpdate;
/**
* initial creation of the osg geometry
* The fiber dataset which is going to be filtered.
*/
void create();
boost::shared_ptr< WModuleInputData< WDataSetFibers > > m_fiberInput;
/**
* switches between fiber display and tube representation,
* texturing and box culling
* activates the neccesary shaders
*/
void updateRenderModes();
* An optional fiber clustering can be specified to filter in m_fiberInput.
*/
boost::shared_ptr< WModuleInputData< WDataSetFiberClustering > > m_fiberClusteringInput;
private:
/**
* function gets called when the input connector has been updated
* The current fiber data
*/
void inputUpdated();
WDataSetFibers::SPtr m_fibers;
/**
* The update callback that is called for the osg node of this module.
* The current fiber clustering
*/
void updateCallback();
WDataSetFiberClustering::SPtr m_fiberClustering;
/**
* A condition used to notify about changes in several properties.
*/
boost::shared_ptr< WCondition > m_propCondition;
WPropBool m_useTubesProp; //!< Property indicating whether to use tubes for the fibers tracts.
WPropBool m_useTextureProp; //!< Property indicating whether to use tubes for the fibers tracts.
WPropDouble m_tubeThickness; //!< Property determining the thickness of tubes .
WBoolFlag m_noData; //!< Flag indicating whether there is data to display.
/**
* The properties of the fiber dataset.
*/
WProperties::SPtr m_fibProps;
/**
* The shader used for actually drawing the fake tubes or lines.
*/
osg::ref_ptr< WGEShader > m_shader;
/**
* The shader used for drawing end cap sprites if in tube mode.
*/
osg::ref_ptr< WGEShader > m_endCapShader;
WPropGroup m_cullBoxGroup; //!< property group for box culling
WPropBool m_activateCullBox; //!< if true fibers are culled depending on a cull box
WPropBool m_showCullBox; //!< Enable/Disable showing of the cull box
WPropBool m_insideCullBox; //!< if true fibers inside the cull box are shown, outside if false
/**
* Illumination.
*/
WPropBool m_illuminationEnable;
/**
* This property triggers the updating of the output connector, as it would be too slow to do on every
* selection change
* Allow disabling ROI filter mode.
*/
WPropTrigger m_propUpdateOutputTrigger;
WPropBool m_roiFiltering;
/**
* Input connector for a fiber dataset.
* Group containing several coloring options
*/
boost::shared_ptr< WModuleInputData< const WDataSetFibers > > m_fiberInput;
WPropGroup m_coloringGroup;
/**
* Output connector for a fiber dataset.
* Define whether to use a single color or the dataset color.
*/
boost::shared_ptr< WModuleOutputData< WDataSetFibers > > m_fiberOutput;
WPropBool m_plainColorMode;
/**
* Pointer to the fiber data set
* Define a color to use if in plain color mode.
*/
boost::shared_ptr< const WDataSetFibers > m_dataset;
WPropColor m_plainColor;
/**
* OSG node for this module. All other OSG nodes of this module should be
* placed as child to this node.
* The ratio between colormap and fiber color.
*/
osg::ref_ptr< osg::Group > m_osgNode;
WPropDouble m_colormapRatio;
/**
* Point to a fiber selector, which is an adapater between the roi manager and the this module
* True if colormapping should be used.
*/
boost::shared_ptr< WFiberSelector > m_fiberSelector;
WPropBool m_colormapEnabled;
/**
* A property group for all the clipping related props.
*/
WPropGroup m_clipPlaneGroup;
/**
* Property for en-/disable clipping.
*/
WPropBool m_clipPlaneEnabled;
/**
* stores pointer to the fiber drawer
* Property for en-/disabling of the clip plane plane.
*/
osg::ref_ptr< WFiberDrawable > m_fiberDrawable;
WPropBool m_clipPlaneShowPlane;
/**
* lock to prevent concurrent threads trying to update the osg node
* Point on the plane. Defines the plane.
*/
boost::shared_mutex m_updateLock;
WPropPosition m_clipPlanePoint;
/**
* the shader object for rendering tubes
* Vector of the plane. Defines the plane.
*/
osg::ref_ptr< WGEShader >m_shaderTubes;
WPropPosition m_clipPlaneVector;
/**
* the shader object for rendering textured lines
* Distance from plane. Used as threshold.
*/
osg::ref_ptr< WGEShader >m_shaderTexturedFibers;
WPropDouble m_clipPlaneDistance;
osg::ref_ptr<osg::Uniform> m_uniformTubeThickness; //!< tube thickness
/**
* Prop denoting whether to use tubes or line strips
*/
WPropBool m_tubeEnable;
/**
* boolean to notify the shader to use the texture instead of glColor
* Property denoting whether to use end-caps on tubes
*/
osg::ref_ptr<osg::Uniform> m_uniformUseTexture;
WPropBool m_tubeEndCapsEnable;
/**
* uniform for type of texture
* Prop denoting whether tubes can be zoomed or not.
*/
osg::ref_ptr<osg::Uniform> m_uniformType;
WPropBool m_tubeZoomable;
/**
* threshold for texture
* Creates a ribbon-like appearance.
*/
osg::ref_ptr<osg::Uniform> m_uniformThreshold;
WPropBool m_tubeRibbon;
/**
* color map for the texture
* The size. The meaning somehow relates to tubeZoomable. If a tube is zoomable, the size is the smallest size in pixels on screen of totally
* zoomed out.
*/
osg::ref_ptr<osg::Uniform> m_uniformsColorMap;
WPropDouble m_tubeSize;
/**
* vector of samplers
* Group containing tube specific properties
*/
osg::ref_ptr<osg::Uniform> m_uniformSampler;
WPropGroup m_tubeGroup;
osg::ref_ptr<osg::Uniform> m_uniformDimX; //!< x dimension of the dataset for calculating the texture coord in the shader
osg::ref_ptr<osg::Uniform> m_uniformDimY; //!< y dimension of the dataset for calculating the texture coord in the shader
osg::ref_ptr<osg::Uniform> m_uniformDimZ; //!< z dimension of the dataset for calculating the texture coord in the shader
/**
* Group containing line specific properties
*/
WPropGroup m_lineGroup;
osg::ref_ptr<osg::Uniform> m_uniformUseCullBox; //!< notify shader that cull box is activated
osg::ref_ptr<osg::Uniform> m_uniformInsideCullBox; //!< notify shader that fibers insider or outside cull box are shown
/**
* Line width.
*/
WPropDouble m_lineWidth;
/**
* Line smoothing.
*/
WPropBool m_lineSmooth;
osg::ref_ptr<osg::Uniform> m_uniformCullBoxLBX; //!< cull box lower bound
osg::ref_ptr<osg::Uniform> m_uniformCullBoxLBY; //!< cull box lower bound
osg::ref_ptr<osg::Uniform> m_uniformCullBoxLBZ; //!< cull box lower bound
osg::ref_ptr<osg::Uniform> m_uniformCullBoxUBX; //!< cull box upper bound
osg::ref_ptr<osg::Uniform> m_uniformCullBoxUBY; //!< cull box upper bound
osg::ref_ptr<osg::Uniform> m_uniformCullBoxUBZ; //!< cull box upper bound
/**
* Update the transform node to provide an cue were the plane actually is.
*
* \param node the transform node
*/
void clipPlaneCallback( osg::Node* node ) const;
/**
* Creates the clip plane with corresponding callbacks.
*
* \return the clip plane node
*/
osg::ref_ptr< osg::Node > createClipPlane() const;
osg::ref_ptr< WROIBox > m_cullBox; //!< stores a pointer to the cull box
/**
* Creates a geode containing the fiber geometry
*
* \param fibers the fiber data
* \param fibGeode the geode with the fibers as tube strip or lines
* \param endCapGeode the end cap sprites. Not used if not in tube mode.
*/
void createFiberGeode( boost::shared_ptr< WDataSetFibers > fibers, osg::ref_ptr< osg::Geode > fibGeode,
osg::ref_ptr< osg::Geode > endCapGeode );
/**
* updates the output connector with the currently selected fiber,
* this is done on demand to avoid recomputation every time the selection changes
* The plane node.
*/
void updateOutput();
osg::ref_ptr< osg::Node > m_plane;
/**
* creates and initializes the uniform parameters for the shader
* \param rootState The uniforms will be applied to this state.
* Callback for the line geode to allow interactive modification of line smooth and width states.
*
* \param state the state
*/
void initUniforms( osg::StateSet* rootState );
void lineGeodeStateCallback( osg::StateSet* state );
/**
* create a selection box to cull the fibers
* Point to a fiber selector, which is an adapter between the ROI manager and the this module
*/
void initCullBox();
boost::shared_ptr< WFiberSelector > m_fiberSelector;
/**
* Immediately update the output of the fiberDisplay on ROI change.
* Is true when received a change signal from m_fiberSelector
*/
WPropBool m_permanentUpdate;
bool m_fiberSelectorChanged;
/**
* Connection to the roi dirty signal.
......@@ -280,16 +311,12 @@ private:
* Called when updating the selection.
*/
void roiUpdate();
};
inline const std::string WMFiberDisplay::getName() const
{
return std::string( "Fiber Display" );
}
inline const std::string WMFiberDisplay::getDescription() const
{
return std::string( "Draws fibers out of a WDataSetFibers" );
}
/**
* Contains the ROI bitfield
*/
osg::ref_ptr< osg::FloatArray > m_bitfieldAttribs;
};
#endif // WMFIBERDISPLAY_H
/* XPM */
static const char * fiberdisplay2_xpm[] = {
"32 32 343 2",
" c None",
". c #164CF3",
"+ c #244DF5",
"@ c #1735F7",
"# c #1C29F8",
"$ c #121BFB",
"% c #2736F8",
"& c #1218FC",
"* c #156DE6",
"= c #2067EB",
"- c #184FF1",
"; c #2540F2",
"> c #2C2CF6",
", c #1E2DF6",
"' c #1B20FA",
") c #273CF6",
"! c #1E15FB",
"~ c #3644F5",
"{ c #212AF9",
"] c #192EF9",
"^ c #2E8FDB",
"/ c #2E76E7",
"( c #1E5AED",
"_ c #144BF2",
": c #1851EE",
"< c #3830F3",
"[ c #3C20F4",
"} c #1F16FB",
"| c #2538F7",
"1 c #211FFB",
"2 c #464CF5",
"3 c #2833F8",
"4 c #1B3EF4",
"5 c #87A6EA",
"6 c #4E7DEE",
"7 c #2296D1",
"8 c #1E97CC",
"9 c #2F7EDE",
"0 c #1B6AE6",
"a c #1B58EE",
"b c #225FEE",
"c c #2D4BEC",
"d c #3334F2",
"e c #401AF5",
"f c #1323FA",
"g c #1022FA",
"h c #2922F7",
"i c #1B23FA",
"j c #173AF5",
"k c #154BF3",
"l c #507BED",
"m c #205FED",
"n c #2A6BEA",
"o c #4DC1C5",
"p c #1FACC2",
"q c #23A7C7",
"r c #1EA5C1",
"s c #1F92CB",
"t c #2377DD",
"u c #176FE0",
"v c #2264E9",
"w c #3C59E3",
"x c #5047E4",
"y c #3F2AF0",
"z c #4012F6",
"A c #1A2AF7",
"B c #1C2FF6",
"C c #2622F8",
"D c #172BF9",
"E c #1346F2",
"F c #1F4BF3",
"G c #1F52F0",
"H c #1E4DF0",
"I c #5593E2",
"J c #2D90D6",
"K c #6BC9CB",
"L c #37BEBA",
"M c #0FAFB6",
"N c #25A3C3",
"O c #1A9CC3",
"P c #2581D5",
"Q c #1A74DF",
"R c #1B66E8",
"S c #1E56EA",
"T c #5C55DB",
"U c #4536EA",
"V c #2827F3",
"W c #1F2BF6",
"X c #1B37F6",
"Y c #192CF7",
"Z c #1839F5",
"` c #1231F8",
" . c #1B3DF5",
".. c #1B4AF0",
"+. c #4C7DE6",
"@. c #599DDB",
"#. c #3D9ED5",
"$. c #2FA3CD",
"%. c #46C7B5",
"&. c #34BAB2",
"*. c #1CAFB3",
"=. c #0EB3B3",
"-. c #2B9CC1",
";. c #318BCA",
">. c #1D7BDA",
",. c #257ED5",
"'. c #3155E2",
"). c #3927F1",
"!. c #2B41EA",
"~. c #2321F8",
"{. c #1A3AF5",
"]. c #2232F3",
"^. c #2029F7",
"/. c #1534F6",
"(. c #1A3CF4",
"_. c #1551EE",
":. c #2954ED",
"<. c #478CD7",
"[. c #4196D7",
"}. c #75B4D8",
"|. c #4B8EDE",
"1. c #24A1C9",
"2. c #2DD399",
"3. c #25CD99",
"4. c #2AC7A0",
"5. c #59C4B6",
"6. c #19ADB7",
"7. c #23B2AE",
"8. c #27A7B6",
"9. c #4496BB",
"0. c #377CD2",
"a. c #287ED1",
"b. c #2B59E1",
"c. c #3D28ED",
"d. c #3444E5",
"e. c #2E34EF",
"f. c #3A3EE9",
"g. c #4344E0",
"h. c #2445EB",
"i. c #1F55E9",
"j. c #1E4EEB",
"k. c #3667D9",
"l. c #3B84CE",
"m. c #3783D8",
"n. c #2987D7",
"o. c #5DB4CE",
"p. c #73C4D0",
"q. c #36D994",
"r. c #18DA85",
"s. c #22D28F",
"t. c #26CC97",
"u. c #2CC499",
"v. c #3EB8A1",
"w. c #1AB4AE",
"x. c #1DB2B2",
"y. c #14B0B4",
"z. c #2887D0",
"A. c #2277D8",
"B. c #345FDC",
"C. c #3C1FF0",
"D. c #1F40EC",
"E. c #212AF8",
"F. c #1933F7",
"G. c #494CDA",
"H. c #1947F0",
"I. c #1A3FF0",
"J. c #1D43F1",
"K. c #3763E8",
"L. c #53A1C6",
"M. c #45A1C7",
"N. c #45A5C9",
"O. c #7CB9D1",
"P. c #7AC3C5",
"Q. c #C8DCDD",
"R. c #7EBFD6",
"S. c #63E39E",
"T. c #82E1B5",
"U. c #50E098",
"V. c #20D887",
"W. c #20CD92",
"X. c #35C396",
"Y. c #41B99B",
"Z. c #1FB7AB",
"`. c #22AAB8",
" + c #1BA9B8",
".+ c #2381D6",
"++ c #1C6FDC",
"@+ c #2D17F9",
"#+ c #2134F0",
"$+ c #2126F8",
"%+ c #163AF5",
"&+ c #214CEB",
"*+ c #1E45EF",
"=+ c #1C39F4",
"-+ c #2A54E9",
";+ c #2A87CD",
">+ c #6A9DBB",
",+ c #5FA1C3",
"'+ c #58A7BA",
")+ c #6AACC6",
"!+ c #89C5C3",
"~+ c #C9DDD9",
"{+ c #6BBDC8",
"]+ c #2FE56B",
"^+ c #62E293",
"/+ c #5BE291",
"(+ c #3BDD7F",
"_+ c #36D880",
":+ c #3FCD82",
"<+ c #3ECA86",
"[+ c #4DBA90",
"}+ c #52AA9E",
"|+ c #3DACA8",
"1+ c #429EB1",
"2+ c #307ED2",
"3+ c #2635F3",