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

class implements the updating of a bitfield for a roi More...

#include <WSelectorRoi.h>

+ Collaboration diagram for WSelectorRoi:

Public Member Functions

 WSelectorRoi (osg::ref_ptr< WROI > roi, std::shared_ptr< const WDataSetFibers > fibers, std::shared_ptr< WKdTree > kdTree)
 constructor More...
 
 ~WSelectorRoi ()
 destructor More...
 
std::shared_ptr< std::vector< bool > > getBitField ()
 getter More...
 
osg::ref_ptr< WROIgetRoi ()
 getter access to the ROI representation, mainly for delete and update functions More...
 
void setDirty ()
 setter sets the dirty flag More...
 

Private Member Functions

void recalculate ()
 updates the output bitfiel when something with the rois has changed More...
 
void boxTest (int left, int right, int axis)
 recursive function to check for intersections with the roi More...
 
size_t getLineForPoint (size_t point)
 getter More...
 

Private Attributes

osg::ref_ptr< WROIm_roi
 pointer to the roi More...
 
std::shared_ptr< const WDataSetFibersm_fibers
 Pointer to the fiber data set. More...
 
std::shared_ptr< WKdTreem_kdTree
 Stores a pointer to the kdTree used for fiber selection. 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 that is given to the outside world More...
 
std::shared_ptr< std::vector< bool > > m_workerBitfield
 the bitfield we work on More...
 
std::shared_ptr< std::vector< float > > m_currentArray
 pointer to the array that is used for updating this is used for the recurse update function, to reduce the amount of function parameters More...
 
std::shared_ptr< std::vector< size_t > > m_currentReverse
 pointer to the reverse array that is used for updating this is used for the recurse update function, to reduce the amount of function parameters More...
 
std::vector< float > m_boxMin
 lower boundary of the box, used for boxtest More...
 
std::vector< float > m_boxMax
 upper boundary of the box, used for boxtest More...
 
std::shared_ptr< boost::function< void() > > m_changeRoiSignal
 Signal that can be used to update the selector ROI. More...
 

Detailed Description

class implements the updating of a bitfield for a roi

Definition at line 39 of file WSelectorRoi.h.

Constructor & Destructor Documentation

◆ WSelectorRoi()

WSelectorRoi::WSelectorRoi ( osg::ref_ptr< WROI roi,
std::shared_ptr< const WDataSetFibers fibers,
std::shared_ptr< WKdTree kdTree 
)

constructor

Parameters
roithe roi representation
fibersthe fiber dataset to work on
kdTreekd tree for fast intersection checks

Definition at line 34 of file WSelectorRoi.cpp.

References m_bitField, m_changeRoiSignal, m_currentArray, m_currentReverse, m_fibers, m_roi, m_size, and setDirty().

+ Here is the call graph for this function:

◆ ~WSelectorRoi()

WSelectorRoi::~WSelectorRoi ( )

destructor

Definition at line 51 of file WSelectorRoi.cpp.

References m_changeRoiSignal, and m_roi.

Member Function Documentation

◆ boxTest()

void WSelectorRoi::boxTest ( int  left,
int  right,
int  axis 
)
private

recursive function to check for intersections with the roi

Parameters
left
right
axis

Definition at line 112 of file WSelectorRoi.cpp.

References getLineForPoint(), m_boxMax, m_boxMin, m_currentArray, and m_kdTree.

Referenced by recalculate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBitField()

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

getter

Returns
the bitfield for this ROI

Definition at line 151 of file WSelectorRoi.h.

References m_bitField, m_dirty, and recalculate().

+ Here is the call graph for this function:

◆ getLineForPoint()

size_t WSelectorRoi::getLineForPoint ( size_t  point)
inlineprivate

getter

Parameters
pointpoint to check
Returns
the index of the line the point is part of

Definition at line 160 of file WSelectorRoi.h.

References m_currentReverse.

Referenced by boxTest(), and recalculate().

+ Here is the caller graph for this function:

◆ getRoi()

osg::ref_ptr< WROI > WSelectorRoi::getRoi ( )
inline

getter access to the ROI representation, mainly for delete and update functions

Returns
Pointer to the ROI representation

Definition at line 165 of file WSelectorRoi.h.

References m_roi.

◆ recalculate()

void WSelectorRoi::recalculate ( )
private

updates the output bitfiel when something with the rois has changed

Definition at line 61 of file WSelectorRoi.cpp.

References boxTest(), getLineForPoint(), m_bitField, m_boxMax, m_boxMin, m_currentArray, m_dirty, m_roi, m_size, and m_workerBitfield.

Referenced by getBitField().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDirty()

void WSelectorRoi::setDirty ( )

setter sets the dirty flag

Definition at line 56 of file WSelectorRoi.cpp.

References m_dirty.

Referenced by WSelectorRoi().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_bitField

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

the bitfield that is given to the outside world

Definition at line 126 of file WSelectorRoi.h.

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

◆ m_boxMax

std::vector<float> WSelectorRoi::m_boxMax
private

upper boundary of the box, used for boxtest

Definition at line 146 of file WSelectorRoi.h.

Referenced by boxTest(), and recalculate().

◆ m_boxMin

std::vector<float> WSelectorRoi::m_boxMin
private

lower boundary of the box, used for boxtest

Definition at line 145 of file WSelectorRoi.h.

Referenced by boxTest(), and recalculate().

◆ m_changeRoiSignal

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

Signal that can be used to update the selector ROI.

Definition at line 148 of file WSelectorRoi.h.

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

◆ m_currentArray

std::shared_ptr< std::vector< float > > WSelectorRoi::m_currentArray
private

pointer to the array that is used for updating this is used for the recurse update function, to reduce the amount of function parameters

Definition at line 137 of file WSelectorRoi.h.

Referenced by boxTest(), recalculate(), and WSelectorRoi().

◆ m_currentReverse

std::shared_ptr< std::vector< size_t > > WSelectorRoi::m_currentReverse
private

pointer to the reverse array that is used for updating this is used for the recurse update function, to reduce the amount of function parameters

Definition at line 143 of file WSelectorRoi.h.

Referenced by getLineForPoint(), and WSelectorRoi().

◆ m_dirty

bool WSelectorRoi::m_dirty
private

dirty flag

Definition at line 121 of file WSelectorRoi.h.

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

◆ m_fibers

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

Pointer to the fiber data set.

Definition at line 106 of file WSelectorRoi.h.

Referenced by WSelectorRoi().

◆ m_kdTree

std::shared_ptr< WKdTree > WSelectorRoi::m_kdTree
private

Stores a pointer to the kdTree used for fiber selection.

Definition at line 111 of file WSelectorRoi.h.

Referenced by boxTest().

◆ m_roi

osg::ref_ptr< WROI > WSelectorRoi::m_roi
private

pointer to the roi

Definition at line 101 of file WSelectorRoi.h.

Referenced by getRoi(), recalculate(), WSelectorRoi(), and ~WSelectorRoi().

◆ m_size

size_t WSelectorRoi::m_size
private

size of the fiber dataset, stored for convinience

Definition at line 116 of file WSelectorRoi.h.

Referenced by recalculate(), and WSelectorRoi().

◆ m_workerBitfield

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

the bitfield we work on

Definition at line 131 of file WSelectorRoi.h.

Referenced by recalculate().


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