OpenWalnut  1.4.0
Public Types | Public Member Functions | Protected Member Functions | Private Attributes
WRMBranch Class Reference

implements a branch in the tree like structure for rois More...

#include <WRMBranch.h>

+ Inheritance diagram for WRMBranch:

List of all members.

Public Types

typedef boost::shared_ptr
< WRMBranch
SPtr
 Convenience type for a shared pointer of this type.
typedef boost::shared_ptr
< const WRMBranch
ConstSPtr
 Convenience type for a const shared pointer of this type.

Public Member Functions

 WRMBranch (boost::shared_ptr< WROIManager > roiManager)
 construtor
 ~WRMBranch ()
 destructor
WPropString nameProperty ()
 Get name property.
WPropBool invertProperty ()
 Get the "not" property.
WPropColor colorProperty ()
 The branch color property.
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
void removeRoi (osg::ref_ptr< WROI > roi)
 removes a roi from the branch
void removeAllRois ()
 removes all rois from the branch
bool dirty (bool reset=false)
 getter for dirty flag
void setDirty ()
 sets dirty flag true and notifies the branch
bool empty ()
 returns whether the branch is empty.
bool contains (osg::ref_ptr< WROI > roi)
 checks wether a roi is in this branch
osg::ref_ptr< WROIgetFirstRoi ()
 returns a pointer to the first roi in the branch
boost::shared_ptr< WROIManagergetRoiManager ()
 getter for roi manager pointer
boost::shared_ptr< WPropertiesgetProperties ()
 returns the properties object.
bool isNot ()
 getter for the NOT flag
void getRois (std::vector< osg::ref_ptr< WROI > > &roiVec)
 add all the rois in this branch to a given vector
std::vector< osg::ref_ptr< WROI > > getRois () const
 Create a list of ROIs of the current point in time.
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.
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.
template<typename Comparator >
void sort (Comparator comp)
 Resorts the ROIs using the specified comparator from its begin to its end.

Protected Member Functions

void properties ()
 initializes properties
void propertyChanged ()
 slot gets called when a property has changed

Private Attributes

boost::shared_ptr< WROIManagerm_roiManager
 stores a pointer to the roi manager
std::vector< osg::ref_ptr< WROI > > m_rois
 list of rois in this this branch,
boost::shared_ptr< WPropertiesm_properties
 the property object for the module
WPropBool m_dirty
 dirty flag to indicate if anything has changed within the branch
WPropBool m_isNot
 indicates if the branch is negated
WPropColor m_bundleColor
 The color used when in isosurface mode for blending.
WPropString m_name
 Name property.
std::list< boost::shared_ptr
< boost::function< void() > > > 
m_changeNotifiers
 The notifiers connected to added rois by default.
boost::shared_ptr
< boost::function< void() > > 
m_changeRoiSignal
 Signal that can be used to update the ROImanager branch.
boost::shared_mutex m_associatedNotifiersLock
 Lock for associated notifiers set.

Detailed Description

implements a branch in the tree like structure for rois

Definition at line 44 of file WRMBranch.h.


Member Typedef Documentation

typedef boost::shared_ptr< const WRMBranch > WRMBranch::ConstSPtr

Convenience type for a const shared pointer of this type.

Definition at line 55 of file WRMBranch.h.

typedef boost::shared_ptr< WRMBranch > WRMBranch::SPtr

Convenience type for a shared pointer of this type.

Definition at line 50 of file WRMBranch.h.


Constructor & Destructor Documentation

WRMBranch::WRMBranch ( boost::shared_ptr< WROIManager roiManager) [explicit]

construtor

Parameters:
roiManager

Definition at line 35 of file WRMBranch.cpp.

References properties().

destructor

Definition at line 41 of file WRMBranch.cpp.


Member Function Documentation

void WRMBranch::addChangeNotifier ( boost::shared_ptr< boost::function< void() > >  notifier)

Add a specified notifier to the list of default notifiers which get connected to each branch.

Parameters:
notifierthe notifier function

Definition at line 172 of file WRMBranch.cpp.

References m_associatedNotifiersLock, and m_changeNotifiers.

void WRMBranch::addRoi ( osg::ref_ptr< WROI roi)

adds a roi to the branch

Parameters:
roi

Definition at line 84 of file WRMBranch.cpp.

References m_changeRoiSignal, m_rois, and setDirty().

WPropColor WRMBranch::colorProperty ( )

The branch color property.

Returns:
the color property

Definition at line 79 of file WRMBranch.cpp.

References m_bundleColor.

bool WRMBranch::contains ( osg::ref_ptr< WROI roi)

checks wether a roi is in this branch

Parameters:
roi
Returns:
true if the roi is in the branch, false otherwise

Definition at line 91 of file WRMBranch.cpp.

References m_rois.

bool WRMBranch::dirty ( bool  reset = false) [inline]

getter for dirty flag

Parameters:
resetwhen true the dirty flag will be set to false
Returns:
the dirty flag

Definition at line 263 of file WRMBranch.h.

References m_dirty.

bool WRMBranch::empty ( ) [inline]

returns whether the branch is empty.

Returns:
true if empty.

Definition at line 258 of file WRMBranch.h.

References m_rois.

osg::ref_ptr< WROI > WRMBranch::getFirstRoi ( )

returns a pointer to the first roi in the branch

Returns:
the roi

Definition at line 157 of file WRMBranch.cpp.

References m_rois.

Get the properties of this branch as group.

Returns:
branch property group

Definition at line 59 of file WRMBranch.cpp.

References m_properties.

boost::shared_ptr< WProperties > WRMBranch::getProperties ( )

returns the properties object.

Returns:
the properties of this branch

Definition at line 167 of file WRMBranch.cpp.

References m_properties.

boost::shared_ptr< WROIManager > WRMBranch::getRoiManager ( )

getter for roi manager pointer

Returns:
the roi manager

Definition at line 162 of file WRMBranch.cpp.

References m_roiManager.

void WRMBranch::getRois ( std::vector< osg::ref_ptr< WROI > > &  roiVec)

add all the rois in this branch to a given vector

Parameters:
roiVecthe vector to fill

Definition at line 117 of file WRMBranch.cpp.

References m_rois.

Create a list of ROIs of the current point in time.

Returns:
the ROIs

Definition at line 125 of file WRMBranch.cpp.

References m_rois.

Get the "not" property.

Returns:
the property

Definition at line 74 of file WRMBranch.cpp.

References m_isNot.

bool WRMBranch::isNot ( ) [inline]

getter for the NOT flag

Returns:
flag

Definition at line 273 of file WRMBranch.h.

References m_isNot.

WPropString WRMBranch::nameProperty ( )

Get name property.

Returns:
name property

Definition at line 69 of file WRMBranch.cpp.

References m_name.

void WRMBranch::properties ( ) [protected]

initializes properties

Definition at line 45 of file WRMBranch.cpp.

References m_bundleColor, m_changeRoiSignal, m_dirty, m_isNot, m_name, m_properties, propertyChanged(), and setDirty().

Referenced by WRMBranch().

void WRMBranch::propertyChanged ( ) [protected]

slot gets called when a property has changed

Definition at line 64 of file WRMBranch.cpp.

References setDirty().

Referenced by properties().

removes all rois from the branch

Definition at line 135 of file WRMBranch.cpp.

References WGraphicsEngine::getGraphicsEngine(), and m_rois.

void WRMBranch::removeChangeNotifier ( boost::shared_ptr< boost::function< void() > >  notifier)

Remove a specified notifier from the list of default notifiers which get connected to each branch.

Parameters:
notifierthe notifier function

Definition at line 180 of file WRMBranch.cpp.

References m_associatedNotifiersLock, and m_changeNotifiers.

void WRMBranch::removeRoi ( osg::ref_ptr< WROI roi)

removes a roi from the branch

Parameters:
roi

Definition at line 103 of file WRMBranch.cpp.

References m_changeRoiSignal, m_rois, and setDirty().

sets dirty flag true and notifies the branch

Definition at line 145 of file WRMBranch.cpp.

References m_changeNotifiers, m_dirty, and m_roiManager.

Referenced by addRoi(), properties(), propertyChanged(), and removeRoi().

template<typename Comparator >
void WRMBranch::sort ( Comparator  comp)

Resorts the ROIs using the specified comparator from its begin to its end.

Template Parameters:
Comparatorthe comparator type. Usually a boost::function or class providing the operator<().
Parameters:
compthe comparator

Definition at line 279 of file WRMBranch.h.

References m_rois.


Member Data Documentation

boost::shared_mutex WRMBranch::m_associatedNotifiersLock [private]

Lock for associated notifiers set.

Definition at line 255 of file WRMBranch.h.

Referenced by addChangeNotifier(), and removeChangeNotifier().

WPropColor WRMBranch::m_bundleColor [private]

The color used when in isosurface mode for blending.

Definition at line 238 of file WRMBranch.h.

Referenced by colorProperty(), and properties().

std::list< boost::shared_ptr< boost::function< void() > > > WRMBranch::m_changeNotifiers [private]

The notifiers connected to added rois by default.

Definition at line 248 of file WRMBranch.h.

Referenced by addChangeNotifier(), removeChangeNotifier(), and setDirty().

boost::shared_ptr< boost::function< void() > > WRMBranch::m_changeRoiSignal [private]

Signal that can be used to update the ROImanager branch.

Definition at line 250 of file WRMBranch.h.

Referenced by addRoi(), properties(), and removeRoi().

WPropBool WRMBranch::m_dirty [private]

dirty flag to indicate if anything has changed within the branch

Definition at line 228 of file WRMBranch.h.

Referenced by dirty(), properties(), and setDirty().

WPropBool WRMBranch::m_isNot [private]

indicates if the branch is negated

Definition at line 233 of file WRMBranch.h.

Referenced by invertProperty(), isNot(), and properties().

WPropString WRMBranch::m_name [private]

Name property.

Definition at line 243 of file WRMBranch.h.

Referenced by nameProperty(), and properties().

boost::shared_ptr< WProperties > WRMBranch::m_properties [private]

the property object for the module

Definition at line 226 of file WRMBranch.h.

Referenced by getProperties(), and properties().

boost::shared_ptr< WROIManager > WRMBranch::m_roiManager [private]

stores a pointer to the roi manager

Definition at line 219 of file WRMBranch.h.

Referenced by getRoiManager(), and setDirty().

std::vector< osg::ref_ptr< WROI > > WRMBranch::m_rois [private]

list of rois in this this branch,

Definition at line 221 of file WRMBranch.h.

Referenced by addRoi(), contains(), empty(), getFirstRoi(), getRois(), removeAllRois(), removeRoi(), and sort().


The documentation for this class was generated from the following files: