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