28 #include "../common/WAssert.h"
30 #include "../graphicsEngine/WGraphicsEngine.h"
32 #include "WROIManager.h"
47 toBranch->addRoi( newRoi );
49 for( std::list< boost::shared_ptr< boost::function<
void( osg::ref_ptr< WROI > ) > > >::iterator iter =
m_addNotifiers.begin();
64 boost::shared_ptr< WRMBranch > newBranch(
new WRMBranch( shared_from_this() ) );
75 boost::shared_ptr< WRMBranch > branch;
76 for( std::list< boost::shared_ptr< WRMBranch > >::iterator iter =
m_branches.begin(); iter !=
m_branches.end(); ++iter )
78 if( ( *iter ).get()->contains( parentRoi ) )
84 branch->addRoi( newRoi );
86 for( std::list< boost::shared_ptr< boost::function<
void( osg::ref_ptr< WROI > ) > > >::iterator iter =
m_addNotifiers.begin();
97 for( std::list< boost::shared_ptr< WRMBranch > >::iterator iter =
m_branches.begin(); iter !=
m_branches.end(); ++iter )
99 ( *iter )->removeRoi( roi );
101 if( ( *iter )->empty() )
103 for( std::list< boost::shared_ptr< boost::function<
void( boost::shared_ptr< WRMBranch > ) > > >::iterator iter2
108 ( **iter2 )( *iter );
116 for( std::list< boost::shared_ptr< boost::function<
void( osg::ref_ptr< WROI > ) > > >::iterator iter
127 for( std::list< boost::shared_ptr< WRMBranch > >::iterator iter =
m_branches.begin(); iter !=
m_branches.end(); ++iter )
129 if( roi == ( *iter )->getFirstRoi() )
131 ( *iter )->removeAllRois();
134 if( ( *iter )->empty() )
136 for( std::list< boost::shared_ptr< boost::function<
void( boost::shared_ptr< WRMBranch > ) > > >::iterator iter2
141 ( **iter2 )( *iter );
152 boost::shared_ptr< WRMBranch> branch;
154 for( std::list< boost::shared_ptr< WRMBranch > >::iterator iter =
m_branches.begin(); iter !=
m_branches.end(); ++iter )
156 if( ( *iter )->contains( roi ) )
171 boost::unique_lock< boost::shared_mutex > lock;
179 boost::unique_lock< boost::shared_mutex > lock;
181 std::list< boost::shared_ptr< boost::function< void( osg::ref_ptr< WROI > ) > > >::iterator it;
192 boost::unique_lock< boost::shared_mutex > lock;
200 boost::unique_lock< boost::shared_mutex > lock;
202 std::list< boost::shared_ptr< boost::function< void( osg::ref_ptr< WROI > ) > > >::iterator it;
213 boost::unique_lock< boost::shared_mutex > lock;
221 boost::unique_lock< boost::shared_mutex > lock;
223 std::list< boost::shared_ptr< boost::function< void( boost::shared_ptr< WRMBranch > ) > > >::iterator it;
246 for( std::list< boost::shared_ptr< WRMBranch > >::const_iterator iter =
m_branches.begin(); iter !=
m_branches.end(); ++iter )
248 ( *iter )->getRois( returnVec );
259 for( std::list< boost::shared_ptr< WRMBranch > >::const_iterator iter =
m_branches.begin(); iter !=
m_branches.end(); ++iter )
261 returnVec.push_back( *iter );
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
implements a branch in the tree like structure for rois
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
std::list< boost::shared_ptr< WRMBranch > > m_branches
list of branches in the logical tree structure
Class to manage properties of an object and to provide convenience methods for easy access and manipu...
static boost::shared_ptr< WGraphicsEngine > getGraphicsEngine()
Returns instance of the graphics engine.
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
std::vector< osg::ref_ptr< WROI > > ROIs
ROI list.
std::vector< boost::shared_ptr< WRMBranch > > Branches
Branches list.
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.
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.