31 #include <boost/enable_shared_from_this.hpp>
33 #include "WRMBranch.h"
40 class WROIManager:
public boost::enable_shared_from_this< WROIManager >
58 boost::shared_ptr< WRMBranch >
addBranch();
66 void addRoi( osg::ref_ptr< WROI > newRoi );
75 void addRoi( osg::ref_ptr< WROI > newRoi, osg::ref_ptr< WROI > parentRoi );
83 void addRoi( osg::ref_ptr< WROI > newRoi, boost::shared_ptr< WRMBranch > toBranch );
90 void removeRoi( osg::ref_ptr< WROI > roi );
105 boost::shared_ptr< WRMBranch>
getBranch( osg::ref_ptr< WROI > roi );
117 bool dirty(
bool reset =
false );
124 void addAddNotifier( boost::shared_ptr< boost::function<
void( osg::ref_ptr< WROI > ) > > notifier );
131 void removeAddNotifier( boost::shared_ptr< boost::function<
void( osg::ref_ptr< WROI > ) > > notifier );
139 void addRemoveNotifier( boost::shared_ptr< boost::function<
void( osg::ref_ptr< WROI > ) > > notifier );
146 void removeRemoveNotifier( boost::shared_ptr< boost::function<
void( osg::ref_ptr< WROI > ) > > notifier );
153 void addRemoveBranchNotifier( boost::shared_ptr< boost::function<
void( boost::shared_ptr< WRMBranch > ) > > notifier );
184 typedef std::vector< osg::ref_ptr< WROI > >
ROIs;
195 typedef std::vector< boost::shared_ptr< WRMBranch > >
Branches;
218 std::list< boost::shared_ptr< boost::function< void( osg::ref_ptr< WROI > ) > > >
m_addNotifiers;
223 std::list< boost::shared_ptr< boost::function< void( osg::ref_ptr< WROI > ) > > >
m_removeNotifiers;
259 #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.