OpenWalnut
1.4.0
|
Class to store and manage different ROI's for fiber selection. More...
#include <WROIManager.h>
Public Types | |
typedef std::vector < osg::ref_ptr< WROI > > | ROIs |
ROI list. | |
typedef std::vector < boost::shared_ptr< WRMBranch > > | Branches |
Branches list. | |
Public Member Functions | |
WROIManager () | |
standard constructor | |
~WROIManager () | |
destructor | |
boost::shared_ptr< WRMBranch > | addBranch () |
Add a new branch. | |
void | addRoi (osg::ref_ptr< WROI > newRoi) |
adds a new master ROI | |
void | addRoi (osg::ref_ptr< WROI > newRoi, osg::ref_ptr< WROI > parentRoi) |
adds a new ROI below a master ROI | |
void | addRoi (osg::ref_ptr< WROI > newRoi, boost::shared_ptr< WRMBranch > toBranch) |
Add a ROI to a branch. | |
void | removeRoi (osg::ref_ptr< WROI > roi) |
removes a roi | |
void | removeBranch (osg::ref_ptr< WROI > roi) |
removes a branch | |
boost::shared_ptr< WRMBranch > | getBranch (osg::ref_ptr< WROI > roi) |
getter returns the branch item the roi is in | |
void | setDirty () |
sets the dirty flag which will cause recalculation of the bit field | |
bool | dirty (bool reset=false) |
getter | |
void | addAddNotifier (boost::shared_ptr< boost::function< void(osg::ref_ptr< WROI >) > > notifier) |
Add a specified notifier to the list of default notifiers which get connected to each added roi. | |
void | removeAddNotifier (boost::shared_ptr< boost::function< void(osg::ref_ptr< WROI >) > > notifier) |
Remove a specified notifier from the list of default notifiers which get connected to each added roi. | |
void | addRemoveNotifier (boost::shared_ptr< boost::function< void(osg::ref_ptr< WROI >) > > notifier) |
Add a specified notifier to the list of default notifiers which get connected to each removed roi. | |
void | removeRemoveNotifier (boost::shared_ptr< boost::function< void(osg::ref_ptr< WROI >) > > notifier) |
Remove a specified notifier from the list of default notifiers which get connected to each removed roi. | |
void | addRemoveBranchNotifier (boost::shared_ptr< boost::function< void(boost::shared_ptr< WRMBranch >) > > notifier) |
Add a specified notifier to the list of default notifiers which get connected to each removed branch. | |
void | removeRemoveBranchNotifier (boost::shared_ptr< boost::function< void(boost::shared_ptr< WRMBranch >) > > notifier) |
Remove a specified notifier from the list of default notifiers which get connected to each removed branch. | |
void | setSelectedRoi (osg::ref_ptr< WROI > roi) |
setter | |
osg::ref_ptr< WROI > | getSelectedRoi () |
getter | |
boost::shared_ptr< WProperties > | getProperties () |
getter for the properties object | |
ROIs | getRois () const |
getter | |
Branches | getBranches () const |
Get a copy of the current branch list. | |
Private Attributes | |
size_t | m_size |
number of fibers in the dataset | |
std::list< boost::shared_ptr < WRMBranch > > | m_branches |
list of branches in the logical tree structure | |
boost::shared_mutex | m_associatedNotifiersLock |
Lock for associated notifiers set. | |
std::list< boost::shared_ptr < boost::function< void(osg::ref_ptr < WROI >) > > > | m_addNotifiers |
The notifiers connected to added rois by default. | |
std::list< boost::shared_ptr < boost::function< void(osg::ref_ptr < WROI >) > > > | m_removeNotifiers |
The notifiers connected to removed rois by default. | |
std::list< boost::shared_ptr < boost::function< void(boost::shared_ptr < WRMBranch >) > > > | m_removeBranchNotifiers |
The notifiers connected to removed rois by default. | |
osg::ref_ptr< WROI > | m_selectedRoi |
stores a pointer to the currently selected roi | |
boost::shared_ptr< WProperties > | m_properties |
The property object for the module. | |
WPropBool | m_dirty |
dirty flag |
Class to store and manage different ROI's for fiber selection.
Definition at line 40 of file WROIManager.h.
typedef std::vector< boost::shared_ptr< WRMBranch > > WROIManager::Branches |
Branches list.
Definition at line 195 of file WROIManager.h.
typedef std::vector< osg::ref_ptr< WROI > > WROIManager::ROIs |
ROI list.
Definition at line 184 of file WROIManager.h.
standard constructor
Definition at line 34 of file WROIManager.cpp.
References m_dirty, and m_properties.
destructor
Definition at line 40 of file WROIManager.cpp.
void WROIManager::addAddNotifier | ( | boost::shared_ptr< boost::function< void(osg::ref_ptr< WROI >) > > | notifier | ) |
Add a specified notifier to the list of default notifiers which get connected to each added roi.
notifier | the notifier function |
Definition at line 169 of file WROIManager.cpp.
References m_addNotifiers, and m_associatedNotifiersLock.
boost::shared_ptr< WRMBranch > WROIManager::addBranch | ( | ) |
Add a new branch.
Definition at line 61 of file WROIManager.cpp.
References m_branches.
Referenced by addRoi().
void WROIManager::addRemoveBranchNotifier | ( | boost::shared_ptr< boost::function< void(boost::shared_ptr< WRMBranch >) > > | notifier | ) |
Add a specified notifier to the list of default notifiers which get connected to each removed branch.
notifier | the notifier function |
Definition at line 211 of file WROIManager.cpp.
References m_associatedNotifiersLock, and m_removeBranchNotifiers.
void WROIManager::addRemoveNotifier | ( | boost::shared_ptr< boost::function< void(osg::ref_ptr< WROI >) > > | notifier | ) |
Add a specified notifier to the list of default notifiers which get connected to each removed roi.
notifier | the notifier function |
Definition at line 190 of file WROIManager.cpp.
References m_associatedNotifiersLock, and m_removeNotifiers.
void WROIManager::addRoi | ( | osg::ref_ptr< WROI > | newRoi | ) |
adds a new master ROI
newRoi |
Definition at line 56 of file WROIManager.cpp.
References addBranch().
void WROIManager::addRoi | ( | osg::ref_ptr< WROI > | newRoi, |
osg::ref_ptr< WROI > | parentRoi | ||
) |
adds a new ROI below a master ROI
newRoi | |
parentRoi |
Definition at line 72 of file WROIManager.cpp.
References m_addNotifiers, and m_branches.
void WROIManager::addRoi | ( | osg::ref_ptr< WROI > | newRoi, |
boost::shared_ptr< WRMBranch > | toBranch | ||
) |
Add a ROI to a branch.
newRoi | the new ROI to add |
toBranch | the branch to add the ROI to. |
Definition at line 44 of file WROIManager.cpp.
References m_addNotifiers.
bool WROIManager::dirty | ( | bool | reset = false | ) | [inline] |
getter
reset | if true the dirty flag will be set to false |
Definition at line 244 of file WROIManager.h.
References m_dirty.
boost::shared_ptr< WRMBranch > WROIManager::getBranch | ( | osg::ref_ptr< WROI > | roi | ) |
getter returns the branch item the roi is in
roi |
Definition at line 150 of file WROIManager.cpp.
References m_branches.
Get a copy of the current branch list.
Please note that after getting the list, it might already have been changed by another thread.
Definition at line 253 of file WROIManager.cpp.
References m_branches.
boost::shared_ptr< WProperties > WROIManager::getProperties | ( | ) | [inline] |
getter for the properties object
Definition at line 254 of file WROIManager.h.
References m_properties.
WROIManager::ROIs WROIManager::getRois | ( | ) | const |
getter
Definition at line 242 of file WROIManager.cpp.
References m_branches.
osg::ref_ptr< WROI > WROIManager::getSelectedRoi | ( | ) |
getter
Definition at line 237 of file WROIManager.cpp.
References m_selectedRoi.
void WROIManager::removeAddNotifier | ( | boost::shared_ptr< boost::function< void(osg::ref_ptr< WROI >) > > | notifier | ) |
Remove a specified notifier from the list of default notifiers which get connected to each added roi.
notifier | the notifier function |
Definition at line 177 of file WROIManager.cpp.
References m_addNotifiers, and m_associatedNotifiersLock.
void WROIManager::removeBranch | ( | osg::ref_ptr< WROI > | roi | ) |
removes a branch
roi | the first roi in the branch |
Definition at line 125 of file WROIManager.cpp.
References m_branches, m_removeBranchNotifiers, and setDirty().
void WROIManager::removeRemoveBranchNotifier | ( | boost::shared_ptr< boost::function< void(boost::shared_ptr< WRMBranch >) > > | notifier | ) |
Remove a specified notifier from the list of default notifiers which get connected to each removed branch.
notifier | the notifier function |
Definition at line 219 of file WROIManager.cpp.
References m_associatedNotifiersLock, and m_removeBranchNotifiers.
void WROIManager::removeRemoveNotifier | ( | boost::shared_ptr< boost::function< void(osg::ref_ptr< WROI >) > > | notifier | ) |
Remove a specified notifier from the list of default notifiers which get connected to each removed roi.
notifier | the notifier function |
Definition at line 198 of file WROIManager.cpp.
References m_associatedNotifiersLock, and m_removeNotifiers.
void WROIManager::removeRoi | ( | osg::ref_ptr< WROI > | roi | ) |
removes a roi
roi |
Definition at line 93 of file WROIManager.cpp.
References WGraphicsEngine::getGraphicsEngine(), m_branches, m_removeBranchNotifiers, m_removeNotifiers, and setDirty().
void WROIManager::setDirty | ( | ) |
sets the dirty flag which will cause recalculation of the bit field
Definition at line 164 of file WROIManager.cpp.
References m_dirty.
Referenced by removeBranch(), and removeRoi().
void WROIManager::setSelectedRoi | ( | osg::ref_ptr< WROI > | roi | ) |
std::list< boost::shared_ptr< boost::function< void( osg::ref_ptr< WROI > ) > > > WROIManager::m_addNotifiers [private] |
The notifiers connected to added rois by default.
Definition at line 218 of file WROIManager.h.
Referenced by addAddNotifier(), addRoi(), and removeAddNotifier().
boost::shared_mutex WROIManager::m_associatedNotifiersLock [private] |
Lock for associated notifiers set.
Definition at line 213 of file WROIManager.h.
Referenced by addAddNotifier(), addRemoveBranchNotifier(), addRemoveNotifier(), removeAddNotifier(), removeRemoveBranchNotifier(), and removeRemoveNotifier().
std::list< boost::shared_ptr< WRMBranch > > WROIManager::m_branches [private] |
list of branches in the logical tree structure
Definition at line 208 of file WROIManager.h.
Referenced by addBranch(), addRoi(), getBranch(), getBranches(), getRois(), removeBranch(), and removeRoi().
WPropBool WROIManager::m_dirty [private] |
dirty flag
Definition at line 241 of file WROIManager.h.
Referenced by dirty(), setDirty(), and WROIManager().
boost::shared_ptr< WProperties > WROIManager::m_properties [private] |
The property object for the module.
Definition at line 236 of file WROIManager.h.
Referenced by getProperties(), and WROIManager().
std::list< boost::shared_ptr< boost::function< void( boost::shared_ptr< WRMBranch > ) > > > WROIManager::m_removeBranchNotifiers [private] |
The notifiers connected to removed rois by default.
Definition at line 228 of file WROIManager.h.
Referenced by addRemoveBranchNotifier(), removeBranch(), removeRemoveBranchNotifier(), and removeRoi().
std::list< boost::shared_ptr< boost::function< void( osg::ref_ptr< WROI > ) > > > WROIManager::m_removeNotifiers [private] |
The notifiers connected to removed rois by default.
Definition at line 223 of file WROIManager.h.
Referenced by addRemoveNotifier(), removeRemoveNotifier(), and removeRoi().
osg::ref_ptr< WROI > WROIManager::m_selectedRoi [private] |
stores a pointer to the currently selected roi
Definition at line 231 of file WROIManager.h.
Referenced by getSelectedRoi(), and setSelectedRoi().
size_t WROIManager::m_size [private] |
number of fibers in the dataset
Definition at line 206 of file WROIManager.h.