30 #include <shared_mutex>
33 #include "WRMBranch.h"
38 class WROIManager:
public std::enable_shared_from_this< WROIManager >
63 void addRoi( osg::ref_ptr< WROI > newRoi );
71 void addRoi( osg::ref_ptr< WROI > newRoi, osg::ref_ptr< WROI > parentRoi );
79 void addRoi( osg::ref_ptr< WROI > newRoi, std::shared_ptr< WRMBranch > toBranch );
86 void removeRoi( osg::ref_ptr< WROI > roi );
101 std::shared_ptr< WRMBranch>
getBranch( osg::ref_ptr< WROI > roi );
113 bool dirty(
bool reset =
false );
122 void addAddNotifier( std::shared_ptr< boost::function<
void( osg::ref_ptr< WROI > ) > > notifier );
129 void removeAddNotifier( std::shared_ptr< boost::function<
void( osg::ref_ptr< WROI > ) > > notifier );
137 void addRemoveNotifier( std::shared_ptr< boost::function<
void( osg::ref_ptr< WROI > ) > > notifier );
144 void removeRemoveNotifier( std::shared_ptr< boost::function<
void( osg::ref_ptr< WROI > ) > > notifier );
151 void addRemoveBranchNotifier( std::shared_ptr< boost::function<
void( std::shared_ptr< WRMBranch > ) > > notifier );
158 void removeRemoveBranchNotifier( std::shared_ptr< boost::function<
void( std::shared_ptr< WRMBranch > ) > > notifier );
183 typedef std::vector< osg::ref_ptr< WROI > >
ROIs;
194 typedef std::vector< std::shared_ptr< WRMBranch > >
Branches;
215 std::list< std::shared_ptr< boost::function< void( osg::ref_ptr< WROI > ) > > >
m_addNotifiers;
220 std::list< std::shared_ptr< boost::function< void( osg::ref_ptr< WROI > ) > > >
m_removeNotifiers;
Class to store and manage different ROI's for fiber selection.
std::list< std::shared_ptr< WRMBranch > > m_branches
list of branches in the logical tree structure
std::shared_ptr< WProperties > m_properties
The property object for the module.
std::list< std::shared_ptr< boost::function< void(osg::ref_ptr< WROI >) > > > m_removeNotifiers
The notifiers connected to removed rois by default.
void setSelectedRoi(osg::ref_ptr< WROI > roi)
setter
std::shared_ptr< WRMBranch > getBranch(osg::ref_ptr< WROI > roi)
getter returns the branch item the roi is in
std::list< std::shared_ptr< boost::function< void(std::shared_ptr< WRMBranch >) > > > m_removeBranchNotifiers
The notifiers connected to removed rois by default.
std::vector< std::shared_ptr< WRMBranch > > Branches
Branches list.
void setDirty()
sets the dirty flag which will cause recalculation of the bit field
WPropBool m_dirty
dirty flag
std::vector< osg::ref_ptr< WROI > > ROIs
ROI list.
WROIManager()
standard constructor
std::shared_ptr< WRMBranch > addBranch()
Add a new branch.
void removeBranch(osg::ref_ptr< WROI > roi)
removes a branch
ROIs getRois() const
getter
Branches getBranches() const
Get a copy of the current branch list.
void removeRoi(osg::ref_ptr< WROI > roi)
removes a roi
osg::ref_ptr< WROI > getSelectedRoi()
getter
osg::ref_ptr< WROI > m_selectedRoi
stores a pointer to the currently selected roi
std::list< std::shared_ptr< boost::function< void(osg::ref_ptr< WROI >) > > > m_addNotifiers
The notifiers connected to added rois by default.
void addRoi(osg::ref_ptr< WROI > newRoi)
Adds a new main ROI.
std::shared_ptr< WProperties > getProperties()
getter for the properties object
bool dirty(bool reset=false)
getter
std::shared_mutex m_associatedNotifiersLock
Lock for associated notifiers set.