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

TODO(schurade): Document this! More...

#include <WSelectorBranch.h>

+ Collaboration diagram for WSelectorBranch:

Public Member Functions

 WSelectorBranch (std::shared_ptr< const WDataSetFibers > fibers, std::shared_ptr< WRMBranch > branch)
 constructor More...
 
 ~WSelectorBranch ()
 destructor More...
 
std::shared_ptr< std::vector< bool > > getBitField ()
 getter More...
 
std::shared_ptr< WRMBranchgetBranch ()
 getter More...
 
void addRoi (std::shared_ptr< WSelectorRoi > roi)
 adds a roi to the branch More...
 
std::list< std::shared_ptr< WSelectorRoi > > getROIs ()
 Queries the ROIs. More...
 
void removeRoi (osg::ref_ptr< WROI > roi)
 Removes a roi fromt he branch. More...
 
bool empty ()
 Checks if empty. More...
 
void setDirty ()
 Sets the dirty flag. More...
 
bool dirty ()
 Checks if branch is dirty. More...
 
WColor getBranchColor () const
 Return the current branch color. More...
 

Private Member Functions

void recalculate ()
 updates the output bitfield with the information from all rois in this branch More...
 

Private Attributes

std::shared_ptr< const WDataSetFibersm_fibers
 Pointer to the fiber data set. More...
 
size_t m_size
 size of the fiber dataset, stored for convinience More...
 
bool m_dirty
 dirty flag More...
 
std::shared_ptr< std::vector< bool > > m_bitField
 the bitfield given to the outside world More...
 
std::shared_ptr< std::vector< bool > > m_workerBitfield
 the bitfield we work on More...
 
std::list< std::shared_ptr< WSelectorRoi > > m_rois
 list of rois in this branch More...
 
std::shared_ptr< WRMBranchm_branch
 pointer to the branch object in the roi manager More...
 
std::shared_ptr< boost::function< void() > > m_changeSignal
 Signal that can be used to update the selector branch. More...
 
std::shared_ptr< boost::function< void() > > m_changeRoiSignal
 Signal that can be used to update the selector branch. More...
 

Detailed Description

TODO(schurade): Document this!

Definition at line 38 of file WSelectorBranch.h.

Constructor & Destructor Documentation

◆ WSelectorBranch()

WSelectorBranch::WSelectorBranch ( std::shared_ptr< const WDataSetFibers fibers,
std::shared_ptr< WRMBranch branch 
)

constructor

Parameters
fiberspointer to the fiber dataset to work on
branchpointer to the branch object in the roi manager

Definition at line 31 of file WSelectorBranch.cpp.

References m_bitField, m_branch, m_changeRoiSignal, m_changeSignal, m_size, and setDirty().

+ Here is the call graph for this function:

◆ ~WSelectorBranch()

WSelectorBranch::~WSelectorBranch ( )

destructor

Definition at line 47 of file WSelectorBranch.cpp.

References m_branch, m_changeRoiSignal, m_changeSignal, and m_rois.

Member Function Documentation

◆ addRoi()

void WSelectorBranch::addRoi ( std::shared_ptr< WSelectorRoi roi)

adds a roi to the branch

Parameters
roi

Definition at line 58 of file WSelectorBranch.cpp.

References m_changeRoiSignal, and m_rois.

◆ dirty()

bool WSelectorBranch::dirty ( )
inline

Checks if branch is dirty.

Returns
true if dirty

Definition at line 173 of file WSelectorBranch.h.

References m_dirty.

◆ empty()

bool WSelectorBranch::empty ( )
inline

Checks if empty.

Returns
true when this branch contains no rois

Definition at line 168 of file WSelectorBranch.h.

References m_rois.

◆ getBitField()

std::shared_ptr< std::vector< bool > > WSelectorBranch::getBitField ( )
inline

getter

Returns
the bitfield that is created from all rois in this branch

Definition at line 154 of file WSelectorBranch.h.

References m_bitField, m_dirty, and recalculate().

+ Here is the call graph for this function:

◆ getBranch()

std::shared_ptr< WRMBranch > WSelectorBranch::getBranch ( )
inline

getter

Returns
pointer to the branch object, mainly for deletion and update purposes

Definition at line 163 of file WSelectorBranch.h.

References m_branch.

◆ getBranchColor()

WColor WSelectorBranch::getBranchColor ( ) const

Return the current branch color.

Returns
the color

Definition at line 142 of file WSelectorBranch.cpp.

References m_branch.

◆ getROIs()

std::list< std::shared_ptr< WSelectorRoi > > WSelectorBranch::getROIs ( )

Queries the ROIs.

Returns
A copy of the list of WSelectorRois

Definition at line 64 of file WSelectorBranch.cpp.

References m_rois.

◆ recalculate()

void WSelectorBranch::recalculate ( )
private

updates the output bitfield with the information from all rois in this branch

Definition at line 87 of file WSelectorBranch.cpp.

References m_bitField, m_branch, m_rois, m_size, and m_workerBitfield.

Referenced by getBitField().

+ Here is the caller graph for this function:

◆ removeRoi()

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

Removes a roi fromt he branch.

Parameters
roi

Definition at line 74 of file WSelectorBranch.cpp.

References m_changeRoiSignal, and m_rois.

◆ setDirty()

void WSelectorBranch::setDirty ( )

Sets the dirty flag.

Definition at line 69 of file WSelectorBranch.cpp.

References m_dirty.

Referenced by WSelectorBranch().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_bitField

std::shared_ptr< std::vector< bool > > WSelectorBranch::m_bitField
private

the bitfield given to the outside world

Definition at line 133 of file WSelectorBranch.h.

Referenced by getBitField(), recalculate(), and WSelectorBranch().

◆ m_branch

std::shared_ptr< WRMBranch > WSelectorBranch::m_branch
private

pointer to the branch object in the roi manager

Definition at line 148 of file WSelectorBranch.h.

Referenced by getBranch(), getBranchColor(), recalculate(), WSelectorBranch(), and ~WSelectorBranch().

◆ m_changeRoiSignal

std::shared_ptr< boost::function< void() > > WSelectorBranch::m_changeRoiSignal
private

Signal that can be used to update the selector branch.

Definition at line 151 of file WSelectorBranch.h.

Referenced by addRoi(), removeRoi(), WSelectorBranch(), and ~WSelectorBranch().

◆ m_changeSignal

std::shared_ptr< boost::function< void() > > WSelectorBranch::m_changeSignal
private

Signal that can be used to update the selector branch.

Definition at line 150 of file WSelectorBranch.h.

Referenced by WSelectorBranch(), and ~WSelectorBranch().

◆ m_dirty

bool WSelectorBranch::m_dirty
private

dirty flag

Definition at line 128 of file WSelectorBranch.h.

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

◆ m_fibers

std::shared_ptr< const WDataSetFibers > WSelectorBranch::m_fibers
private

Pointer to the fiber data set.

Definition at line 121 of file WSelectorBranch.h.

◆ m_rois

std::list< std::shared_ptr< WSelectorRoi > > WSelectorBranch::m_rois
private

list of rois in this branch

Definition at line 143 of file WSelectorBranch.h.

Referenced by addRoi(), empty(), getROIs(), recalculate(), removeRoi(), and ~WSelectorBranch().

◆ m_size

size_t WSelectorBranch::m_size
private

size of the fiber dataset, stored for convinience

Definition at line 126 of file WSelectorBranch.h.

Referenced by recalculate(), and WSelectorBranch().

◆ m_workerBitfield

std::shared_ptr< std::vector< bool > > WSelectorBranch::m_workerBitfield
private

the bitfield we work on

Definition at line 138 of file WSelectorBranch.h.

Referenced by recalculate().


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