![]() |
OpenWalnut
1.5.0dev
|
Class creates a dendrogram from a hierarchical clustering. More...
#include <WDendrogramGeode.h>
Inheritance diagram for WDendrogramGeode:
Collaboration diagram for WDendrogramGeode: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 More... | |
| ~WDendrogramGeode () | |
| destructor More... | |
| size_t | getClickedCluster (int xClick, int yClick) |
| calculate which cluster was clicked from given pixel coordinates More... | |
| bool | inDendrogramArea (const WVector2f &pos) const |
| calculates if the given position is within the view area of the dendrogram More... | |
Private Member Functions | |
| void | create () |
| helper function the starts the layout process from the input data in the constructor More... | |
| 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 More... | |
| 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 More... | |
| 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 More... | |
| 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 More... | |
Private Attributes | |
| WHierarchicalTree * | m_tree |
| the tree to work on More... | |
| size_t | m_rootCluster |
| top cluster to draw the tree from More... | |
| osg::ref_ptr< osg::Vec4Array > | m_colors |
| color array More... | |
| osg::Vec3Array * | m_vertexArray |
| vertex array More... | |
| osg::DrawElementsUInt * | m_lineArray |
| line array More... | |
| size_t | m_minClusterSize |
| minimum cluster size to be considered while laying out the dendrogram More... | |
| float | m_xSize |
| x size in pixel of the final dendrogram More... | |
| float | m_ySize |
| y size in pixel of the final dendrogram More... | |
| float | m_xOff |
| x offset More... | |
| float | m_yOff |
| y offset More... | |
| float | m_xMult |
| helper variable for the recursive function More... | |
| float | m_yMult |
| helper variable for the recursive function More... | |
| int | m_xClicked |
| stores the click position for use int he recursive function More... | |
| int | m_yClicked |
| stores the click position for use int he recursive function More... | |
| bool | m_useLevel |
| flag indicating if the level or the value of a cluster will be used for the height of join More... | |
| size_t | m_clickedCluster |
| the clicked cluster More... | |
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().
Here is the call graph for this function:| WDendrogramGeode::~WDendrogramGeode | ( | ) |
destructor
Definition at line 49 of file WDendrogramGeode.cpp.
|
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().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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().
Here is the call graph for this function:
Here is the caller graph for this function:| 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().
Referenced by WMClusterDisplay::dendrogramClick(), and WMClusterDisplayVoxels::dendrogramClick().
Here is the call graph for this function:
Here is the caller graph for this function:| bool WDendrogramGeode::inDendrogramArea | ( | const WVector2f & | pos | ) | const |
calculates if the given position is within the view area of the dendrogram
| pos | the position within the view |
Definition at line 363 of file WDendrogramGeode.cpp.
References m_xOff, m_xSize, m_yOff, and m_ySize.
Referenced by WMClusterDisplay::dendrogramClick().
Here is the caller graph for this function:
|
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().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
the clicked cluster
Definition at line 150 of file WDendrogramGeode.h.
Referenced by getClickClusterRecursive(), getClickClusterRecursive2(), and getClickedCluster().
|
private |
color array
Definition at line 130 of file WDendrogramGeode.h.
Referenced by create(), layoutLevel(), and layoutValue().
|
private |
line array
Definition at line 134 of file WDendrogramGeode.h.
Referenced by create(), layoutLevel(), and layoutValue().
|
private |
minimum cluster size to be considered while laying out the dendrogram
Definition at line 136 of file WDendrogramGeode.h.
Referenced by getClickClusterRecursive(), getClickClusterRecursive2(), layoutLevel(), and layoutValue().
|
private |
top cluster to draw the tree from
Definition at line 128 of file WDendrogramGeode.h.
Referenced by create(), and getClickedCluster().
|
private |
the tree to work on
Definition at line 126 of file WDendrogramGeode.h.
Referenced by create(), getClickClusterRecursive(), getClickClusterRecursive2(), getClickedCluster(), layoutLevel(), and layoutValue().
|
private |
flag indicating if the level or the value of a cluster will be used for the height of join
Definition at line 148 of file WDendrogramGeode.h.
Referenced by create(), and getClickedCluster().
|
private |
vertex array
Definition at line 132 of file WDendrogramGeode.h.
Referenced by create(), layoutLevel(), and layoutValue().
|
private |
stores the click position for use int he recursive function
Definition at line 145 of file WDendrogramGeode.h.
Referenced by getClickClusterRecursive(), getClickClusterRecursive2(), and getClickedCluster().
|
private |
helper variable for the recursive function
Definition at line 142 of file WDendrogramGeode.h.
Referenced by create().
|
private |
x offset
Definition at line 140 of file WDendrogramGeode.h.
Referenced by create(), getClickedCluster(), and inDendrogramArea().
|
private |
x size in pixel of the final dendrogram
Definition at line 138 of file WDendrogramGeode.h.
Referenced by create(), getClickedCluster(), and inDendrogramArea().
|
private |
stores the click position for use int he recursive function
Definition at line 146 of file WDendrogramGeode.h.
Referenced by getClickClusterRecursive(), getClickClusterRecursive2(), and getClickedCluster().
|
private |
helper variable for the recursive function
Definition at line 143 of file WDendrogramGeode.h.
Referenced by create().
|
private |
y offset
Definition at line 141 of file WDendrogramGeode.h.
Referenced by create(), getClickedCluster(), and inDendrogramArea().
|
private |
y size in pixel of the final dendrogram
Definition at line 139 of file WDendrogramGeode.h.
Referenced by create(), getClickClusterRecursive2(), getClickedCluster(), and inDendrogramArea().