OpenWalnut  1.5.0dev
Public Types | Public Member Functions | Private Attributes | List of all members
WROIManager Class Reference

Class to store and manage different ROI's for fiber selection. More...

#include <WROIManager.h>

+ Inheritance diagram for WROIManager:
+ Collaboration diagram for WROIManager:

Public Types

typedef std::vector< osg::ref_ptr< WROI > > ROIs
 ROI list. More...
 
typedef std::vector< std::shared_ptr< WRMBranch > > Branches
 Branches list. More...
 

Public Member Functions

 WROIManager ()
 standard constructor More...
 
 ~WROIManager ()
 destructor More...
 
std::shared_ptr< WRMBranchaddBranch ()
 Add a new branch. More...
 
void addRoi (osg::ref_ptr< WROI > newRoi)
 Adds a new main ROI. More...
 
void addRoi (osg::ref_ptr< WROI > newRoi, osg::ref_ptr< WROI > parentRoi)
 Adds a new ROI below a main ROI. More...
 
void addRoi (osg::ref_ptr< WROI > newRoi, std::shared_ptr< WRMBranch > toBranch)
 Add a ROI to a branch. More...
 
void removeRoi (osg::ref_ptr< WROI > roi)
 removes a roi More...
 
void removeBranch (osg::ref_ptr< WROI > roi)
 removes a branch More...
 
std::shared_ptr< WRMBranchgetBranch (osg::ref_ptr< WROI > roi)
 getter returns the branch item the roi is in More...
 
void setDirty ()
 sets the dirty flag which will cause recalculation of the bit field More...
 
bool dirty (bool reset=false)
 getter More...
 
void setSelectedRoi (osg::ref_ptr< WROI > roi)
 setter More...
 
osg::ref_ptr< WROIgetSelectedRoi ()
 getter More...
 
std::shared_ptr< WPropertiesgetProperties ()
 getter for the properties object More...
 
ROIs getRois () const
 getter More...
 
Branches getBranches () const
 Get a copy of the current branch list. More...
 

Private Attributes

std::list< std::shared_ptr< WRMBranch > > m_branches
 list of branches in the logical tree structure More...
 
std::shared_mutex m_associatedNotifiersLock
 Lock for associated notifiers set. More...
 
std::list< std::shared_ptr< boost::function< void(osg::ref_ptr< WROI >) > > > m_addNotifiers
 The notifiers connected to added rois by default. More...
 
std::list< std::shared_ptr< boost::function< void(osg::ref_ptr< WROI >) > > > m_removeNotifiers
 The notifiers connected to removed rois by default. More...
 
std::list< std::shared_ptr< boost::function< void(std::shared_ptr< WRMBranch >) > > > m_removeBranchNotifiers
 The notifiers connected to removed rois by default. More...
 
osg::ref_ptr< WROIm_selectedRoi
 stores a pointer to the currently selected roi More...
 
std::shared_ptr< WPropertiesm_properties
 The property object for the module. More...
 
WPropBool m_dirty
 dirty flag More...
 

Detailed Description

Class to store and manage different ROI's for fiber selection.

Definition at line 38 of file WROIManager.h.

Member Typedef Documentation

◆ Branches

typedef std::vector< std::shared_ptr< WRMBranch > > WROIManager::Branches

Branches list.

Definition at line 194 of file WROIManager.h.

◆ ROIs

typedef std::vector< osg::ref_ptr< WROI > > WROIManager::ROIs

ROI list.

Definition at line 183 of file WROIManager.h.

Constructor & Destructor Documentation

◆ WROIManager()

WROIManager::WROIManager ( )

standard constructor

Definition at line 33 of file WROIManager.cpp.

References m_dirty, and m_properties.

◆ ~WROIManager()

WROIManager::~WROIManager ( )

destructor

Definition at line 39 of file WROIManager.cpp.

Member Function Documentation

◆ addBranch()

std::shared_ptr< WRMBranch > WROIManager::addBranch ( )

Add a new branch.

Returns
the new branch.

Definition at line 60 of file WROIManager.cpp.

References m_branches.

Referenced by addRoi().

+ Here is the caller graph for this function:

◆ addRoi() [1/3]

void WROIManager::addRoi ( osg::ref_ptr< WROI newRoi)

Adds a new main ROI.

Parameters
newRoi

Definition at line 55 of file WROIManager.cpp.

References addBranch().

+ Here is the call graph for this function:

◆ addRoi() [2/3]

void WROIManager::addRoi ( osg::ref_ptr< WROI newRoi,
osg::ref_ptr< WROI parentRoi 
)

Adds a new ROI below a main ROI.

Parameters
newRoi
parentRoi

Definition at line 71 of file WROIManager.cpp.

References m_addNotifiers, and m_branches.

◆ addRoi() [3/3]

void WROIManager::addRoi ( osg::ref_ptr< WROI newRoi,
std::shared_ptr< WRMBranch toBranch 
)

Add a ROI to a branch.

Parameters
newRoithe new ROI to add
toBranchthe branch to add the ROI to.

Definition at line 43 of file WROIManager.cpp.

References m_addNotifiers.

◆ dirty()

bool WROIManager::dirty ( bool  reset = false)
inline

getter

Parameters
resetif true the dirty flag will be set to false
Returns
the dirty flag

Definition at line 241 of file WROIManager.h.

References m_dirty.

◆ getBranch()

std::shared_ptr< WRMBranch > WROIManager::getBranch ( osg::ref_ptr< WROI roi)

getter returns the branch item the roi is in

Parameters
roi
Returns
branch

Definition at line 149 of file WROIManager.cpp.

References m_branches.

◆ getBranches()

WROIManager::Branches WROIManager::getBranches ( ) const

Get a copy of the current branch list.

Please note that after getting the list, it might already have been changed by another thread.

Returns
the list of current branches

Definition at line 254 of file WROIManager.cpp.

References m_branches.

◆ getProperties()

std::shared_ptr< WProperties > WROIManager::getProperties ( )
inline

getter for the properties object

Returns
the properties object

Definition at line 251 of file WROIManager.h.

References m_properties.

◆ getRois()

WROIManager::ROIs WROIManager::getRois ( ) const

getter

Returns
all existing rois

Definition at line 243 of file WROIManager.cpp.

References m_branches.

◆ getSelectedRoi()

osg::ref_ptr< WROI > WROIManager::getSelectedRoi ( )

getter

Returns
Pointer to the currently (in the ROI manager) selected ROI

Definition at line 238 of file WROIManager.cpp.

References m_selectedRoi.

◆ removeBranch()

void WROIManager::removeBranch ( osg::ref_ptr< WROI roi)

removes a branch

Parameters
roithe first roi in the branch

Definition at line 124 of file WROIManager.cpp.

References m_branches, m_removeBranchNotifiers, and setDirty().

+ Here is the call graph for this function:

◆ removeRoi()

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

removes a roi

Parameters
roi

Definition at line 92 of file WROIManager.cpp.

References WGraphicsEngine::getGraphicsEngine(), m_branches, m_removeBranchNotifiers, m_removeNotifiers, and setDirty().

+ Here is the call graph for this function:

◆ setDirty()

void WROIManager::setDirty ( )

sets the dirty flag which will cause recalculation of the bit field

Definition at line 163 of file WROIManager.cpp.

References m_dirty.

Referenced by removeBranch(), and removeRoi().

+ Here is the caller graph for this function:

◆ setSelectedRoi()

void WROIManager::setSelectedRoi ( osg::ref_ptr< WROI roi)

setter

Parameters
roi

Definition at line 233 of file WROIManager.cpp.

References m_selectedRoi.

Member Data Documentation

◆ m_addNotifiers

std::list< std::shared_ptr< boost::function< void( osg::ref_ptr< WROI > ) > > > WROIManager::m_addNotifiers
private

The notifiers connected to added rois by default.

Definition at line 215 of file WROIManager.h.

Referenced by addRoi().

◆ m_associatedNotifiersLock

std::shared_mutex WROIManager::m_associatedNotifiersLock
private

Lock for associated notifiers set.

Definition at line 210 of file WROIManager.h.

◆ m_branches

std::list< std::shared_ptr< WRMBranch > > WROIManager::m_branches
private

list of branches in the logical tree structure

Definition at line 205 of file WROIManager.h.

Referenced by addBranch(), addRoi(), getBranch(), getBranches(), getRois(), removeBranch(), and removeRoi().

◆ m_dirty

WPropBool WROIManager::m_dirty
private

dirty flag

Definition at line 238 of file WROIManager.h.

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

◆ m_properties

std::shared_ptr< WProperties > WROIManager::m_properties
private

The property object for the module.

Definition at line 233 of file WROIManager.h.

Referenced by getProperties(), and WROIManager().

◆ m_removeBranchNotifiers

std::list< std::shared_ptr< boost::function< void( std::shared_ptr< WRMBranch > ) > > > WROIManager::m_removeBranchNotifiers
private

The notifiers connected to removed rois by default.

Definition at line 225 of file WROIManager.h.

Referenced by removeBranch(), and removeRoi().

◆ m_removeNotifiers

std::list< std::shared_ptr< boost::function< void( osg::ref_ptr< WROI > ) > > > WROIManager::m_removeNotifiers
private

The notifiers connected to removed rois by default.

Definition at line 220 of file WROIManager.h.

Referenced by removeRoi().

◆ m_selectedRoi

osg::ref_ptr< WROI > WROIManager::m_selectedRoi
private

stores a pointer to the currently selected roi

Definition at line 228 of file WROIManager.h.

Referenced by getSelectedRoi(), and setSelectedRoi().


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