OpenWalnut
1.5.0dev
|
Adapter. More...
#include <WTractAdapter.h>
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... | |
Adapter.
Definition at line 37 of file WTractAdapter.h.
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.
pointComponents | Array where the components of the tract points are inside of |
startIndex | The position inside of the components array of the first x coordinate. |
numPoints | How many points this tract has |
Definition at line 32 of file WTractAdapter.cpp.
|
inline |
How many positions this tract incorporates.
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.
index | The index of the position of this tract. It may start at 0 and is always smaller than numPoints(). |
Definition at line 39 of file WTractAdapter.cpp.
References m_pointComponents, and m_startIndex.
|
private |
How many points aka WPositions this tract consists of.
Definition at line 80 of file WTractAdapter.h.
Referenced by numPoints().
|
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[]().
|
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[]().