25 #ifndef WDENDROGRAMGEODE_H
26 #define WDENDROGRAMGEODE_H
30 #include <osg/Geometry>
31 #include <osg/MatrixTransform>
32 #include <osg/PositionAttitudeTransform>
34 #include "core/common/math/linearAlgebra/WVectorFixed.h"
35 #include "core/common/WHierarchicalTreeFibers.h"
57 float ySize = 500.f,
float xOffset = 0.0f,
float yOffset = 0.0f );
93 void layoutLevel(
size_t cluster,
float left,
float right );
102 void layoutValue(
size_t cluster,
float left,
float right );
Class creates a dendrogram from a hierarchical clustering.
bool m_useLevel
flag indicating if the level or the value of a cluster will be used for the height of join
void getClickClusterRecursive(size_t cluster, float left, float right)
recurse function that follows the layout to determine the cluster from pixel coordinates,...
size_t getClickedCluster(int xClick, int yClick)
calculate which cluster was clicked from given pixel coordinates
int m_xClicked
stores the click position for use int he recursive function
int m_yClicked
stores the click position for use int he recursive function
size_t m_rootCluster
top cluster to draw the tree from
float m_xMult
helper variable for the recursive function
osg::ref_ptr< osg::Vec4Array > m_colors
color array
WHierarchicalTree * m_tree
the tree to work on
float m_ySize
y size in pixel of the final dendrogram
void layoutValue(size_t cluster, float left, float right)
recursive funtion that lays out the tree from top to bottom, height of the joins is determined by the...
bool inDendrogramArea(const WVector2f &pos) const
calculates if the given position is within the view area of the dendrogram
~WDendrogramGeode()
destructor
WDendrogramGeode(WHierarchicalTree *tree, size_t cluster, bool useLevel=true, size_t minClusterSize=1, float xSize=1000.f, float ySize=500.f, float xOffset=0.0f, float yOffset=0.0f)
constructor
osg::DrawElementsUInt * m_lineArray
line array
size_t m_minClusterSize
minimum cluster size to be considered while laying out the dendrogram
size_t m_clickedCluster
the clicked cluster
float m_yMult
helper variable for the recursive function
void layoutLevel(size_t cluster, float left, float right)
recursive funtion that lays out the tree from top to bottom, height of the joins is determined by the...
osg::Vec3Array * m_vertexArray
vertex array
void create()
helper function the starts the layout process from the input data in the constructor
float m_xSize
x size in pixel of the final dendrogram
void getClickClusterRecursive2(size_t cluster, float left, float right)
recurse function that follows the layout to determine the cluster from pixel coordinates,...
base class for hierarchical tree implementations
A fixed size matrix class.