25 #ifndef WMCLUSTERDISPLAY_H
26 #define WMCLUSTERDISPLAY_H
33 #include <osgGA/GUIEventAdapter>
34 #include <osgGA/GUIEventHandler>
36 #include "core/common/WHierarchicalTreeFibers.h"
37 #include "core/graphicsEngine/WFiberDrawable.h"
38 #include "core/graphicsEngine/WGECamera.h"
39 #include "core/graphicsEngine/WGEManagedGroupNode.h"
40 #include "core/graphicsEngine/geodes/WDendrogramGeode.h"
41 #include "core/graphicsEngine/widgets/WOSGButton.h"
42 #include "core/kernel/WFiberSelector.h"
43 #include "core/kernel/WModule.h"
44 #include "core/kernel/WModuleInputData.h"
45 #include "core/kernel/WModuleOutputData.h"
47 const unsigned int MASK_2D = 0xF0000000;
48 const unsigned int MASK_3D = 0x0F000000;
72 virtual const std::string
getName()
const;
86 virtual std::shared_ptr< WModule >
factory()
const;
130 bool handle(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& );
151 std::vector< std::string >
readFile(
const std::string fileName );
188 void setColor( std::vector<size_t> clusters, WColor color );
254 std::shared_ptr< WModuleInputData< const WDataSetFibers > >
m_fiberInput;
364 osgWidget::WindowManager*
m_wm;
Class creates a dendrogram from a hierarchical clustering.
Class for wrapping around the OSG Camera class.
Class implements a hierarchical tree and provides helper functions for selection and navigation.
Small event handler class to catch left mouse buttons clicks in the main view.
bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &)
The OSG calls this function whenever a new event has occured.
void subscribeLeftButtonPush(LeftButtonPushSignalType::slot_type slot)
Registers a function slot to LEFT BUTTON PUSH events.
LeftButtonPushSignalType m_signalLeftButtonPush
Signal used for notification of the LEFT BUTTON PUSH event.
boost::signals2::signal< bool(WVector2f) > LeftButtonPushSignalType
Signal for handling left button signals.
Module offers several fiber selection and coloring options depending on a hierarchical clustering.
std::shared_ptr< WFiberSelector > m_fiberSelector
Point to a fiber selector, which is an adapater between the roi manager and the this module.
bool dendrogramClick(const WVector2f &pos)
handles clicks into the dendrogram
void colorClusters(size_t current)
colors subclusters depending on slider settings
osgWidget::WindowManager * m_wm
stores a pointer to the window manager used for osg wdgets and overlay stuff
bool m_widgetDirty
true if the widgets need redrawing
WDendrogramGeode * m_dendrogramGeode
stores the dendrogram geode
bool m_biggestClusterButtonsChanged
true if the buttons for the biggest clusters need updating
WMClusterDisplay()
constructor
WPropInt m_propMinSizeToColor
specifies a minimum size for a cluster so that too small cluster won't get an own color
WPropBool m_propShowTree
controls the display of the tree navigation widget
WPropInt m_propDendrogramOffsetX
controls the horizontal origin of the dendrogram
std::vector< std::string > readFile(const std::string fileName)
helper function to read a text file
std::vector< size_t > m_biggestClusters
stores the currently selected biggest clusters
WPropInt m_propSelectedCluster
the currently selected cluster
WPropFilename m_propTreeFile
The tree will be read from this file, i hope we will get a real load button some time.
WPropBool m_propShowDendrogram
controls the display of the dendrogram overlay
void handleMinSizeChanged()
function to handle user input
WPropGroup m_groupDendrogram
grouping the dendrogram manipulation properties
void handleOffsetChanged()
function to handle user input
virtual const std::string getName() const
Gives back the name of this module.
void updateWidgets()
updates all the overlay widgets within the osg thread
int m_oldViewWidth
stores the old viewport resolution to check whether a resize happened
std::shared_ptr< const WDataSetFibers > m_dataSet
pointer to dataSet to be able to access it throughout the whole module.
osg::ref_ptr< WGEManagedGroupNode > m_rootNode
The root node used for this modules graphics.
WPropTrigger m_readTriggerProp
This property triggers the actual reading,.
bool m_dendrogramDirty
true if the dendrogram needs redrawing
void initWidgets()
inits the cluster navigation widgets
WGECamera * m_camera
stores the camera object
virtual const std::string getDescription() const
Gives back a description of this module.
size_t m_labelMode
indicates wheter the cluster number, size of custom data should be shown on labels
void createFiberGeode()
helper function to initialize a fiber display node
WPropDouble m_propBoxClusterRatio
ratio of how many leafes of a cluster must be inside the roi setting to be considered
WPropBool m_propResizeWithWindow
if true position and size sliders will have no effect
void handleSelectedLevelChanged()
function to handle user input
WPropInt m_propSubClusters
number of biggest sub cluster to determine and show
void handleColoringChanged()
function to handle user input
bool loadTreeAscii(std::string fileName)
helper function to load and parse a tree file, the tree is stored in the member variable m_tree
virtual ~WMClusterDisplay()
destructor
std::shared_ptr< WModuleInputData< const WDataSetFibers > > m_fiberInput
Input connector for a fiber dataset.
void handleCreateRoi()
function to handle user input
virtual void moduleMain()
Entry point after loading the module.
WPropInt m_propSelectedClusterOffset
offset to the currently selected cluster, this allows tree navigation and return to the current clust...
std::vector< osg::ref_ptr< WOSGButton > > m_treeButtonList
list of buttons for the tree widget
virtual void connectors()
Initialize the connectors this module is using.
size_t m_rootCluster
currently selected cluster + offset
std::shared_ptr< WCondition > m_propCondition
A condition used to notify about changes in several properties.
WPropInt m_propDendrogramOffsetY
controls the vertical origin of the dendrogram
int m_oldViewHeight
stores the old viewport resolution to check whether a resize happened
void handleSelectedClusterChanged()
function to handle user input
void handleRoiChanged()
function to handle user input
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...
WPropInt m_propSubLevelsToColor
number of subclusters to color differently
std::string createLabel(size_t id)
creates a label depending ont he current labeling setting
osg::ref_ptr< WFiberDrawable > m_fiberDrawable
stores pointer to the fiber drawer
virtual const char ** getXPMIcon() const
Get the icon for this module in XPM format.
void handleBiggestClustersChanged()
function to handle user input
void setColor(std::vector< size_t > clusters, WColor color)
sets a set of cluster to a single color
std::vector< osg::ref_ptr< WOSGButton > > m_biggestClustersButtonList
list of buttons for biggest cluster selection
WPropInt m_propDendrogramSizeY
controls the height of the dendrogram
virtual void properties()
Initialize the properties for this module.
WPropInt m_propDendrogramSizeX
controls the width of the dendrogram
WHierarchicalTreeFibers m_tree
stores the tree object
bool widgetClicked()
function checks all on screen buttons if they have been clicked
WPropInt m_propMaxSubClusters
number of clusters that are selected by the current roi setting and meet the ratio condition
A fixed size matrix class.
Class representing a single module of OpenWalnut.