OpenWalnut  1.4.0
Public Member Functions | Private Attributes | List of all members
WFiberAccumulator Class Reference

A class that encapsulates the data needed to construct a WDataSetFibers. More...

#include <WFiberAccumulator.h>

Public Member Functions

 WFiberAccumulator ()
 Constructor. More...
 
virtual ~WFiberAccumulator ()
 Destructor. More...
 
void add (std::vector< WVector3d > const &in)
 Add a fiber to the dataset. More...
 
boost::shared_ptr< WDataSetFibersbuildDataSet ()
 Return the dataset that has been accumulated to this point and start a new dataset. More...
 
void clear ()
 Clears all data. More...
 

Private Attributes

boost::mutex m_fiberMutex
 A mutex needed to guarantee thread-safety. More...
 
boost::shared_ptr< std::vector< float > > m_points
 One of the vectors needed to construct a WDataSetFibers. More...
 
boost::shared_ptr< std::vector< size_t > > m_fiberIndices
 One of the vectors needed to construct a WDataSetFibers. More...
 
boost::shared_ptr< std::vector< size_t > > m_fiberLengths
 One of the vectors needed to construct a WDataSetFibers. More...
 
boost::shared_ptr< std::vector< size_t > > m_pointToFiber
 One of the vectors needed to construct a WDataSetFibers. More...
 

Detailed Description

A class that encapsulates the data needed to construct a WDataSetFibers.

Definition at line 41 of file WFiberAccumulator.h.

Constructor & Destructor Documentation

WFiberAccumulator::WFiberAccumulator ( )

Constructor.

Definition at line 33 of file WFiberAccumulator.cpp.

WFiberAccumulator::~WFiberAccumulator ( )
virtual

Destructor.

Definition at line 42 of file WFiberAccumulator.cpp.

Member Function Documentation

void WFiberAccumulator::add ( std::vector< WVector3d > const &  in)

Add a fiber to the dataset.

Parameters
inThe fiber to add, stored as a vector of Positions.

This function is threadsafe.

Definition at line 46 of file WFiberAccumulator.cpp.

References m_fiberIndices, m_fiberLengths, m_fiberMutex, m_points, and m_pointToFiber.

boost::shared_ptr< WDataSetFibers > WFiberAccumulator::buildDataSet ( )

Return the dataset that has been accumulated to this point and start a new dataset.

Returns
A shared_ptr pointing to the WDataSetFibers that has been accumulated.

The returned shared_ptr is the sole owner of the WDataSetFibers.

Definition at line 66 of file WFiberAccumulator.cpp.

References m_fiberIndices, m_fiberLengths, m_fiberMutex, m_points, and m_pointToFiber.

void WFiberAccumulator::clear ( )

Clears all data.

Definition at line 80 of file WFiberAccumulator.cpp.

References m_fiberIndices, m_fiberLengths, m_points, and m_pointToFiber.

Member Data Documentation

boost::shared_ptr< std::vector< size_t > > WFiberAccumulator::m_fiberIndices
private

One of the vectors needed to construct a WDataSetFibers.

Stores the starting indices (refering to the points vector) of the fibers.

Definition at line 95 of file WFiberAccumulator.h.

Referenced by add(), buildDataSet(), and clear().

boost::shared_ptr< std::vector< size_t > > WFiberAccumulator::m_fiberLengths
private

One of the vectors needed to construct a WDataSetFibers.

Stores the length of the fibers.

Definition at line 101 of file WFiberAccumulator.h.

Referenced by add(), buildDataSet(), and clear().

boost::mutex WFiberAccumulator::m_fiberMutex
private

A mutex needed to guarantee thread-safety.

Definition at line 83 of file WFiberAccumulator.h.

Referenced by add(), and buildDataSet().

boost::shared_ptr< std::vector< float > > WFiberAccumulator::m_points
private

One of the vectors needed to construct a WDataSetFibers.

Stores the points in a vector of floats.

Definition at line 89 of file WFiberAccumulator.h.

Referenced by add(), buildDataSet(), and clear().

boost::shared_ptr< std::vector< size_t > > WFiberAccumulator::m_pointToFiber
private

One of the vectors needed to construct a WDataSetFibers.

Stores information about what fiber a point in the points vector refers to.

Definition at line 107 of file WFiberAccumulator.h.

Referenced by add(), buildDataSet(), and clear().


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