OpenWalnut 1.2.5
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 Member Functions

 WRMBranch (boost::shared_ptr< WROIManager > roiManager)
 construtor
 ~WRMBranch ()
 destructor
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
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.

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::list< 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.
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 45 of file WRMBranch.h.


Constructor & Destructor Documentation

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

construtor

Parameters:
roiManager

Definition at line 34 of file WRMBranch.cpp.

References properties().

WRMBranch::~WRMBranch ( )

destructor

Definition at line 40 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 141 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 62 of file WRMBranch.cpp.

References m_changeRoiSignal, m_rois, and setDirty().

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 70 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 206 of file WRMBranch.h.

References m_dirty.

bool WRMBranch::empty ( ) [inline]

returns whether the branch is empty.

Returns:
true if empty.

Definition at line 201 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 126 of file WRMBranch.cpp.

References m_rois.

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

returns the properties object.

Returns:
the properties of this branch

Definition at line 136 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 131 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 96 of file WRMBranch.cpp.

References m_rois.

bool WRMBranch::isNot ( ) [inline]

getter for the NOT flag

Returns:
flag

Definition at line 216 of file WRMBranch.h.

References m_isNot.

void WRMBranch::properties ( ) [protected]

initializes properties

Definition at line 44 of file WRMBranch.cpp.

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

Referenced by WRMBranch().

void WRMBranch::propertyChanged ( ) [protected]

slot gets called when a property has changed

Definition at line 56 of file WRMBranch.cpp.

References setDirty().

Referenced by properties().

void WRMBranch::removeAllRois ( )

removes all rois from the branch

Definition at line 104 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 149 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 82 of file WRMBranch.cpp.

References m_changeRoiSignal, m_rois, and setDirty().

void WRMBranch::setDirty ( )

sets dirty flag true and notifies the branch

Definition at line 114 of file WRMBranch.cpp.

References m_changeNotifiers, m_dirty, and m_roiManager.

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


Member Data Documentation

boost::shared_mutex WRMBranch::m_associatedNotifiersLock [private]

Lock for associated notifiers set.

Definition at line 198 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 186 of file WRMBranch.h.

Referenced by properties().

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

The notifiers connected to added rois by default.

Definition at line 191 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 193 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 176 of file WRMBranch.h.

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

WPropBool WRMBranch::m_isNot [private]

indicates if the branch is negated

Definition at line 181 of file WRMBranch.h.

Referenced by isNot(), and properties().

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

the property object for the module

Definition at line 174 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 167 of file WRMBranch.h.

Referenced by getRoiManager(), and setDirty().

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

list of rois in this this branch,

Definition at line 169 of file WRMBranch.h.

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


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends