OpenWalnut
1.4.0
|
Class creates a dendrogram from a hierarchical clustering. More...
#include <WDendrogramGeode.h>
Public Member Functions | |
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 | |
~WDendrogramGeode () | |
destructor | |
size_t | getClickedCluster (int xClick, int yClick) |
calculate which cluster was clicked from given pixel coordinates | |
Private Member Functions | |
void | create () |
helper function the starts the layout process from the input data in the constructor | |
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 level of the cluster | |
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 similarity value of the cluster | |
void | getClickClusterRecursive (size_t cluster, float left, float right) |
recurse function that follows the layout to determine the cluster from pixel coordinates, used when the level of the cluster is used for height | |
void | getClickClusterRecursive2 (size_t cluster, float left, float right) |
recurse function that follows the layout to determine the cluster from pixel coordinates, used when the customData value is used for height | |
Private Attributes | |
WHierarchicalTree * | m_tree |
the tree to work on | |
size_t | m_rootCluster |
top cluster to draw the tree from | |
osg::ref_ptr< osg::Vec4Array > | m_colors |
color array | |
osg::Vec3Array * | m_vertexArray |
vertex array | |
osg::DrawElementsUInt * | m_lineArray |
line array | |
size_t | m_minClusterSize |
minimum cluster size to be considered while laying out the dendrogram | |
float | m_xSize |
x size in pixel of the final dendrogram | |
float | m_ySize |
y size in pixel of the final dendrogram | |
float | m_xOff |
x offset | |
float | m_yOff |
y offset | |
float | m_xMult |
helper variable for the recursive function | |
float | m_yMult |
helper variable for the recursive function | |
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 | |
bool | m_useLevel |
flag indicating if the level or the value of a cluster will be used for the height of join | |
size_t | m_clickedCluster |
the clicked cluster |
Class creates a dendrogram from a hierarchical clustering.
Definition at line 40 of file WDendrogramGeode.h.
WDendrogramGeode::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
Class implements a dendrogram as an osg geode.
tree | reference to the tree object to work on |
cluster | root cluster for the dendrogram |
useLevel | if true the height of a node is determined by the level of the cluster |
minClusterSize | minimum for cluster to be drawn, when i the whole tree is drawn |
xSize | number of pixel to scale the tree on along the x axis |
ySize | number of pixel to scale the tree on along the y axis |
xOffset | translation alogn the x axis |
yOffset | translation alogn the y axis |
Definition at line 34 of file WDendrogramGeode.cpp.
References create().
destructor
Definition at line 49 of file WDendrogramGeode.cpp.
void WDendrogramGeode::create | ( | ) | [private] |
helper function the starts the layout process from the input data in the constructor
Definition at line 53 of file WDendrogramGeode.cpp.
References WHierarchicalTree::getLevel(), layoutLevel(), layoutValue(), m_colors, m_lineArray, m_rootCluster, m_tree, m_useLevel, m_vertexArray, m_xMult, m_xOff, m_xSize, m_yMult, m_yOff, m_ySize, and WHierarchicalTree::size().
Referenced by WDendrogramGeode().
void WDendrogramGeode::getClickClusterRecursive | ( | size_t | cluster, |
float | left, | ||
float | right | ||
) | [private] |
recurse function that follows the layout to determine the cluster from pixel coordinates, used when the level of the cluster is used for height
cluster | cluster to check against coordinates |
left | left boundary of cluster |
right | right boundary of cluster |
Definition at line 317 of file WDendrogramGeode.cpp.
References WHierarchicalTree::getChildren(), WHierarchicalTree::getLevel(), m_clickedCluster, m_minClusterSize, m_tree, m_xClicked, m_yClicked, and WHierarchicalTree::size().
Referenced by getClickedCluster().
void WDendrogramGeode::getClickClusterRecursive2 | ( | size_t | cluster, |
float | left, | ||
float | right | ||
) | [private] |
recurse function that follows the layout to determine the cluster from pixel coordinates, used when the customData value is used for height
cluster | cluster to check against coordinates |
left | left boundary of cluster |
right | right boundary of cluster |
Definition at line 271 of file WDendrogramGeode.cpp.
References WHierarchicalTree::getChildren(), WHierarchicalTree::getCustomData(), WHierarchicalTree::getLevel(), m_clickedCluster, m_minClusterSize, m_tree, m_xClicked, m_yClicked, m_ySize, and WHierarchicalTree::size().
Referenced by getClickedCluster().
size_t WDendrogramGeode::getClickedCluster | ( | int | xClick, |
int | yClick | ||
) |
calculate which cluster was clicked from given pixel coordinates
xClick | the x coordinate |
yClick | the y coordinate |
Definition at line 251 of file WDendrogramGeode.cpp.
References getClickClusterRecursive(), getClickClusterRecursive2(), WHierarchicalTree::getLevel(), m_clickedCluster, m_rootCluster, m_tree, m_useLevel, m_xClicked, m_xOff, m_xSize, m_yClicked, m_yOff, m_ySize, and WHierarchicalTree::size().
void WDendrogramGeode::layoutLevel | ( | size_t | cluster, |
float | left, | ||
float | right | ||
) | [private] |
recursive funtion that lays out the tree from top to bottom, height of the joins is determined by the level of the cluster
cluster | the current cluster to work on |
left | left border of the current subcluster |
right | right border of the current subcluster |
Definition at line 99 of file WDendrogramGeode.cpp.
References WHierarchicalTree::getChildren(), WHierarchicalTree::getColor(), WHierarchicalTree::getLevel(), m_colors, m_lineArray, m_minClusterSize, m_tree, m_vertexArray, and WHierarchicalTree::size().
Referenced by create().
void WDendrogramGeode::layoutValue | ( | size_t | cluster, |
float | left, | ||
float | right | ||
) | [private] |
recursive funtion that lays out the tree from top to bottom, height of the joins is determined by the similarity value of the cluster
cluster | the current cluster to work on |
left | left border of the current subcluster |
right | right border of the current subcluster |
Definition at line 175 of file WDendrogramGeode.cpp.
References WHierarchicalTree::getChildren(), WHierarchicalTree::getColor(), WHierarchicalTree::getCustomData(), WHierarchicalTree::getLevel(), m_colors, m_lineArray, m_minClusterSize, m_tree, m_vertexArray, and WHierarchicalTree::size().
Referenced by create().
size_t WDendrogramGeode::m_clickedCluster [private] |
the clicked cluster
Definition at line 143 of file WDendrogramGeode.h.
Referenced by getClickClusterRecursive(), getClickClusterRecursive2(), and getClickedCluster().
osg::ref_ptr<osg::Vec4Array> WDendrogramGeode::m_colors [private] |
color array
Definition at line 123 of file WDendrogramGeode.h.
Referenced by create(), layoutLevel(), and layoutValue().
osg::DrawElementsUInt* WDendrogramGeode::m_lineArray [private] |
line array
Definition at line 127 of file WDendrogramGeode.h.
Referenced by create(), layoutLevel(), and layoutValue().
size_t WDendrogramGeode::m_minClusterSize [private] |
minimum cluster size to be considered while laying out the dendrogram
Definition at line 129 of file WDendrogramGeode.h.
Referenced by getClickClusterRecursive(), getClickClusterRecursive2(), layoutLevel(), and layoutValue().
size_t WDendrogramGeode::m_rootCluster [private] |
top cluster to draw the tree from
Definition at line 121 of file WDendrogramGeode.h.
Referenced by create(), and getClickedCluster().
WHierarchicalTree* WDendrogramGeode::m_tree [private] |
the tree to work on
Definition at line 119 of file WDendrogramGeode.h.
Referenced by create(), getClickClusterRecursive(), getClickClusterRecursive2(), getClickedCluster(), layoutLevel(), and layoutValue().
bool WDendrogramGeode::m_useLevel [private] |
flag indicating if the level or the value of a cluster will be used for the height of join
Definition at line 141 of file WDendrogramGeode.h.
Referenced by create(), and getClickedCluster().
osg::Vec3Array* WDendrogramGeode::m_vertexArray [private] |
vertex array
Definition at line 125 of file WDendrogramGeode.h.
Referenced by create(), layoutLevel(), and layoutValue().
int WDendrogramGeode::m_xClicked [private] |
stores the click position for use int he recursive function
Definition at line 138 of file WDendrogramGeode.h.
Referenced by getClickClusterRecursive(), getClickClusterRecursive2(), and getClickedCluster().
float WDendrogramGeode::m_xMult [private] |
helper variable for the recursive function
Definition at line 135 of file WDendrogramGeode.h.
Referenced by create().
float WDendrogramGeode::m_xOff [private] |
x offset
Definition at line 133 of file WDendrogramGeode.h.
Referenced by create(), and getClickedCluster().
float WDendrogramGeode::m_xSize [private] |
x size in pixel of the final dendrogram
Definition at line 131 of file WDendrogramGeode.h.
Referenced by create(), and getClickedCluster().
int WDendrogramGeode::m_yClicked [private] |
stores the click position for use int he recursive function
Definition at line 139 of file WDendrogramGeode.h.
Referenced by getClickClusterRecursive(), getClickClusterRecursive2(), and getClickedCluster().
float WDendrogramGeode::m_yMult [private] |
helper variable for the recursive function
Definition at line 136 of file WDendrogramGeode.h.
Referenced by create().
float WDendrogramGeode::m_yOff [private] |
y offset
Definition at line 134 of file WDendrogramGeode.h.
Referenced by create(), and getClickedCluster().
float WDendrogramGeode::m_ySize [private] |
y size in pixel of the final dendrogram
Definition at line 132 of file WDendrogramGeode.h.
Referenced by create(), getClickClusterRecursive2(), and getClickedCluster().