34 #include <boost/enable_shared_from_this.hpp>
37 #include "../common/WProperties.h"
39 #include "../graphicsEngine/WROI.h"
46 class WRMBranch :
public boost::enable_shared_from_this< WRMBranch >
52 typedef boost::shared_ptr< WRMBranch >
SPtr;
57 typedef boost::shared_ptr< const WRMBranch >
ConstSPtr;
63 explicit WRMBranch( boost::shared_ptr< WROIManager > roiManager );
103 void addRoi( osg::ref_ptr< WROI > roi );
110 void removeRoi( osg::ref_ptr< WROI > roi );
124 bool dirty(
bool reset =
false );
143 bool contains( osg::ref_ptr< WROI > roi );
176 void getRois( std::vector< osg::ref_ptr< WROI > >& roiVec );
183 std::vector< osg::ref_ptr< WROI > >
getRois()
const;
190 void addChangeNotifier( boost::shared_ptr< boost::function<
void() > > notifier );
206 template <
typename Comparator >
207 void sort( Comparator comp );
223 std::vector< osg::ref_ptr< WROI > >
m_rois;
280 template <
typename Comparator >
287 #endif // WRMBRANCH_H
std::vector< osg::ref_ptr< WROI > > getRois() const
Create a list of ROIs of the current point in time.
WPropBool m_isNot
indicates if the branch is negated
void addChangeNotifier(boost::shared_ptr< boost::function< void() > > notifier)
Add a specified notifier to the list of default notifiers which get connected to each branch...
WPropColor m_bundleColor
The color used when in isosurface mode for blending.
boost::shared_ptr< const WRMBranch > ConstSPtr
Convenience type for a const shared pointer of this type.
std::vector< osg::ref_ptr< WROI > > m_rois
list of rois in this this branch,
implements a branch in the tree like structure for rois
osg::ref_ptr< WROI > getFirstRoi()
returns a pointer to the first roi in the branch
void setDirty()
sets dirty flag true and notifies the branch
void properties()
initializes properties
boost::shared_ptr< boost::function< void() > > m_changeRoiSignal
Signal that can be used to update the ROImanager branch.
bool isNot()
getter for the NOT flag
bool contains(osg::ref_ptr< WROI > roi)
checks wether a roi is in this branch
void sort(Comparator comp)
Resorts the ROIs using the specified comparator from its begin to its end.
boost::shared_ptr< WRMBranch > SPtr
Convenience type for a shared pointer of this type.
WPropertyGroup::SPtr getProperties() const
Get the properties of this branch as group.
boost::shared_mutex m_associatedNotifiersLock
Lock for associated notifiers set.
boost::shared_ptr< WROIManager > getRoiManager()
getter for roi manager pointer
Class to store and manage different ROI's for fiber selection.
void removeChangeNotifier(boost::shared_ptr< boost::function< void() > > notifier)
Remove a specified notifier from the list of default notifiers which get connected to each branch...
boost::shared_ptr< WROIManager > m_roiManager
stores a pointer to the roi manager
WPropColor colorProperty()
The branch color property.
boost::shared_ptr< WPropertyGroup > SPtr
shared pointer to object of this type
std::list< boost::shared_ptr< boost::function< void() > > > m_changeNotifiers
The notifiers connected to added rois by default.
bool empty()
returns whether the branch is empty.
void propertyChanged()
slot gets called when a property has changed
WRMBranch(boost::shared_ptr< WROIManager > roiManager)
construtor
void removeRoi(osg::ref_ptr< WROI > roi)
removes a roi from the branch
boost::shared_ptr< WProperties > m_properties
the property object for the module
WPropBool m_dirty
dirty flag to indicate if anything has changed within the branch
WPropString m_name
Name property.
WPropString nameProperty()
Get name property.
void removeAllRois()
removes all rois from the branch
void addRoi(osg::ref_ptr< WROI > roi)
adds a roi to the branch
bool dirty(bool reset=false)
getter for dirty flag
WPropBool invertProperty()
Get the "not" property.