25 #ifndef WMCLUSTERDISPLAYVOXELS_H
26 #define WMCLUSTERDISPLAYVOXELS_H
35 #include "core/common/WHierarchicalTreeVoxels.h"
36 #include "core/dataHandler/WDataHandler.h"
37 #include "core/dataHandler/WDataSetScalar.h"
38 #include "core/dataHandler/WSubject.h"
39 #include "core/dataHandler/WValueSet.h"
40 #include "core/graphicsEngine/WGECamera.h"
41 #include "core/graphicsEngine/WGEManagedGroupNode.h"
42 #include "core/graphicsEngine/WGETexture.h"
43 #include "core/graphicsEngine/WPickHandler.h"
44 #include "core/graphicsEngine/geodes/WDendrogramGeode.h"
45 #include "core/graphicsEngine/widgets/WOSGButton.h"
46 #include "core/kernel/WModule.h"
47 #include "core/kernel/WModuleInputData.h"
48 #include "core/kernel/WModuleOutputData.h"
55 const unsigned int MASK_2D = 0xF0000000;
56 const unsigned int MASK_3D = 0x0F000000;
91 virtual const std::string
getName()
const;
105 virtual std::shared_ptr< WModule >
factory()
const;
214 std::shared_ptr< WModuleInputData< WDataSetSingle > >
m_input;
219 std::shared_ptr< WModuleOutputData< WDataSetScalar > >
m_output;
255 std::shared_ptr< WGridRegular3D >
m_grid;
404 osgWidget::WindowManager*
m_wm;
Class creates a dendrogram from a hierarchical clustering.
Class for wrapping around the OSG Camera class.
Class implements a hierarchical tree and provides helper functions for selection and navigation.
Allows one to display and interact with clustered voxel data.
std::shared_ptr< WCondition > m_propCondition
A condition used to notify about changes in several properties.
WPropBool m_propPlotHeightByLevel
controls plotting the height of a join
WPropGroup m_groupTriangulation
grouping the dendrogram manipulation properties
WPropBool m_propShowVoxelTriangulation
if true position and size sliders will have no effect
virtual const std::string getName() const
Gives back the name of this module.
std::string m_currentDisplayModeString
the currently active display mode as string
WPropGroup m_groupSelection
grouping the different selection methods
std::vector< std::shared_ptr< WTriangleMesh > > m_triMeshes
triangulation of the active clusters
WPropInt m_propSelectedLoadedPartion
property to select a loaded partition
std::shared_ptr< WItemSelection > m_buttonLabelList
A list of button labels.
void createMesh()
creates a triangulation from the selected clusters
WDendrogramGeode * m_dendrogramGeode
stores the dendrogram geode
WPropSelection m_buttonLabelSelection
Selection property for button labels.
void updateOutDataset()
update the output connector on demand, for performance reasons this is not done every time a change t...
WPropBool m_propShowSelectedButtons
show or hide outliers
size_t m_rootCluster
currently selected cluster + offset
std::vector< std::vector< size_t > > m_loadedPartitions
set partitions loaded from file
bool m_zoom
control variable for zoom mode
int m_oldViewWidth
stores the old viewport resolution to check whether a resize happened
WPropBool m_showNotInClusters
if true clusters not in the current selection list will be rendered grey in the texture and triangula...
virtual void moduleMain()
Entry point after loading the module.
WPropInt m_propDendrogramSizeY
controls the height of the dendrogram
void dendrogramClick(WPickInfo pickInfo)
listenes to the pickhandler and determines if a click into the dendrogram happened
virtual void properties()
Initialize the properties for this module.
std::shared_ptr< WDataSetScalar > m_outData
This is a pointer to the current output.
WPropTrigger m_propReadTrigger
This property triggers the actual reading,.
WPropBool m_propShowDendrogram
controls the display of the dendrogram overlay
std::shared_ptr< WModuleInputData< WDataSetSingle > > m_input
An input connector that accepts order 1 datasets.
WPropInt m_propSelectedCluster
the currently selected cluster
WPropTrigger m_buttonExecuteSelection
triggers the cluster selection update
std::vector< osg::ref_ptr< WOSGButton > > m_activeClustersButtonList
list of buttons for the active cluster selection
std::shared_ptr< WTriangleMesh > m_nonActiveMesh
triangulation of the voxels not in active clusters
WPropTrigger m_buttonUpdateOutput
updates the output connector on demand, as we don't want to do this every paint command
size_t m_zoomRoot
control variable for zoom mode
bool loadClustering(boost::filesystem::path clusterFile)
loads and parses the clustering text file
WPropInt m_propXClusters
how many levels to go down from top
WGECamera * m_camera
stores the camera object
std::shared_ptr< WItemSelection > m_clusterSelectionsList
A list of cluster selection methods.
WPropInt m_propXBiggestClusters
the currently selected cluster
int m_oldViewHeight
stores the old viewport resolution to check whether a resize happened
std::vector< WColor > m_clusterColors
stores a preset color for every cluster, so clusters can keep the same color through different select...
void updateWidgets()
updates the graphical widgets in the 3d scene
osg::ref_ptr< WGEGroupNode > m_meshNode
Pointer to the mesh group node.
osgWidget::WindowManager * m_wm
stores a pointer to the window manager used for osg wdgets and overlay stuff
void updateAll()
after the active cluster list has changed this function updates the texture, triangulation and dendro...
size_t m_colorIndex
temp variable for the initColors function
WPropInt m_propMinSizeToColor
specifies a minimum size for a cluster so that too small cluster won't get an own color
WPropInt m_propLevelsFromTop
how many levels to go down from top
WPropBool m_propResizeWithWindow
if true position and size sliders will have no effect
std::shared_ptr< WModuleOutputData< WDataSetScalar > > m_output
An output connector for the output scalar dsataset.
void setButtonLabels()
helper function to set the label on the in scene buttons depending on which labeling scheme is select...
void setPropertyBoundaries()
updates property min/max values after loading a clustering file
void initWidgets()
inits the graphical widgets in the 3d scene
WPropInt m_infoCountClusters
info property
WPropInt m_propDendrogramOffsetX
controls the horizontal origin of the dendrogram
virtual std::shared_ptr< WModule > factory() const
Due to the prototype design pattern used to build modules, this method returns a new instance of this...
WPropTrigger m_propZoomOut
zooms out, m_zoom = false, dendrogram shows the whole tree
virtual const std::string getDescription() const
Gives back a description of this module.
osg::ref_ptr< osg::Texture3D > m_texture
stores a pointer to the texture we paint in
bool m_dendrogramDirty
true if the dendrogram needs redrawing
osg::ref_ptr< WGEGroupNode > m_dendrogramNode
Pointer to the dendrogram group node.
WPropInt m_infoMaxLevel
info property
std::vector< size_t > m_data
stores a pointer to the texture we paint in
CDV_DISPLAYMODE m_currentDisplayMode
the currently active display mode
WPropFilename m_propClusterFile
The png files will be loaded form this directory.
bool m_selectionChanged
true if the selection changed and widgets need redrawing
WPropSelection m_clusterSelection
Selection property for clusters.
WHierarchicalTreeVoxels m_tree
the tree object as loaded from the file
osg::ref_ptr< WGEGroupNode > m_moduleNode
Pointer to the modules group node.
WPropTrigger m_propZoomIn
zoom into tree, sets m_zoom true and m_zoomRoot to the currently selected cluster
std::vector< osg::ref_ptr< osg::Geode > > m_outputGeodes
a vector of dendrogram nodes
virtual const char ** getXPMIcon() const
Get the icon for this module in XPM format.
WPropInt m_infoCountLeafes
info property
std::shared_ptr< WDataSetSingle > m_dataSet
This is a pointer to the dataset the module is currently working on.
virtual void connectors()
Initialize the connectors this module is using.
void handleMinSizeChanged()
function to handle user input
WPropDouble m_propMinBranchLength
minimum branch length
WPropBool m_propHideOutliers
show or hide outliers
std::vector< size_t > m_activatedClusters
stores the currently activated clusters
void createTexture()
creates a new texture
void initColors(size_t root, size_t index)
recursive function that initalizes a color for for every cluster, the biggest of the two children of ...
std::shared_ptr< WGridRegular3D > m_grid
stores a pointer to the grid we use;
WPropInt m_propDendrogramOffsetY
controls the vertical origin of the dendrogram
void renderMesh()
renders the triangulated clusters
bool widgetClicked()
handles mouse clicks into the dendrogram
WPropInt m_propDendrogramSizeX
controls the width of the dendrogram
std::shared_ptr< WDataSetScalar > m_outDataOld
Point to the out dataset once it is invalid.
WPropDouble m_propValue
the similarity value for selecting clusters
WPropInt m_propMinBranchSize
minimum branch size
WPropGroup m_groupDendrogram
grouping the dendrogram manipulation properties
Class representing a single module of OpenWalnut.
Encapsulates info for pick action.
Triangle mesh data structure allowing for convenient access of the elements.