Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
4e2b4077
Commit
4e2b4077
authored
Sep 01, 2010
by
schurade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CHANGE] mode for thinning out the dendrogram
parent
529b9096
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
7 deletions
+27
-7
src/modules/clusterDisplay/WDendrogram.cpp
src/modules/clusterDisplay/WDendrogram.cpp
+4
-3
src/modules/clusterDisplay/WDendrogram.h
src/modules/clusterDisplay/WDendrogram.h
+4
-1
src/modules/clusterDisplay/WMClusterDisplay.cpp
src/modules/clusterDisplay/WMClusterDisplay.cpp
+13
-3
src/modules/clusterDisplay/WMClusterDisplay.h
src/modules/clusterDisplay/WMClusterDisplay.h
+6
-0
No files found.
src/modules/clusterDisplay/WDendrogram.cpp
View file @
4e2b4077
...
...
@@ -30,10 +30,11 @@
/**
* Class implements a dendrogram as an osg geode
*/
WDendrogram
::
WDendrogram
(
WHierarchicalTree
*
tree
,
size_t
cluster
,
float
xSize
,
float
ySize
,
float
xOffset
,
float
yOffset
)
:
WDendrogram
::
WDendrogram
(
WHierarchicalTree
*
tree
,
size_t
cluster
,
size_t
minClusterSize
,
float
xSize
,
float
ySize
,
float
xOffset
,
float
yOffset
)
:
osg
::
Geode
(),
m_tree
(
tree
),
m_rootCluster
(
cluster
),
m_minClusterSize
(
minClusterSize
),
m_xSize
(
xSize
),
m_ySize
(
ySize
),
m_xOff
(
xOffset
),
...
...
@@ -99,7 +100,7 @@ void WDendrogram::layout( size_t cluster, float left, float right )
float
rightHeight
=
m_tree
->
getLevel
(
rightCluster
);
float
rightSize
=
static_cast
<
float
>
(
m_tree
->
size
(
rightCluster
)
);
if
(
(
leftSize
/
rightSize
)
>
100.
)
if
(
(
leftSize
>=
m_minClusterSize
)
&&
(
rightSize
<
m_minClusterSize
)
)
//if ( rightSize < 2 )
{
// left cluster is much bigger, draw only left
...
...
@@ -114,7 +115,7 @@ void WDendrogram::layout( size_t cluster, float left, float right )
layout
(
leftCluster
,
left
,
right
);
}
else
if
(
(
rightSize
/
leftSize
)
>
100.
)
else
if
(
(
rightSize
>=
m_minClusterSize
)
&&
(
leftSize
<
m_minClusterSize
)
)
//else if ( leftSize < 2 )
{
// right cluster is much bigger, draw only right
...
...
src/modules/clusterDisplay/WDendrogram.h
View file @
4e2b4077
...
...
@@ -44,13 +44,14 @@ public:
*
* \param tree reference to the tree object to work on
* \param cluster root cluster for the dendrogram
* \param minClusterSize minimum for cluster to be drawn, when i the whole tree is drawn
* \param xSize number of pixel to scale the tree on along the x axis
* \param ySize number of pixel to scale the tree on along the y axis
* \param xOffset translation alogn the x axis
* \param yOffset translation alogn the y axis
*
*/
WDendrogram
(
WHierarchicalTree
*
tree
,
size_t
cluster
,
float
xSize
=
1000.
f
,
float
ySize
=
500.
f
,
float
xOffset
=
0.0
f
,
float
yOffset
=
0.0
f
);
WDendrogram
(
WHierarchicalTree
*
tree
,
size_t
cluster
,
size_t
minClusterSize
=
1
,
float
xSize
=
1000.
f
,
float
ySize
=
500.
f
,
float
xOffset
=
0.0
f
,
float
yOffset
=
0.0
f
);
/**
* destructor
...
...
@@ -83,6 +84,8 @@ private:
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
...
...
src/modules/clusterDisplay/WMClusterDisplay.cpp
View file @
4e2b4077
...
...
@@ -395,11 +395,16 @@ void WMClusterDisplay::moduleMain()
handleBiggestClustersChanged
();
}
if
(
m_propSubLevelsToColor
->
changed
()
||
m_propMinSizeToColor
->
changed
()
)
if
(
m_propSubLevelsToColor
->
changed
()
)
{
handleColoringChanged
();
}
if
(
m_propMinSizeToColor
->
changed
()
)
{
handleMinSizeChanged
();
}
if
(
m_propBoxClusterRatio
->
changed
()
||
m_propMaxSubClusters
->
changed
()
)
{
handleRoiChanged
();
...
...
@@ -434,7 +439,7 @@ void WMClusterDisplay::handleSelectedClusterChanged()
WKernel
::
getRunningKernel
()
->
getRoiManager
()
->
setExternalBitfield
(
m_tree
.
getOutputBitfield
(
m_rootCluster
)
);
m_propSubLevelsToColor
->
setMax
(
m_tree
.
getLevel
(
m_rootCluster
)
);
colorClusters
(
m_propSelectedCluster
->
get
(
true
)
);
m_dendrogramDirty
=
true
;
}
...
...
@@ -516,6 +521,11 @@ void WMClusterDisplay::handleColoringChanged()
m_dendrogramDirty
=
true
;
}
void
WMClusterDisplay
::
handleMinSizeChanged
()
{
m_dendrogramDirty
=
true
;
}
void
WMClusterDisplay
::
handleRoiChanged
()
{
if
(
m_active
->
get
()
)
...
...
@@ -642,7 +652,7 @@ void WMClusterDisplay::updateWidgets()
if
(
m_propShowDendrogram
->
get
(
true
)
)
{
m_dendrogramGeode
=
new
WDendrogram
(
&
m_tree
,
m_rootCluster
,
width
-
120
,
height
/
2
,
100
);
m_dendrogramGeode
=
new
WDendrogram
(
&
m_tree
,
m_rootCluster
,
m_propMinSizeToColor
->
get
(),
width
-
120
,
height
/
2
,
100
);
m_camera
->
addChild
(
m_dendrogramGeode
);
}
m_dendrogramDirty
=
false
;
...
...
src/modules/clusterDisplay/WMClusterDisplay.h
View file @
4e2b4077
...
...
@@ -174,6 +174,12 @@ private:
*/
void
handleColoringChanged
();
/**
* function to handle user input
*/
void
handleMinSizeChanged
();
/**
* function to handle user input
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment