32 #include <boost/enable_shared_from_this.hpp>
35 #include "WRMBranch.h"
42 class WROIManager:
public boost::enable_shared_from_this< WROIManager >
60 boost::shared_ptr< WRMBranch >
addBranch();
68 void addRoi( osg::ref_ptr< WROI > newRoi );
77 void addRoi( osg::ref_ptr< WROI > newRoi, osg::ref_ptr< WROI > parentRoi );
85 void addRoi( osg::ref_ptr< WROI > newRoi, boost::shared_ptr< WRMBranch > toBranch );
92 void removeRoi( osg::ref_ptr< WROI > roi );
107 boost::shared_ptr< WRMBranch>
getBranch( osg::ref_ptr< WROI > roi );
119 bool dirty(
bool reset =
false );
126 void addAddNotifier( boost::shared_ptr< boost::function<
void( osg::ref_ptr< WROI > ) > > notifier );
133 void removeAddNotifier( boost::shared_ptr< boost::function<
void( osg::ref_ptr< WROI > ) > > notifier );
141 void addRemoveNotifier( boost::shared_ptr< boost::function<
void( osg::ref_ptr< WROI > ) > > notifier );
148 void removeRemoveNotifier( boost::shared_ptr< boost::function<
void( osg::ref_ptr< WROI > ) > > notifier );
155 void addRemoveBranchNotifier( boost::shared_ptr< boost::function<
void( boost::shared_ptr< WRMBranch > ) > > notifier );
186 typedef std::vector< osg::ref_ptr< WROI > >
ROIs;
197 typedef std::vector< boost::shared_ptr< WRMBranch > >
Branches;
220 std::list< boost::shared_ptr< boost::function< void( osg::ref_ptr< WROI > ) > > >
m_addNotifiers;
225 std::list< boost::shared_ptr< boost::function< void( osg::ref_ptr< WROI > ) > > >
m_removeNotifiers;
261 #endif // WROIMANAGER_H
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 ro...
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 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...
std::list< boost::shared_ptr< boost::function< void(osg::ref_ptr< WROI >) > > > m_addNotifiers
The notifiers connected to added rois by default.
boost::shared_ptr< WProperties > m_properties
The property object for the module.
void removeRoi(osg::ref_ptr< WROI > roi)
removes a 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...
osg::ref_ptr< WROI > getSelectedRoi()
getter
Branches getBranches() const
Get a copy of the current branch list.
void addRoi(osg::ref_ptr< WROI > newRoi)
adds a new master ROI
WPropBool m_dirty
dirty flag
void setDirty()
sets the dirty flag which will cause recalculation of the bit field
boost::shared_ptr< WRMBranch > getBranch(osg::ref_ptr< WROI > roi)
getter returns the branch item the roi is in
ROIs getRois() const
getter
osg::ref_ptr< WROI > m_selectedRoi
stores a pointer to the currently selected roi
void removeBranch(osg::ref_ptr< WROI > roi)
removes a branch
boost::shared_ptr< WProperties > getProperties()
getter for the properties object
std::list< boost::shared_ptr< WRMBranch > > m_branches
list of branches in the logical tree structure
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...
WROIManager()
standard constructor
Class to store and manage different ROI's for fiber selection.
std::vector< osg::ref_ptr< WROI > > ROIs
ROI list.
std::vector< boost::shared_ptr< WRMBranch > > Branches
Branches list.
size_t m_size
number of fibers in the dataset
boost::shared_mutex m_associatedNotifiersLock
Lock for associated notifiers set.
std::list< boost::shared_ptr< boost::function< void(osg::ref_ptr< WROI >) > > > m_removeNotifiers
The notifiers connected to removed rois by default.
bool dirty(bool reset=false)
getter
std::list< boost::shared_ptr< boost::function< void(boost::shared_ptr< WRMBranch >) > > > m_removeBranchNotifiers
The notifiers connected to removed rois by default.
void setSelectedRoi(osg::ref_ptr< WROI > roi)
setter
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 br...
boost::shared_ptr< WRMBranch > addBranch()
Add a new branch.