OpenWalnut  1.5.0dev
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
WMClusterDisplayVoxels Class Reference

Allows one to display and interact with clustered voxel data. More...

#include <WMClusterDisplayVoxels.h>

+ Inheritance diagram for WMClusterDisplayVoxels:
+ Collaboration diagram for WMClusterDisplayVoxels:

Public Member Functions

virtual const std::string getName () const
 Gives back the name of this module. More...
 
virtual const std::string getDescription () const
 Gives back a description of this module. More...
 
virtual std::shared_ptr< WModulefactory () const
 Due to the prototype design pattern used to build modules, this method returns a new instance of this method. More...
 
virtual const char ** getXPMIcon () const
 Get the icon for this module in XPM format. More...
 
- Public Member Functions inherited from WModule
 WModule ()
 Constructs a new WModule instance. More...
 
virtual ~WModule ()
 Destructor. More...
 
const InputConnectorListgetInputConnectors () const
 Gives back input connectors. More...
 
std::shared_ptr< WModuleInputConnectorgetInputConnector (std::string name)
 Finds the named connector for the module. More...
 
std::shared_ptr< WModuleInputConnectorfindInputConnector (std::string name)
 Finds the named connector for the module. More...
 
const OutputConnectorListgetOutputConnectors () const
 Gives back output connectors. More...
 
std::shared_ptr< WModuleOutputConnectorgetOutputConnector (std::string name)
 Finds the named connector for the module. More...
 
std::shared_ptr< WModuleOutputConnectorfindOutputConnector (std::string name)
 Finds the named connector for the module. More...
 
std::shared_ptr< WModuleConnectorgetConnector (std::string name)
 Finds the named connector for the module. More...
 
std::shared_ptr< WModuleConnectorfindConnector (std::string name)
 Finds the named connector for the module. More...
 
std::shared_ptr< WPropertiesgetProperties () const
 Return a pointer to the properties object of the module. More...
 
std::shared_ptr< WPropertiesgetInformationProperties () const
 Return a pointer to the information properties object of the module. More...
 
const WBoolFlagisInitialized () const
 Determines whether the module instance is properly initialized. More...
 
const WBoolFlagisUseable () const
 Checks whether the module instance is ready to be used. More...
 
const WBoolFlagisAssociated () const
 Checks whether this module is associated with an container. More...
 
const WBoolFlagisReady () const
 Checks whether this module is ready. More...
 
const WBoolFlagisReadyOrCrashed () const
 This is the logical or of isReady and isCrashed. More...
 
const WBoolFlagisRunning () const
 Returns a flag denoting whether the thread currently is running or nor. More...
 
void waitRestored ()
 This method waits for the module to be restored completely. More...
 
bool isRestoreNeeded () const
 Check whether this module is in restore mode. More...
 
void setRestoreNeeded (bool restore=true)
 Change the restore mode. More...
 
void reportRestoreComplete ()
 Called by loaders to tell the module that loading has been completed. More...
 
std::shared_ptr< WModuleContainergetAssociatedContainer () const
 The container this module is associated with. More...
 
virtual boost::signals2::connection subscribeSignal (MODULE_SIGNAL signal, t_ModuleGenericSignalHandlerType notifier)
 Connects a specified notify function with a signal this module instance is offering. More...
 
virtual boost::signals2::connection subscribeSignal (MODULE_SIGNAL signal, t_ModuleErrorSignalHandlerType notifier)
 Connects a specified notify function with a signal this module instance is offering. More...
 
virtual std::shared_ptr< WProgressCombinergetRootProgressCombiner ()
 Gets the modules base progress. More...
 
virtual MODULE_TYPE getType () const
 Gets the type of the module. More...
 
void disconnect ()
 Completely disconnects all connected connectors of this module. More...
 
WCombinerTypes::WDisconnectList getPossibleDisconnections ()
 Gives a list of all WDisconnectCombiners possible. More...
 
boost::filesystem::path getLocalPath () const
 Returns the local path of the module. More...
 
boost::filesystem::path getLibPath () const
 Returns the absolute path to the library containing this module. More...
 
std::string getPackageName () const
 Returns the name of the package the module belongs to, The package name basically is the name of the library containing this and maybe other modules. More...
 
bool isDeprecated () const
 Checks whether the module was marked as deprecated. More...
 
std::string getDeprecationMessage () const
 Queries the deprecation message of a module if specified. More...
 
virtual WModuleMetaInformation::ConstSPtr getMetaInformation () const
 The meta information of this module. More...
 
const std::string & getUUID () const
 Get the UUID of the module instance. More...
 
WPropString getRuntimeName () const
 Returns the name the user has given this module. More...
 
const WRequirementcheckRequirements () const
 This method checks whether all the requirements of the module are complied. More...
 
virtual boost::signals2::connection subscribeSignal (THREAD_SIGNAL signal, t_ThreadErrorSignalHandlerType notifier)
 Connects a specified notify function with a signal this thread instance is offering. More...
 
- Public Member Functions inherited from WThreadedRunner
 WThreadedRunner ()
 Default constructor. More...
 
virtual ~WThreadedRunner ()
 Destructor. More...
 
virtual void run ()
 Run thread. More...
 
void run (THREADFUNCTION f)
 Run thread. More...
 
void wait (bool requestFinish=false)
 Wait for the thread to be finished. More...
 
virtual void requestStop ()
 This method's purpose is to request a stop without waiting for it. More...
 
virtual boost::signals2::connection subscribeSignal (THREAD_SIGNAL signal, t_ThreadErrorSignalHandlerType notifier)
 Connects a specified notify function with a signal this thread instance is offering. More...
 
const WBoolFlagisCrashed () const
 Checks whether this thread has been crashed. More...
 
const std::string & getCrashMessage () const
 Get the message of the exception finally causing the crash. More...
 
void setThreadName (std::string name)
 Set the name of the thread. More...
 
std::string getThreadName () const
 Returns the current thread name. More...
 
- Public Member Functions inherited from WPrototyped
 WPrototyped ()
 Default constructor. More...
 
virtual ~WPrototyped ()
 Destructor. More...
 
template<typename T >
bool isA ()
 Checks whether the actual prototype has the specified runtime type. More...
 

Protected Member Functions

virtual void moduleMain ()
 Entry point after loading the module. More...
 
virtual void connectors ()
 Initialize the connectors this module is using. More...
 
virtual void properties ()
 Initialize the properties for this module. More...
 
- Protected Member Functions inherited from WModule
void threadMain ()
 Thread entry point. More...
 
virtual void onThreadException (const WException &e)
 This method is called if an exception was caught, which came from the custom thread code. More...
 
void setAssociatedContainer (std::shared_ptr< WModuleContainer > container)
 Sets the container this module is associated with. More...
 
virtual void requirements ()
 Initialize requirements in this function. More...
 
virtual std::string deprecated () const
 This function allows module programmers to mark their modules deprecated in a user-friendly way. More...
 
void initialize ()
 Manages initialization. More...
 
virtual void cleanup ()
 Called whenever the module should shutdown. More...
 
void addConnector (std::shared_ptr< WModuleInputConnector > con)
 Adds the specified connector to the list of inputs. More...
 
void addConnector (std::shared_ptr< WModuleOutputConnector > con)
 Adds the specified connector to the list of outputs. More...
 
void removeConnectors ()
 Removes all connectors properly. More...
 
virtual void activate ()
 Callback for m_active. More...
 
virtual const t_GenericSignalHandlerType getSignalHandler (MODULE_CONNECTOR_SIGNAL signal)
 Gives the signal handler function responsible for a given signal. More...
 
virtual void notifyConnectionEstablished (std::shared_ptr< WModuleConnector > here, std::shared_ptr< WModuleConnector > there)
 Gets called whenever a connector gets connected to the specified input. More...
 
virtual void notifyConnectionClosed (std::shared_ptr< WModuleConnector > here, std::shared_ptr< WModuleConnector > there)
 Gets called whenever a connection between a remote and local connector gets closed. More...
 
virtual void notifyDataChange (std::shared_ptr< WModuleConnector > input, std::shared_ptr< WModuleConnector > output)
 Gets called when the data on one input connector changed. More...
 
void ready ()
 Call this whenever your module is ready and can react on property changes. More...
 
wlog::WStreamedLogger infoLog () const
 Logger instance for comfortable info logging. More...
 
wlog::WStreamedLogger debugLog () const
 Logger instance for comfortable debug logging. More...
 
wlog::WStreamedLogger warnLog () const
 Logger instance for comfortable warning- logs. More...
 
wlog::WStreamedLogger errorLog () const
 Logger instance for comfortable error logging. More...
 
void setLocalPath (boost::filesystem::path path)
 Sets the local module path. More...
 
void setLibPath (boost::filesystem::path path)
 Set the path to the library which contains this module. More...
 
void setPackageName (std::string name)
 Set the package name. More...
 
- Protected Member Functions inherited from WThreadedRunner
virtual void notifyStop ()
 Gets called when the thread should be stopped. More...
 
void yield () const
 Give remaining execution timeslice to another thread. More...
 
void sleep (const int32_t t) const
 Sets thread asleep. More...
 
void msleep (const int32_t t) const
 Sets thread asleep. More...
 
void waitForStop ()
 Let the thread sleep until a stop request was given. More...
 
void handleDeadlyException (const WException &e, std::string sender="WThreadedRunner")
 Handle the specified exception which was not caught in the thread, which basically means the thread has crashed. More...
 

Private Member Functions

bool loadClustering (boost::filesystem::path clusterFile)
 loads and parses the clustering text file More...
 
void createTexture ()
 creates a new texture More...
 
void handleMinSizeChanged ()
 function to handle user input More...
 
void updateAll ()
 after the active cluster list has changed this function updates the texture, triangulation and dendrogram More...
 
void createMesh ()
 creates a triangulation from the selected clusters More...
 
void renderMesh ()
 renders the triangulated clusters More...
 
void initWidgets ()
 inits the graphical widgets in the 3d scene More...
 
void updateWidgets ()
 updates the graphical widgets in the 3d scene More...
 
bool widgetClicked ()
 handles mouse clicks into the dendrogram More...
 
void setPropertyBoundaries ()
 updates property min/max values after loading a clustering file More...
 
void dendrogramClick (WPickInfo pickInfo)
 listenes to the pickhandler and determines if a click into the dendrogram happened More...
 
void updateOutDataset ()
 update the output connector on demand, for performance reasons this is not done every time a change to the cluster selection is applied More...
 
void setButtonLabels ()
 helper function to set the label on the in scene buttons depending on which labeling scheme is selected More...
 
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 a cluster inherits the color for its parent More...
 

Private Attributes

std::shared_ptr< WModuleInputData< WDataSetSingle > > m_input
 An input connector that accepts order 1 datasets. More...
 
std::shared_ptr< WModuleOutputData< WDataSetScalar > > m_output
 An output connector for the output scalar dsataset. More...
 
std::shared_ptr< WDataSetSinglem_dataSet
 This is a pointer to the dataset the module is currently working on. More...
 
std::shared_ptr< WDataSetScalarm_outDataOld
 Point to the out dataset once it is invalid. More...
 
std::shared_ptr< WDataSetScalarm_outData
 This is a pointer to the current output. More...
 
osg::ref_ptr< osg::Texture3D > m_texture
 stores a pointer to the texture we paint in More...
 
std::vector< size_t > m_data
 stores a pointer to the texture we paint in More...
 
std::shared_ptr< WGridRegular3Dm_grid
 stores a pointer to the grid we use; More...
 
CDV_DISPLAYMODE m_currentDisplayMode
 the currently active display mode More...
 
std::string m_currentDisplayModeString
 the currently active display mode as string More...
 
std::shared_ptr< WConditionm_propCondition
 A condition used to notify about changes in several properties. More...
 
WPropTrigger m_propReadTrigger
 This property triggers the actual reading,. More...
 
WPropFilename m_propClusterFile
 The png files will be loaded form this directory. More...
 
WPropInt m_propSelectedCluster
 the currently selected cluster More...
 
WPropInt m_propXBiggestClusters
 the currently selected cluster More...
 
WPropDouble m_propValue
 the similarity value for selecting clusters More...
 
WPropInt m_propSelectedLoadedPartion
 property to select a loaded partition More...
 
WPropInt m_propLevelsFromTop
 how many levels to go down from top More...
 
WPropInt m_propXClusters
 how many levels to go down from top More...
 
WPropDouble m_propMinBranchLength
 minimum branch length More...
 
WPropInt m_propMinBranchSize
 minimum branch size More...
 
WPropBool m_propHideOutliers
 show or hide outliers More...
 
WPropBool m_propShowSelectedButtons
 show or hide outliers More...
 
WPropInt m_propMinSizeToColor
 specifies a minimum size for a cluster so that too small cluster won't get an own color More...
 
WPropGroup m_groupSelection
 grouping the different selection methods More...
 
WPropGroup m_groupDendrogram
 grouping the dendrogram manipulation properties More...
 
WPropGroup m_groupTriangulation
 grouping the dendrogram manipulation properties More...
 
WPropBool m_propShowDendrogram
 controls the display of the dendrogram overlay More...
 
WPropBool m_propPlotHeightByLevel
 controls plotting the height of a join More...
 
WPropBool m_propResizeWithWindow
 if true position and size sliders will have no effect More...
 
WPropTrigger m_propZoomIn
 zoom into tree, sets m_zoom true and m_zoomRoot to the currently selected cluster More...
 
WPropTrigger m_propZoomOut
 zooms out, m_zoom = false, dendrogram shows the whole tree More...
 
size_t m_zoomRoot
 control variable for zoom mode More...
 
bool m_zoom
 control variable for zoom mode More...
 
WPropInt m_propDendrogramSizeX
 controls the width of the dendrogram More...
 
WPropInt m_propDendrogramSizeY
 controls the height of the dendrogram More...
 
WPropInt m_propDendrogramOffsetX
 controls the horizontal origin of the dendrogram More...
 
WPropInt m_propDendrogramOffsetY
 controls the vertical origin of the dendrogram More...
 
WPropBool m_propShowVoxelTriangulation
 if true position and size sliders will have no effect More...
 
WPropBool m_showNotInClusters
 if true clusters not in the current selection list will be rendered grey in the texture and triangulation More...
 
WHierarchicalTreeVoxels m_tree
 the tree object as loaded from the file More...
 
osg::ref_ptr< WGEGroupNodem_moduleNode
 Pointer to the modules group node. More...
 
osg::ref_ptr< WGEGroupNodem_dendrogramNode
 Pointer to the dendrogram group node. More...
 
osg::ref_ptr< WGEGroupNodem_meshNode
 Pointer to the mesh group node. More...
 
std::vector< osg::ref_ptr< osg::Geode > > m_outputGeodes
 a vector of dendrogram nodes More...
 
std::vector< std::shared_ptr< WTriangleMesh > > m_triMeshes
 triangulation of the active clusters More...
 
std::shared_ptr< WTriangleMeshm_nonActiveMesh
 triangulation of the voxels not in active clusters More...
 
std::vector< size_t > m_activatedClusters
 stores the currently activated clusters More...
 
std::vector< osg::ref_ptr< WOSGButton > > m_activeClustersButtonList
 list of buttons for the active cluster selection More...
 
WGECameram_camera
 stores the camera object More...
 
WDendrogramGeodem_dendrogramGeode
 stores the dendrogram geode More...
 
osgWidget::WindowManager * m_wm
 stores a pointer to the window manager used for osg wdgets and overlay stuff More...
 
bool m_selectionChanged
 true if the selection changed and widgets need redrawing More...
 
bool m_dendrogramDirty
 true if the dendrogram needs redrawing More...
 
size_t m_rootCluster
 currently selected cluster + offset More...
 
int m_oldViewHeight
 stores the old viewport resolution to check whether a resize happened More...
 
int m_oldViewWidth
 stores the old viewport resolution to check whether a resize happened More...
 
WPropInt m_infoCountLeafes
 info property More...
 
WPropInt m_infoCountClusters
 info property More...
 
WPropInt m_infoMaxLevel
 info property More...
 
std::vector< std::vector< size_t > > m_loadedPartitions
 set partitions loaded from file More...
 
WPropTrigger m_buttonUpdateOutput
 updates the output connector on demand, as we don't want to do this every paint command More...
 
std::shared_ptr< WItemSelectionm_clusterSelectionsList
 A list of cluster selection methods. More...
 
WPropSelection m_clusterSelection
 Selection property for clusters. More...
 
WPropTrigger m_buttonExecuteSelection
 triggers the cluster selection update More...
 
std::shared_ptr< WItemSelectionm_buttonLabelList
 A list of button labels. More...
 
WPropSelection m_buttonLabelSelection
 Selection property for button labels. More...
 
std::vector< WColor > m_clusterColors
 stores a preset color for every cluster, so clusters can keep the same color through different selection methods More...
 
size_t m_colorIndex
 temp variable for the initColors function More...
 

Additional Inherited Members

- Public Types inherited from WModule
typedef std::vector< std::shared_ptr< WModuleInputConnector > > InputConnectorList
 The type for the list of input connectors. More...
 
typedef std::vector< std::shared_ptr< WModuleOutputConnector > > OutputConnectorList
 The type for the list of output connectors. More...
 
typedef std::shared_ptr< WModuleSPtr
 Shared pointer to a WModule. More...
 
typedef std::shared_ptr< const WModuleConstSPtr
 Shared pointer to a const WModule. More...
 
- Public Types inherited from WThreadedRunner
typedef std::shared_ptr< WThreadedRunnerSPtr
 Abbreviation to a shared_ptr to this type. More...
 
typedef std::shared_ptr< const WThreadedRunnerConstSPtr
 Abbreviation to a const shared_ptr to this type. More...
 
typedef boost::function< void(void) > THREADFUNCTION
 Type used for simple thread functions. More...
 
- Static Public Member Functions inherited from WModule
static SPtr findByUUID (std::string uuid)
 Find a module instance by UUID. More...
 
- Static Public Member Functions inherited from WThreadedRunner
static void setThisThreadName (std::string name)
 Static function to set the name of the calling thread. More...
 
- Protected Types inherited from WModule
typedef std::vector< WRequirement * > Requirements
 The type of the requirement list. More...
 
- Protected Attributes inherited from WModule
std::shared_ptr< WPropertiesm_properties
 The property object for the module. More...
 
std::shared_ptr< WPropertiesm_infoProperties
 The property object for the module containing only module whose purpose is "PV_PURPOSE_INFORMNATION". More...
 
std::shared_ptr< WProgressCombinerm_progress
 Progress indicator used as parent for all progress' of this module. More...
 
WBoolFlag m_initialized
 True if everything is initialized and ready to be used. More...
 
WBoolFlag m_isAssociated
 True if container got associated with this flag. More...
 
WBoolFlag m_isUsable
 True if associated && initialized. More...
 
WBoolFlag m_isReady
 True if ready() was called. More...
 
WBoolFlag m_isReadyOrCrashed
 It is true whenever m_isReady or WThreadedRunner::m_isCrashed is true. More...
 
WBoolFlag m_isRunning
 True if the module currently is running. More...
 
WBoolFlag m_isLoadFinished
 Flag to denote whether the module container and the project loader have finished their work. More...
 
bool m_restoreMode
 Flag denoting the current restore mode. More...
 
std::shared_ptr< WProgressm_readyProgress
 Progress indicator for the "ready" state. More...
 
WConditionSet m_moduleState
 The internal state of the module. More...
 
std::shared_ptr< WModuleContainerm_container
 The container this module belongs to. More...
 
InputConnectorList m_inputConnectors
 Set of input connectors associated with this module. More...
 
OutputConnectorList m_outputConnectors
 Set of output connectors associated with this module. More...
 
WPropBool m_active
 True whenever the module should be active. More...
 
WPropString m_runtimeName
 This property holds a user specified name for the current module instance. More...
 
boost::filesystem::path m_localPath
 The path where the module binary resides in. More...
 
boost::filesystem::path m_libPath
 The absolute path to the library containing this module. More...
 
std::string m_packageName
 The name of the lib/the package containing this module. More...
 
Requirements m_requirements
 The list of requirements. More...
 
- Protected Attributes inherited from WThreadedRunner
boost::thread m_thread
 Thread instance. More...
 
WBoolFlag m_shutdownFlag
 Condition getting fired whenever the thread should quit. More...
 
WBoolFlag m_isCrashed
 True whenever an exception is thrown during threadMain. More...
 
std::string m_crashMessage
 The crash message. More...
 

Detailed Description

Allows one to display and interact with clustered voxel data.

Definition at line 74 of file WMClusterDisplayVoxels.h.

Member Function Documentation

◆ connectors()

void WMClusterDisplayVoxels::connectors ( )
protectedvirtual

Initialize the connectors this module is using.

Reimplemented from WModule.

Definition at line 92 of file WMClusterDisplayVoxels.cpp.

References WModule::addConnector(), WModule::connectors(), m_input, and m_output.

+ Here is the call graph for this function:

◆ createMesh()

void WMClusterDisplayVoxels::createMesh ( )
private

creates a triangulation from the selected clusters

Definition at line 728 of file WMClusterDisplayVoxels.cpp.

References WMarchingLegoAlgorithm::genSurfaceOneValue(), m_activatedClusters, m_data, m_grid, m_nonActiveMesh, m_showNotInClusters, and m_triMeshes.

Referenced by moduleMain(), and updateAll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createTexture()

void WMClusterDisplayVoxels::createTexture ( )
private

creates a new texture

Definition at line 680 of file WMClusterDisplayVoxels.cpp.

References WDataHandler::getDefaultSubject(), WKernel::getRunningKernel(), WKernel::getSelectionManager(), m_data, m_grid, and m_texture.

Referenced by moduleMain().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dendrogramClick()

void WMClusterDisplayVoxels::dendrogramClick ( WPickInfo  pickInfo)
private

listenes to the pickhandler and determines if a click into the dendrogram happened

Parameters
pickInfothe pickInfo object as sent out by the pickhandler

Definition at line 1064 of file WMClusterDisplayVoxels.cpp.

References WDendrogramGeode::getClickedCluster(), WPickInfo::getName(), WPickInfo::getPickPixel(), m_buttonExecuteSelection, m_dendrogramGeode, m_propSelectedCluster, m_propShowDendrogram, WPVBaseTypes::PV_TRIGGER_TRIGGERED, WMatrixFixed< ValueT, Rows, Cols, ValueStoreT >::x(), and WMatrixFixed< ValueT, Rows, Cols, ValueStoreT >::y().

Referenced by moduleMain().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ factory()

std::shared_ptr< WModule > WMClusterDisplayVoxels::factory ( ) const
virtual

Due to the prototype design pattern used to build modules, this method returns a new instance of this method.

NOTE: it should never be initialized or modified in some other way. A simple new instance is required.

Returns
the prototype used to create every module in OpenWalnut.

Implements WModule.

Definition at line 69 of file WMClusterDisplayVoxels.cpp.

◆ getDescription()

const std::string WMClusterDisplayVoxels::getDescription ( ) const
virtual

Gives back a description of this module.

Returns
description to module.

Implements WPrototyped.

Definition at line 85 of file WMClusterDisplayVoxels.cpp.

◆ getName()

const std::string WMClusterDisplayVoxels::getName ( ) const
virtual

Gives back the name of this module.

Returns
the module's name.

Implements WPrototyped.

Definition at line 79 of file WMClusterDisplayVoxels.cpp.

◆ getXPMIcon()

const char ** WMClusterDisplayVoxels::getXPMIcon ( ) const
virtual

Get the icon for this module in XPM format.

Returns
The icon.

Reimplemented from WModule.

Definition at line 75 of file WMClusterDisplayVoxels.cpp.

◆ handleMinSizeChanged()

void WMClusterDisplayVoxels::handleMinSizeChanged ( )
private

function to handle user input

Definition at line 591 of file WMClusterDisplayVoxels.cpp.

References m_dendrogramDirty.

Referenced by moduleMain().

+ Here is the caller graph for this function:

◆ initColors()

void WMClusterDisplayVoxels::initColors ( size_t  root,
size_t  index 
)
private

recursive function that initalizes a color for for every cluster, the biggest of the two children of a cluster inherits the color for its parent

Parameters
rootcluster to work on
indexcolor index of the parent

Definition at line 658 of file WMClusterDisplayVoxels.cpp.

References WHierarchicalTree::getChildren(), wge::getNthHSVColor(), m_clusterColors, m_colorIndex, m_tree, and WHierarchicalTree::size().

Referenced by loadClustering().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initWidgets()

void WMClusterDisplayVoxels::initWidgets ( )
private

inits the graphical widgets in the 3d scene

Definition at line 852 of file WMClusterDisplayVoxels.cpp.

References WKernel::getGraphicsEngine(), WKernel::getRunningKernel(), WModule::m_active, m_camera, m_dendrogramNode, m_meshNode, m_moduleNode, m_oldViewHeight, m_oldViewWidth, m_wm, and updateWidgets().

Referenced by moduleMain().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadClustering()

bool WMClusterDisplayVoxels::loadClustering ( boost::filesystem::path  clusterFile)
private

loads and parses the clustering text file

Parameters
clusterFileto the clustering file
Returns
true if a meta file was successfully loaded, false otherwise

Definition at line 596 of file WMClusterDisplayVoxels.cpp.

References WHierarchicalTreeVoxels::addCluster(), WHierarchicalTreeVoxels::addLeaf(), WModule::debugLog(), WHierarchicalTree::getClusterCount(), WFileParser::getLinesForTagSeparated(), WFileParser::getRawLines(), initColors(), m_clusterColors, m_colorIndex, m_grid, m_loadedPartitions, m_tree, and WFileParser::readFile().

Referenced by moduleMain().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ moduleMain()

void WMClusterDisplayVoxels::moduleMain ( )
protectedvirtual

◆ properties()

void WMClusterDisplayVoxels::properties ( )
protectedvirtual

◆ renderMesh()

void WMClusterDisplayVoxels::renderMesh ( )
private

renders the triangulated clusters

Definition at line 751 of file WMClusterDisplayVoxels.cpp.

References m_activatedClusters, m_clusterColors, m_meshNode, m_nonActiveMesh, m_outputGeodes, m_propShowVoxelTriangulation, m_showNotInClusters, m_triMeshes, and string_utils::toString().

Referenced by moduleMain(), and updateAll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setButtonLabels()

void WMClusterDisplayVoxels::setButtonLabels ( )
private

helper function to set the label on the in scene buttons depending on which labeling scheme is selected

Definition at line 1099 of file WMClusterDisplayVoxels.cpp.

References WHierarchicalTree::getCustomData(), WHierarchicalTree::getLevel(), m_activatedClusters, m_activeClustersButtonList, m_buttonLabelSelection, m_propShowSelectedButtons, m_tree, WHierarchicalTree::size(), and string_utils::toString().

Referenced by moduleMain(), and updateWidgets().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPropertyBoundaries()

void WMClusterDisplayVoxels::setPropertyBoundaries ( )
private

updates property min/max values after loading a clustering file

Definition at line 227 of file WMClusterDisplayVoxels.cpp.

References WHierarchicalTree::getClusterCount(), WHierarchicalTree::getLeafCount(), WHierarchicalTree::getMaxLevel(), m_infoCountClusters, m_infoCountLeafes, m_infoMaxLevel, m_loadedPartitions, m_propLevelsFromTop, m_propMinSizeToColor, m_propSelectedCluster, m_propSelectedLoadedPartion, m_rootCluster, m_tree, m_zoom, and m_zoomRoot.

Referenced by moduleMain().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateAll()

void WMClusterDisplayVoxels::updateAll ( )
private

◆ updateOutDataset()

void WMClusterDisplayVoxels::updateOutDataset ( )
private

update the output connector on demand, for performance reasons this is not done every time a change to the cluster selection is applied

Definition at line 1079 of file WMClusterDisplayVoxels.cpp.

References m_data, and m_dataSet.

Referenced by moduleMain().

+ Here is the caller graph for this function:

◆ updateWidgets()

void WMClusterDisplayVoxels::updateWidgets ( )
private

◆ widgetClicked()

bool WMClusterDisplayVoxels::widgetClicked ( )
private

handles mouse clicks into the dendrogram

Returns
true if handled

Definition at line 1023 of file WMClusterDisplayVoxels.cpp.

References m_activeClustersButtonList, and m_outputGeodes.

Referenced by updateWidgets().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_activatedClusters

std::vector<size_t> WMClusterDisplayVoxels::m_activatedClusters
private

stores the currently activated clusters

Definition at line 393 of file WMClusterDisplayVoxels.h.

Referenced by createMesh(), renderMesh(), setButtonLabels(), updateAll(), and updateWidgets().

◆ m_activeClustersButtonList

std::vector< osg::ref_ptr<WOSGButton> > WMClusterDisplayVoxels::m_activeClustersButtonList
private

list of buttons for the active cluster selection

Definition at line 398 of file WMClusterDisplayVoxels.h.

Referenced by setButtonLabels(), updateWidgets(), and widgetClicked().

◆ m_buttonExecuteSelection

WPropTrigger WMClusterDisplayVoxels::m_buttonExecuteSelection
private

triggers the cluster selection update

Definition at line 440 of file WMClusterDisplayVoxels.h.

Referenced by dendrogramClick(), moduleMain(), and properties().

◆ m_buttonLabelList

std::shared_ptr< WItemSelection > WMClusterDisplayVoxels::m_buttonLabelList
private

A list of button labels.

Definition at line 445 of file WMClusterDisplayVoxels.h.

Referenced by properties().

◆ m_buttonLabelSelection

WPropSelection WMClusterDisplayVoxels::m_buttonLabelSelection
private

Selection property for button labels.

Definition at line 450 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), properties(), and setButtonLabels().

◆ m_buttonUpdateOutput

WPropTrigger WMClusterDisplayVoxels::m_buttonUpdateOutput
private

updates the output connector on demand, as we don't want to do this every paint command

Definition at line 425 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), and properties().

◆ m_camera

WGECamera* WMClusterDisplayVoxels::m_camera
private

stores the camera object

Definition at line 400 of file WMClusterDisplayVoxels.h.

Referenced by initWidgets(), and updateWidgets().

◆ m_clusterColors

std::vector< WColor > WMClusterDisplayVoxels::m_clusterColors
private

stores a preset color for every cluster, so clusters can keep the same color through different selection methods

Definition at line 455 of file WMClusterDisplayVoxels.h.

Referenced by initColors(), loadClustering(), renderMesh(), updateAll(), and updateWidgets().

◆ m_clusterSelection

WPropSelection WMClusterDisplayVoxels::m_clusterSelection
private

Selection property for clusters.

Definition at line 435 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), and properties().

◆ m_clusterSelectionsList

std::shared_ptr< WItemSelection > WMClusterDisplayVoxels::m_clusterSelectionsList
private

A list of cluster selection methods.

Definition at line 430 of file WMClusterDisplayVoxels.h.

Referenced by properties().

◆ m_colorIndex

size_t WMClusterDisplayVoxels::m_colorIndex
private

temp variable for the initColors function

Definition at line 457 of file WMClusterDisplayVoxels.h.

Referenced by initColors(), and loadClustering().

◆ m_currentDisplayMode

CDV_DISPLAYMODE WMClusterDisplayVoxels::m_currentDisplayMode
private

the currently active display mode

Definition at line 260 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), updateAll(), and updateWidgets().

◆ m_currentDisplayModeString

std::string WMClusterDisplayVoxels::m_currentDisplayModeString
private

the currently active display mode as string

Definition at line 265 of file WMClusterDisplayVoxels.h.

Referenced by updateAll(), and updateWidgets().

◆ m_data

std::vector< size_t > WMClusterDisplayVoxels::m_data
private

stores a pointer to the texture we paint in

label vector for texture creation

Definition at line 250 of file WMClusterDisplayVoxels.h.

Referenced by createMesh(), createTexture(), updateAll(), and updateOutDataset().

◆ m_dataSet

std::shared_ptr< WDataSetSingle > WMClusterDisplayVoxels::m_dataSet
private

This is a pointer to the dataset the module is currently working on.

Definition at line 224 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), and updateOutDataset().

◆ m_dendrogramDirty

bool WMClusterDisplayVoxels::m_dendrogramDirty
private

true if the dendrogram needs redrawing

Definition at line 408 of file WMClusterDisplayVoxels.h.

Referenced by handleMinSizeChanged(), moduleMain(), updateAll(), and updateWidgets().

◆ m_dendrogramGeode

WDendrogramGeode* WMClusterDisplayVoxels::m_dendrogramGeode
private

stores the dendrogram geode

Definition at line 402 of file WMClusterDisplayVoxels.h.

Referenced by dendrogramClick(), and updateWidgets().

◆ m_dendrogramNode

osg::ref_ptr< WGEGroupNode > WMClusterDisplayVoxels::m_dendrogramNode
private

Pointer to the dendrogram group node.

Definition at line 384 of file WMClusterDisplayVoxels.h.

Referenced by initWidgets().

◆ m_grid

std::shared_ptr< WGridRegular3D > WMClusterDisplayVoxels::m_grid
private

stores a pointer to the grid we use;

Definition at line 255 of file WMClusterDisplayVoxels.h.

Referenced by createMesh(), createTexture(), loadClustering(), moduleMain(), and updateAll().

◆ m_groupDendrogram

WPropGroup WMClusterDisplayVoxels::m_groupDendrogram
private

grouping the dendrogram manipulation properties

Definition at line 339 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), and properties().

◆ m_groupSelection

WPropGroup WMClusterDisplayVoxels::m_groupSelection
private

grouping the different selection methods

Definition at line 334 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), and properties().

◆ m_groupTriangulation

WPropGroup WMClusterDisplayVoxels::m_groupTriangulation
private

grouping the dendrogram manipulation properties

Definition at line 344 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), and properties().

◆ m_infoCountClusters

WPropInt WMClusterDisplayVoxels::m_infoCountClusters
private

info property

Definition at line 417 of file WMClusterDisplayVoxels.h.

Referenced by properties(), and setPropertyBoundaries().

◆ m_infoCountLeafes

WPropInt WMClusterDisplayVoxels::m_infoCountLeafes
private

info property

Definition at line 416 of file WMClusterDisplayVoxels.h.

Referenced by properties(), and setPropertyBoundaries().

◆ m_infoMaxLevel

WPropInt WMClusterDisplayVoxels::m_infoMaxLevel
private

info property

Definition at line 418 of file WMClusterDisplayVoxels.h.

Referenced by properties(), and setPropertyBoundaries().

◆ m_input

std::shared_ptr< WModuleInputData< WDataSetSingle > > WMClusterDisplayVoxels::m_input
private

An input connector that accepts order 1 datasets.

Definition at line 214 of file WMClusterDisplayVoxels.h.

Referenced by connectors(), and moduleMain().

◆ m_loadedPartitions

std::vector< std::vector<size_t> > WMClusterDisplayVoxels::m_loadedPartitions
private

set partitions loaded from file

Definition at line 420 of file WMClusterDisplayVoxels.h.

Referenced by loadClustering(), setPropertyBoundaries(), and updateAll().

◆ m_meshNode

osg::ref_ptr< WGEGroupNode > WMClusterDisplayVoxels::m_meshNode
private

Pointer to the mesh group node.

Definition at line 385 of file WMClusterDisplayVoxels.h.

Referenced by initWidgets(), and renderMesh().

◆ m_moduleNode

osg::ref_ptr< WGEGroupNode > WMClusterDisplayVoxels::m_moduleNode
private

Pointer to the modules group node.

Definition at line 383 of file WMClusterDisplayVoxels.h.

Referenced by initWidgets(), and moduleMain().

◆ m_nonActiveMesh

std::shared_ptr< WTriangleMesh > WMClusterDisplayVoxels::m_nonActiveMesh
private

triangulation of the voxels not in active clusters

Definition at line 391 of file WMClusterDisplayVoxels.h.

Referenced by createMesh(), and renderMesh().

◆ m_oldViewHeight

int WMClusterDisplayVoxels::m_oldViewHeight
private

stores the old viewport resolution to check whether a resize happened

Definition at line 412 of file WMClusterDisplayVoxels.h.

Referenced by initWidgets(), and updateWidgets().

◆ m_oldViewWidth

int WMClusterDisplayVoxels::m_oldViewWidth
private

stores the old viewport resolution to check whether a resize happened

Definition at line 414 of file WMClusterDisplayVoxels.h.

Referenced by initWidgets(), and updateWidgets().

◆ m_outData

std::shared_ptr< WDataSetScalar > WMClusterDisplayVoxels::m_outData
private

This is a pointer to the current output.

Definition at line 234 of file WMClusterDisplayVoxels.h.

◆ m_outDataOld

std::shared_ptr< WDataSetScalar > WMClusterDisplayVoxels::m_outDataOld
private

Point to the out dataset once it is invalid.

Used to deregister from the datahandler

Definition at line 229 of file WMClusterDisplayVoxels.h.

◆ m_output

std::shared_ptr< WModuleOutputData< WDataSetScalar > > WMClusterDisplayVoxels::m_output
private

An output connector for the output scalar dsataset.

Definition at line 219 of file WMClusterDisplayVoxels.h.

Referenced by connectors().

◆ m_outputGeodes

std::vector<osg::ref_ptr< osg::Geode > > WMClusterDisplayVoxels::m_outputGeodes
private

a vector of dendrogram nodes

Definition at line 387 of file WMClusterDisplayVoxels.h.

Referenced by renderMesh(), and widgetClicked().

◆ m_propClusterFile

WPropFilename WMClusterDisplayVoxels::m_propClusterFile
private

The png files will be loaded form this directory.

Definition at line 273 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), and properties().

◆ m_propCondition

std::shared_ptr< WCondition > WMClusterDisplayVoxels::m_propCondition
private

A condition used to notify about changes in several properties.

Definition at line 270 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), and properties().

◆ m_propDendrogramOffsetX

WPropInt WMClusterDisplayVoxels::m_propDendrogramOffsetX
private

controls the horizontal origin of the dendrogram

Definition at line 368 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), properties(), and updateWidgets().

◆ m_propDendrogramOffsetY

WPropInt WMClusterDisplayVoxels::m_propDendrogramOffsetY
private

controls the vertical origin of the dendrogram

Definition at line 369 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), properties(), and updateWidgets().

◆ m_propDendrogramSizeX

WPropInt WMClusterDisplayVoxels::m_propDendrogramSizeX
private

controls the width of the dendrogram

Definition at line 366 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), properties(), and updateWidgets().

◆ m_propDendrogramSizeY

WPropInt WMClusterDisplayVoxels::m_propDendrogramSizeY
private

controls the height of the dendrogram

Definition at line 367 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), properties(), and updateWidgets().

◆ m_propHideOutliers

WPropBool WMClusterDisplayVoxels::m_propHideOutliers
private

show or hide outliers

Definition at line 319 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), properties(), and updateAll().

◆ m_propLevelsFromTop

WPropInt WMClusterDisplayVoxels::m_propLevelsFromTop
private

how many levels to go down from top

Definition at line 298 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), properties(), setPropertyBoundaries(), and updateAll().

◆ m_propMinBranchLength

WPropDouble WMClusterDisplayVoxels::m_propMinBranchLength
private

minimum branch length

Definition at line 309 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), properties(), and updateAll().

◆ m_propMinBranchSize

WPropInt WMClusterDisplayVoxels::m_propMinBranchSize
private

minimum branch size

Definition at line 314 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), properties(), and updateAll().

◆ m_propMinSizeToColor

WPropInt WMClusterDisplayVoxels::m_propMinSizeToColor
private

specifies a minimum size for a cluster so that too small cluster won't get an own color

Definition at line 329 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), properties(), setPropertyBoundaries(), and updateWidgets().

◆ m_propPlotHeightByLevel

WPropBool WMClusterDisplayVoxels::m_propPlotHeightByLevel
private

controls plotting the height of a join

Definition at line 354 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), properties(), and updateWidgets().

◆ m_propReadTrigger

WPropTrigger WMClusterDisplayVoxels::m_propReadTrigger
private

This property triggers the actual reading,.

Definition at line 272 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), and properties().

◆ m_propResizeWithWindow

WPropBool WMClusterDisplayVoxels::m_propResizeWithWindow
private

if true position and size sliders will have no effect

Definition at line 359 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), properties(), and updateWidgets().

◆ m_propSelectedCluster

WPropInt WMClusterDisplayVoxels::m_propSelectedCluster
private

the currently selected cluster

Definition at line 278 of file WMClusterDisplayVoxels.h.

Referenced by dendrogramClick(), moduleMain(), properties(), setPropertyBoundaries(), and updateAll().

◆ m_propSelectedLoadedPartion

WPropInt WMClusterDisplayVoxels::m_propSelectedLoadedPartion
private

property to select a loaded partition

Definition at line 293 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), properties(), setPropertyBoundaries(), and updateAll().

◆ m_propShowDendrogram

WPropBool WMClusterDisplayVoxels::m_propShowDendrogram
private

controls the display of the dendrogram overlay

Definition at line 349 of file WMClusterDisplayVoxels.h.

Referenced by dendrogramClick(), moduleMain(), properties(), and updateWidgets().

◆ m_propShowSelectedButtons

WPropBool WMClusterDisplayVoxels::m_propShowSelectedButtons
private

show or hide outliers

Definition at line 324 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), properties(), setButtonLabels(), and updateWidgets().

◆ m_propShowVoxelTriangulation

WPropBool WMClusterDisplayVoxels::m_propShowVoxelTriangulation
private

if true position and size sliders will have no effect

Definition at line 374 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), properties(), and renderMesh().

◆ m_propValue

WPropDouble WMClusterDisplayVoxels::m_propValue
private

the similarity value for selecting clusters

Definition at line 288 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), properties(), and updateAll().

◆ m_propXBiggestClusters

WPropInt WMClusterDisplayVoxels::m_propXBiggestClusters
private

the currently selected cluster

Definition at line 283 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), properties(), and updateAll().

◆ m_propXClusters

WPropInt WMClusterDisplayVoxels::m_propXClusters
private

how many levels to go down from top

Definition at line 303 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), properties(), and updateAll().

◆ m_propZoomIn

WPropTrigger WMClusterDisplayVoxels::m_propZoomIn
private

zoom into tree, sets m_zoom true and m_zoomRoot to the currently selected cluster

Definition at line 361 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), and properties().

◆ m_propZoomOut

WPropTrigger WMClusterDisplayVoxels::m_propZoomOut
private

zooms out, m_zoom = false, dendrogram shows the whole tree

Definition at line 362 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), and properties().

◆ m_rootCluster

size_t WMClusterDisplayVoxels::m_rootCluster
private

currently selected cluster + offset

Definition at line 410 of file WMClusterDisplayVoxels.h.

Referenced by setPropertyBoundaries().

◆ m_selectionChanged

bool WMClusterDisplayVoxels::m_selectionChanged
private

true if the selection changed and widgets need redrawing

Definition at line 406 of file WMClusterDisplayVoxels.h.

Referenced by updateAll(), and updateWidgets().

◆ m_showNotInClusters

WPropBool WMClusterDisplayVoxels::m_showNotInClusters
private

if true clusters not in the current selection list will be rendered grey in the texture and triangulation

Definition at line 379 of file WMClusterDisplayVoxels.h.

Referenced by createMesh(), moduleMain(), properties(), renderMesh(), and updateAll().

◆ m_texture

osg::ref_ptr<osg::Texture3D> WMClusterDisplayVoxels::m_texture
private

stores a pointer to the texture we paint in

Definition at line 239 of file WMClusterDisplayVoxels.h.

Referenced by createTexture(), and updateAll().

◆ m_tree

WHierarchicalTreeVoxels WMClusterDisplayVoxels::m_tree
private

the tree object as loaded from the file

Definition at line 381 of file WMClusterDisplayVoxels.h.

Referenced by initColors(), loadClustering(), setButtonLabels(), setPropertyBoundaries(), updateAll(), and updateWidgets().

◆ m_triMeshes

std::vector<std::shared_ptr< WTriangleMesh > > WMClusterDisplayVoxels::m_triMeshes
private

triangulation of the active clusters

Definition at line 389 of file WMClusterDisplayVoxels.h.

Referenced by createMesh(), and renderMesh().

◆ m_wm

osgWidget::WindowManager* WMClusterDisplayVoxels::m_wm
private

stores a pointer to the window manager used for osg wdgets and overlay stuff

Definition at line 404 of file WMClusterDisplayVoxels.h.

Referenced by initWidgets(), and updateWidgets().

◆ m_zoom

bool WMClusterDisplayVoxels::m_zoom
private

control variable for zoom mode

Definition at line 364 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), setPropertyBoundaries(), and updateWidgets().

◆ m_zoomRoot

size_t WMClusterDisplayVoxels::m_zoomRoot
private

control variable for zoom mode

Definition at line 363 of file WMClusterDisplayVoxels.h.

Referenced by moduleMain(), setPropertyBoundaries(), and updateWidgets().


The documentation for this class was generated from the following files: