49 #ifndef WNONBINDENDROGEODE_H
50 #define WNONBINDENDROGEODE_H
56 #include <osg/Geometry>
57 #include <osg/MatrixTransform>
58 #include <osg/PositionAttitudeTransform>
60 #include "core/common/WColor.h"
82 WNonBinDendroGeode(
const WHtree& tree,
const std::vector< WColor > &displayColors,
size_t cluster,
float xSize,
float ySize,
83 float xOffset,
float yOffset,
bool useHLevel =
false,
bool triangleLeaves =
false,
float hozLine = 0 );
120 void layout(
const WHnode& cluster,
const float leftLimit,
const float rightLimit );
this class implements a hierarchical tree node with several relevant attributes
this class implements a hierarchical tree and provides functions for creation, partitioning,...
Class creates a dendrogram from a hierarchical clustering, and allows to click and select specific no...
float m_yUnit
helper variable for y position in the node selection recursive function
float m_xOff
x offset for dendrogram drawing in the screen
bool m_useHLevel
flag indicating if the level or the value of a cluster will be used for the height of join
const std::vector< WColor > & m_displayColors
stores a the current colors each node should be displayed, given the current selection
const WHtree m_tree
the tree to work on
bool inDendrogramArea(int xClick, int yClick) const
calculates if the given position is within the view area of the dendrogram
~WNonBinDendroGeode()
destructor
void layout(const WHnode &cluster, const float leftLimit, const float rightLimit)
recursive function that lays out the tree from top to bottom, height of the joins is determined by th...
bool m_triangleLeaves
option to join leaves with straight lines, giving a triangle appearance to the bottom level
void create()
helper function the starts the layout process from the input data in the constructor
size_t m_clickedCluster
ID of the clicked cluster.
float m_xClicked
stores the click x position for use in the node selection recursive function
size_t getClickedCluster(int xClick, int yClick)
calculate which cluster was clicked from given pixel coordinates
float m_hozLine
determines if a horizontal line will be drawn to indicate aprtition level
WNonBinDendroGeode(const WHtree &tree, const std::vector< WColor > &displayColors, size_t cluster, float xSize, float ySize, float xOffset, float yOffset, bool useHLevel=false, bool triangleLeaves=false, float hozLine=0)
constructor
float m_yOff
y offset for dendrogram drawing in the screen
float m_yClicked
stores the click y position for use in the node selection recursive function
size_t m_rootCluster
top cluster to draw the tree from
float m_xUnit
helper variable for x position in the node selection recursive function
osg::Vec3Array * m_vertexArray
vertex array
float m_ySize
y size in pixel of the final dendrogram
osg::ref_ptr< osg::Vec4Array > m_lineColors
stores a the colors of each line that should be drawn
float m_xSize
x size in pixel of the final dendrogram
void findClickedCluster(size_t cluster, float leftLimit, float rightLimit)
recurse function that follows the layout to determine the cluster from pixel coordinates
osg::DrawElementsUInt * m_lineArray
line array