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

Adapter. More...

#include <WTractAdapter.h>

+ Collaboration diagram for WTractAdapter:

Public Member Functions

 WTractAdapter (std::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. More...
 
size_t numPoints () const
 How many positions this tract incorporates. More...
 
WPosition operator[] (size_t index) const
 Constructs and returns a WPosition out of the i'th position of this tract. More...
 

Private Attributes

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

Detailed Description

Adapter.

Definition at line 37 of file WTractAdapter.h.

Constructor & Destructor Documentation

◆ WTractAdapter()

WTractAdapter::WTractAdapter ( std::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

◆ numPoints()

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.

◆ operator[]()

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

◆ m_numPoints

size_t WTractAdapter::m_numPoints
private

How many points aka WPositions this tract consists of.

Definition at line 80 of file WTractAdapter.h.

Referenced by numPoints().

◆ m_pointComponents

std::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[]().

◆ m_startIndex

size_t WTractAdapter::m_startIndex
private

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: