OpenWalnut
1.5.0dev
|
implements a branch in the tree like structure for rois More...
#include <WRMBranch.h>
Public Types | |
typedef std::shared_ptr< WRMBranch > | SPtr |
Convenience type for a shared pointer of this type. More... | |
typedef std::shared_ptr< const WRMBranch > | ConstSPtr |
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< WROI > | getFirstRoi () |
returns a pointer to the first roi in the branch More... | |
std::shared_ptr< WROIManager > | getRoiManager () |
getter for roi manager pointer More... | |
std::shared_ptr< WProperties > | getProperties () |
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< WROIManager > | m_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< WProperties > | m_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... | |
implements a branch in the tree like structure for rois
Definition at line 43 of file WRMBranch.h.
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.
typedef std::shared_ptr< WRMBranch > WRMBranch::SPtr |
Convenience type for a shared pointer of this type.
Definition at line 49 of file WRMBranch.h.
|
explicit |
construtor
roiManager |
Definition at line 35 of file WRMBranch.cpp.
References properties().
WRMBranch::~WRMBranch | ( | ) |
destructor
Definition at line 41 of file WRMBranch.cpp.
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.
notifier | the notifier function |
Definition at line 172 of file WRMBranch.cpp.
References m_associatedNotifiersLock, and m_changeNotifiers.
void WRMBranch::addRoi | ( | osg::ref_ptr< WROI > | roi | ) |
adds a roi to the branch
roi |
Definition at line 84 of file WRMBranch.cpp.
References m_changeRoiSignal, m_rois, and setDirty().
WPropColor WRMBranch::colorProperty | ( | ) |
The branch color property.
Definition at line 79 of file WRMBranch.cpp.
References m_bundleColor.
bool WRMBranch::contains | ( | osg::ref_ptr< WROI > | roi | ) |
checks wether a roi is in this branch
roi |
Definition at line 91 of file WRMBranch.cpp.
References m_rois.
|
inline |
getter for dirty flag
reset | when true the dirty flag will be set to false |
Definition at line 262 of file WRMBranch.h.
References m_dirty.
|
inline |
returns whether the branch is empty.
Definition at line 257 of file WRMBranch.h.
References m_rois.
osg::ref_ptr< WROI > WRMBranch::getFirstRoi | ( | ) |
returns a pointer to the first roi in the branch
Definition at line 157 of file WRMBranch.cpp.
References m_rois.
std::shared_ptr< WProperties > WRMBranch::getProperties | ( | ) |
returns the properties object.
Definition at line 167 of file WRMBranch.cpp.
References m_properties.
WPropertyGroup::SPtr WRMBranch::getProperties | ( | ) | const |
Get the properties of this branch as group.
Definition at line 59 of file WRMBranch.cpp.
References m_properties.
std::shared_ptr< WROIManager > WRMBranch::getRoiManager | ( | ) |
getter for roi manager pointer
Definition at line 162 of file WRMBranch.cpp.
References m_roiManager.
WROIManager::ROIs WRMBranch::getRois | ( | ) | const |
Create a list of ROIs of the current point in time.
Definition at line 125 of file WRMBranch.cpp.
References m_rois.
void WRMBranch::getRois | ( | std::vector< osg::ref_ptr< WROI > > & | roiVec | ) |
add all the rois in this branch to a given vector
roiVec | the vector to fill |
Definition at line 117 of file WRMBranch.cpp.
References m_rois.
WPropBool WRMBranch::invertProperty | ( | ) |
Get the "not" property.
Definition at line 74 of file WRMBranch.cpp.
References m_isNot.
|
inline |
WPropString WRMBranch::nameProperty | ( | ) |
Get name property.
Definition at line 69 of file WRMBranch.cpp.
References m_name.
|
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().
|
protected |
slot gets called when a property has changed
Definition at line 64 of file WRMBranch.cpp.
References setDirty().
Referenced by properties().
void WRMBranch::removeAllRois | ( | ) |
removes all rois from the branch
Definition at line 135 of file WRMBranch.cpp.
References WGraphicsEngine::getGraphicsEngine(), and m_rois.
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.
notifier | the notifier function |
Definition at line 180 of file WRMBranch.cpp.
References m_associatedNotifiersLock, and m_changeNotifiers.
void WRMBranch::removeRoi | ( | osg::ref_ptr< WROI > | roi | ) |
removes a roi from the branch
roi |
Definition at line 103 of file WRMBranch.cpp.
References m_changeRoiSignal, m_rois, and 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().
void WRMBranch::sort | ( | Comparator | comp | ) |
Resorts the ROIs using the specified comparator from its begin to its end.
Comparator | the comparator type. Usually a boost::function or class providing the operator<(). |
comp | the comparator |
Definition at line 278 of file WRMBranch.h.
References m_rois.
|
private |
Lock for associated notifiers set.
Definition at line 254 of file WRMBranch.h.
Referenced by addChangeNotifier(), and removeChangeNotifier().
|
private |
The color used when in isosurface mode for blending.
Definition at line 237 of file WRMBranch.h.
Referenced by colorProperty(), and properties().
|
private |
The notifiers connected to added rois by default.
Definition at line 247 of file WRMBranch.h.
Referenced by addChangeNotifier(), removeChangeNotifier(), and setDirty().
|
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().
|
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().
|
private |
indicates if the branch is negated
Definition at line 232 of file WRMBranch.h.
Referenced by invertProperty(), isNot(), and properties().
|
private |
Name property.
Definition at line 242 of file WRMBranch.h.
Referenced by nameProperty(), and properties().
|
private |
the property object for the module
Definition at line 225 of file WRMBranch.h.
Referenced by getProperties(), and properties().
|
private |
stores a pointer to the roi manager
Definition at line 218 of file WRMBranch.h.
Referenced by getRoiManager(), and setDirty().
|
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().