OpenWalnut  1.4.0
Public Member Functions | Private Attributes
WTractAdapter Class Reference

Adapter. More...

#include <WTractAdapter.h>

List of all members.

Public Member Functions

 WTractAdapter (boost::shared_ptr< const std::vector< float > > pointComponents, size_t startIndex, size_t numPoints)
 Constructs a new WTract which has numPoints points and a startIndex inside of the given components array.
size_t numPoints () const
 How many positions this tract incorporates.
WPosition operator[] (size_t index) const
 Constructs and returns a WPosition out of the i'th position of this tract.

Private Attributes

boost::shared_ptr< const
std::vector< float > > 
m_pointComponents
 The array where the components of this tracts live.
size_t m_numPoints
 How many points aka WPositions this tract consists of.
size_t m_startIndex
 The index of the x-component of the first point of this tract inside the m_pointComponents array.

Detailed Description

Adapter.

Definition at line 37 of file WTractAdapter.h.


Constructor & Destructor Documentation

WTractAdapter::WTractAdapter ( boost::shared_ptr< const std::vector< float > >  pointComponents,
size_t  startIndex,
size_t  numPoints 
)

Constructs a new WTract which has numPoints points and a startIndex inside of the given components array.

Parameters:
pointComponentsArray where the components of the tract points are inside of
startIndexThe position inside of the components array of the first x coordinate.
numPointsHow many points this tract has

Definition at line 32 of file WTractAdapter.cpp.


Member Function Documentation

size_t WTractAdapter::numPoints ( ) const [inline]

How many positions this tract incorporates.

Returns:
number of points

Definition at line 88 of file WTractAdapter.h.

References m_numPoints.

WPosition WTractAdapter::operator[] ( size_t  index) const

Constructs and returns a WPosition out of the i'th position of this tract.

Parameters:
indexThe index of the position of this tract. It may start at 0 and is always smaller than numPoints().
Returns:
The i'th position of this tract as WPosition.

Definition at line 39 of file WTractAdapter.cpp.

References m_pointComponents, and m_startIndex.


Member Data Documentation

How many points aka WPositions this tract consists of.

Definition at line 80 of file WTractAdapter.h.

Referenced by numPoints().

boost::shared_ptr< const std::vector< float > > WTractAdapter::m_pointComponents [private]

The array where the components of this tracts live.

But you will need the starting position and the length of the tract to access them.

Definition at line 75 of file WTractAdapter.h.

Referenced by operator[]().

The index of the x-component of the first point of this tract inside the m_pointComponents array.

Definition at line 85 of file WTractAdapter.h.

Referenced by operator[]().


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