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

implements a branch in the tree like structure for rois More...

#include <WRMBranch.h>

+ Inheritance diagram for WRMBranch:
+ Collaboration diagram for WRMBranch:

Public Types

typedef std::shared_ptr< WRMBranchSPtr
 Convenience type for a shared pointer of this type. More...
 
typedef std::shared_ptr< const WRMBranchConstSPtr
 Convenience type for a const shared pointer of this type. More...
 

Public Member Functions

 WRMBranch (std::shared_ptr< WROIManager > roiManager)
 construtor More...
 
 ~WRMBranch ()
 destructor More...
 
WPropString nameProperty ()
 Get name property. More...
 
WPropBool invertProperty ()
 Get the "not" property. More...
 
WPropColor colorProperty ()
 The branch color property. More...
 
WPropertyGroup::SPtr getProperties () const
 Get the properties of this branch as group. More...
 
void addRoi (osg::ref_ptr< WROI > roi)
 adds a roi to the branch More...
 
void removeRoi (osg::ref_ptr< WROI > roi)
 removes a roi from the branch More...
 
void removeAllRois ()
 removes all rois from the branch More...
 
bool dirty (bool reset=false)
 getter for dirty flag More...
 
void setDirty ()
 sets dirty flag true and notifies the branch More...
 
bool empty ()
 returns whether the branch is empty. More...
 
bool contains (osg::ref_ptr< WROI > roi)
 checks wether a roi is in this branch More...
 
osg::ref_ptr< WROIgetFirstRoi ()
 returns a pointer to the first roi in the branch More...
 
std::shared_ptr< WROIManagergetRoiManager ()
 getter for roi manager pointer More...
 
std::shared_ptr< WPropertiesgetProperties ()
 returns the properties object. More...
 
bool isNot ()
 getter for the NOT flag More...
 
void getRois (std::vector< osg::ref_ptr< WROI > > &roiVec)
 add all the rois in this branch to a given vector More...
 
std::vector< osg::ref_ptr< WROI > > getRois () const
 Create a list of ROIs of the current point in time. More...
 
void addChangeNotifier (std::shared_ptr< boost::function< void() > > notifier)
 Add a specified notifier to the list of default notifiers which get connected to each branch. More...
 
void removeChangeNotifier (std::shared_ptr< boost::function< void() > > notifier)
 Remove a specified notifier from the list of default notifiers which get connected to each branch. More...
 
template<typename Comparator >
void sort (Comparator comp)
 Resorts the ROIs using the specified comparator from its begin to its end. More...
 

Protected Member Functions

void properties ()
 initializes properties More...
 
void propertyChanged ()
 slot gets called when a property has changed More...
 

Private Attributes

std::shared_ptr< WROIManagerm_roiManager
 stores a pointer to the roi manager More...
 
std::vector< osg::ref_ptr< WROI > > m_rois
 list of rois in this this branch, More...
 
std::shared_ptr< WPropertiesm_properties
 the property object for the module More...
 
WPropBool m_dirty
 dirty flag to indicate if anything has changed within the branch More...
 
WPropBool m_isNot
 indicates if the branch is negated More...
 
WPropColor m_bundleColor
 The color used when in isosurface mode for blending. More...
 
WPropString m_name
 Name property. More...
 
std::list< std::shared_ptr< boost::function< void() > > > m_changeNotifiers
 The notifiers connected to added rois by default. More...
 
std::shared_ptr< boost::function< void() > > m_changeRoiSignal
 Signal that can be used to update the ROImanager branch. More...
 
std::shared_mutex m_associatedNotifiersLock
 Lock for associated notifiers set. More...
 

Detailed Description

implements a branch in the tree like structure for rois

Definition at line 43 of file WRMBranch.h.

Member Typedef Documentation

◆ ConstSPtr

typedef std::shared_ptr< const WRMBranch > WRMBranch::ConstSPtr

Convenience type for a const shared pointer of this type.

Definition at line 54 of file WRMBranch.h.

◆ SPtr

typedef std::shared_ptr< WRMBranch > WRMBranch::SPtr

Convenience type for a shared pointer of this type.

Definition at line 49 of file WRMBranch.h.

Constructor & Destructor Documentation

◆ WRMBranch()

WRMBranch::WRMBranch ( std::shared_ptr< WROIManager roiManager)
explicit

construtor

Parameters
roiManager

Definition at line 35 of file WRMBranch.cpp.

References properties().

+ Here is the call graph for this function:

◆ ~WRMBranch()

WRMBranch::~WRMBranch ( )

destructor

Definition at line 41 of file WRMBranch.cpp.

Member Function Documentation

◆ addChangeNotifier()

void WRMBranch::addChangeNotifier ( std::shared_ptr< boost::function< void() > >  notifier)

Add a specified notifier to the list of default notifiers which get connected to each branch.

Parameters
notifierthe notifier function

Definition at line 172 of file WRMBranch.cpp.

References m_associatedNotifiersLock, and m_changeNotifiers.

◆ addRoi()

void WRMBranch::addRoi ( osg::ref_ptr< WROI roi)

adds a roi to the branch

Parameters
roi

Definition at line 84 of file WRMBranch.cpp.

References m_changeRoiSignal, m_rois, and setDirty().

+ Here is the call graph for this function:

◆ colorProperty()

WPropColor WRMBranch::colorProperty ( )

The branch color property.

Returns
the color property

Definition at line 79 of file WRMBranch.cpp.

References m_bundleColor.

◆ contains()

bool WRMBranch::contains ( osg::ref_ptr< WROI roi)

checks wether a roi is in this branch

Parameters
roi
Returns
true if the roi is in the branch, false otherwise

Definition at line 91 of file WRMBranch.cpp.

References m_rois.

◆ dirty()

bool WRMBranch::dirty ( bool  reset = false)
inline

getter for dirty flag

Parameters
resetwhen true the dirty flag will be set to false
Returns
the dirty flag

Definition at line 262 of file WRMBranch.h.

References m_dirty.

◆ empty()

bool WRMBranch::empty ( )
inline

returns whether the branch is empty.

Returns
true if empty.

Definition at line 257 of file WRMBranch.h.

References m_rois.

◆ getFirstRoi()

osg::ref_ptr< WROI > WRMBranch::getFirstRoi ( )

returns a pointer to the first roi in the branch

Returns
the roi

Definition at line 157 of file WRMBranch.cpp.

References m_rois.

◆ getProperties() [1/2]

std::shared_ptr< WProperties > WRMBranch::getProperties ( )

returns the properties object.

Returns
the properties of this branch

Definition at line 167 of file WRMBranch.cpp.

References m_properties.

◆ getProperties() [2/2]

WPropertyGroup::SPtr WRMBranch::getProperties ( ) const

Get the properties of this branch as group.

Returns
branch property group

Definition at line 59 of file WRMBranch.cpp.

References m_properties.

◆ getRoiManager()

std::shared_ptr< WROIManager > WRMBranch::getRoiManager ( )

getter for roi manager pointer

Returns
the roi manager

Definition at line 162 of file WRMBranch.cpp.

References m_roiManager.

◆ getRois() [1/2]

WROIManager::ROIs WRMBranch::getRois ( ) const

Create a list of ROIs of the current point in time.

Returns
the ROIs

Definition at line 125 of file WRMBranch.cpp.

References m_rois.

◆ getRois() [2/2]

void WRMBranch::getRois ( std::vector< osg::ref_ptr< WROI > > &  roiVec)

add all the rois in this branch to a given vector

Parameters
roiVecthe vector to fill

Definition at line 117 of file WRMBranch.cpp.

References m_rois.

◆ invertProperty()

WPropBool WRMBranch::invertProperty ( )

Get the "not" property.

Returns
the property

Definition at line 74 of file WRMBranch.cpp.

References m_isNot.

◆ isNot()

bool WRMBranch::isNot ( )
inline

getter for the NOT flag

Returns
flag

Definition at line 272 of file WRMBranch.h.

References m_isNot.

◆ nameProperty()

WPropString WRMBranch::nameProperty ( )

Get name property.

Returns
name property

Definition at line 69 of file WRMBranch.cpp.

References m_name.

◆ properties()

void WRMBranch::properties ( )
protected

initializes properties

Definition at line 45 of file WRMBranch.cpp.

References m_bundleColor, m_changeRoiSignal, m_dirty, m_isNot, m_name, m_properties, propertyChanged(), and setDirty().

Referenced by WRMBranch().

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

◆ propertyChanged()

void WRMBranch::propertyChanged ( )
protected

slot gets called when a property has changed

Definition at line 64 of file WRMBranch.cpp.

References setDirty().

Referenced by properties().

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

◆ removeAllRois()

void WRMBranch::removeAllRois ( )

removes all rois from the branch

Definition at line 135 of file WRMBranch.cpp.

References WGraphicsEngine::getGraphicsEngine(), and m_rois.

+ Here is the call graph for this function:

◆ removeChangeNotifier()

void WRMBranch::removeChangeNotifier ( std::shared_ptr< boost::function< void() > >  notifier)

Remove a specified notifier from the list of default notifiers which get connected to each branch.

Parameters
notifierthe notifier function

Definition at line 180 of file WRMBranch.cpp.

References m_associatedNotifiersLock, and m_changeNotifiers.

◆ removeRoi()

void WRMBranch::removeRoi ( osg::ref_ptr< WROI roi)

removes a roi from the branch

Parameters
roi

Definition at line 103 of file WRMBranch.cpp.

References m_changeRoiSignal, m_rois, and setDirty().

+ Here is the call graph for this function:

◆ setDirty()

void WRMBranch::setDirty ( )

sets dirty flag true and notifies the branch

Definition at line 145 of file WRMBranch.cpp.

References m_changeNotifiers, m_dirty, and m_roiManager.

Referenced by addRoi(), properties(), propertyChanged(), and removeRoi().

+ Here is the caller graph for this function:

◆ sort()

template<typename Comparator >
void WRMBranch::sort ( Comparator  comp)

Resorts the ROIs using the specified comparator from its begin to its end.

Template Parameters
Comparatorthe comparator type. Usually a boost::function or class providing the operator<().
Parameters
compthe comparator

Definition at line 278 of file WRMBranch.h.

References m_rois.

Member Data Documentation

◆ m_associatedNotifiersLock

std::shared_mutex WRMBranch::m_associatedNotifiersLock
private

Lock for associated notifiers set.

Definition at line 254 of file WRMBranch.h.

Referenced by addChangeNotifier(), and removeChangeNotifier().

◆ m_bundleColor

WPropColor WRMBranch::m_bundleColor
private

The color used when in isosurface mode for blending.

Definition at line 237 of file WRMBranch.h.

Referenced by colorProperty(), and properties().

◆ m_changeNotifiers

std::list< std::shared_ptr< boost::function< void() > > > WRMBranch::m_changeNotifiers
private

The notifiers connected to added rois by default.

Definition at line 247 of file WRMBranch.h.

Referenced by addChangeNotifier(), removeChangeNotifier(), and setDirty().

◆ m_changeRoiSignal

std::shared_ptr< boost::function< void() > > WRMBranch::m_changeRoiSignal
private

Signal that can be used to update the ROImanager branch.

Definition at line 249 of file WRMBranch.h.

Referenced by addRoi(), properties(), and removeRoi().

◆ m_dirty

WPropBool WRMBranch::m_dirty
private

dirty flag to indicate if anything has changed within the branch

Definition at line 227 of file WRMBranch.h.

Referenced by dirty(), properties(), and setDirty().

◆ m_isNot

WPropBool WRMBranch::m_isNot
private

indicates if the branch is negated

Definition at line 232 of file WRMBranch.h.

Referenced by invertProperty(), isNot(), and properties().

◆ m_name

WPropString WRMBranch::m_name
private

Name property.

Definition at line 242 of file WRMBranch.h.

Referenced by nameProperty(), and properties().

◆ m_properties

std::shared_ptr< WProperties > WRMBranch::m_properties
private

the property object for the module

Definition at line 225 of file WRMBranch.h.

Referenced by getProperties(), and properties().

◆ m_roiManager

std::shared_ptr< WROIManager > WRMBranch::m_roiManager
private

stores a pointer to the roi manager

Definition at line 218 of file WRMBranch.h.

Referenced by getRoiManager(), and setDirty().

◆ m_rois

std::vector< osg::ref_ptr< WROI > > WRMBranch::m_rois
private

list of rois in this this branch,

Definition at line 220 of file WRMBranch.h.

Referenced by addRoi(), contains(), empty(), getFirstRoi(), getRois(), removeAllRois(), removeRoi(), and sort().


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