OpenWalnut  1.4.0
Public Types | Public Member Functions | Private Attributes
WROIManager Class Reference

Class to store and manage different ROI's for fiber selection. More...

#include <WROIManager.h>

+ Inheritance diagram for WROIManager:

List of all members.

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< WRMBranchaddBranch ()
 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< WRMBranchgetBranch (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< WROIgetSelectedRoi ()
 getter
boost::shared_ptr< WPropertiesgetProperties ()
 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< WROIm_selectedRoi
 stores a pointer to the currently selected roi
boost::shared_ptr< WPropertiesm_properties
 The property object for the module.
WPropBool m_dirty
 dirty flag

Detailed Description

Class to store and manage different ROI's for fiber selection.

Definition at line 40 of file WROIManager.h.


Member Typedef Documentation

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Parameters:
notifierthe 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.

Returns:
the 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.

Parameters:
notifierthe 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.

Parameters:
notifierthe 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

Parameters:
newRoi
Returns:
ROI representation which can be used to remove the ROI

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

Parameters:
newRoi
parentRoi
Returns:
ROI representation which can be used to remove the ROI

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.

Parameters:
newRoithe new ROI to add
toBranchthe 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

Parameters:
resetif true the dirty flag will be set to false
Returns:
the dirty flag

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

Parameters:
roi
Returns:
branch

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.

Returns:
the list of current branches

Definition at line 253 of file WROIManager.cpp.

References m_branches.

boost::shared_ptr< WProperties > WROIManager::getProperties ( ) [inline]

getter for the properties object

Returns:
the properties object

Definition at line 254 of file WROIManager.h.

References m_properties.

getter

Returns:
all existing rois

Definition at line 242 of file WROIManager.cpp.

References m_branches.

osg::ref_ptr< WROI > WROIManager::getSelectedRoi ( )

getter

Returns:
Pointer to the currently (in the ROI manager) selected ROI

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.

Parameters:
notifierthe 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

Parameters:
roithe 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.

Parameters:
notifierthe 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.

Parameters:
notifierthe 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

Parameters:
roi

Definition at line 93 of file WROIManager.cpp.

References WGraphicsEngine::getGraphicsEngine(), m_branches, m_removeBranchNotifiers, m_removeNotifiers, and 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)

setter

Parameters:
roi

Definition at line 232 of file WROIManager.cpp.

References m_selectedRoi.


Member Data Documentation

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]
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().

number of fibers in the dataset

Definition at line 206 of file WROIManager.h.


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