OpenWalnut
1.4.0
|
An iterator for iterating the points of a fiber. More...
#include <WDataSetFibers.h>
Public Member Functions | |
WFiberPointsIterator () | |
Default contructor. | |
WFiberPointsIterator (WDataSetFibers const *fibers, std::size_t fbIdx, std::size_t idx, bool reverse=false) | |
Constructor. | |
WFiberPointsIterator (WFiberPointsIterator const &iter) | |
Copy constructor. | |
~WFiberPointsIterator () | |
Destructor. | |
WFiberPointsIterator & | operator= (WFiberPointsIterator const &iter) |
Copy operator. | |
WFiberPointsIterator & | operator++ () |
Increment operator. | |
WFiberPointsIterator & | operator-- () |
Decrement operator. | |
WFiberPointsIterator | operator++ (int) |
Increment operator. | |
WFiberPointsIterator | operator-- (int) |
Decrement operator. | |
bool | operator== (WFiberPointsIterator const &rhs) const |
Compare to another point iterator. | |
bool | operator!= (WFiberPointsIterator const &rhs) const |
Compare to another point iterator. | |
WPosition | operator* () |
Returns the coordinates of the point currently pointed to. | |
double | getParameter (double def=0.0) const |
Returns the parameter specified in the vertex parameter array of the dataset. | |
WPosition | getTangent () const |
The tangent of the point. | |
WColor | getColor () const |
Return the color of the point. | |
WColor | getColor (std::size_t idx) const |
Return the color of the point. | |
WColor | getColor (std::string name) const |
Return the color of the point. | |
WColor | getColor (const boost::shared_ptr< WDataSetFibers::ColorScheme > scheme) const |
Return the color of the point. | |
Protected Member Functions | |
std::size_t | getBaseIndex () const |
Calculates the index of this point in the dataset arrays. | |
Private Attributes | |
WDataSetFibers const * | m_fibers |
The pointer to the fibers. | |
std::size_t | m_fiberIndex |
The index of the fiber. | |
std::size_t | m_index |
The index of the current point. | |
bool | m_reverse |
Whether to iterate backwards. |
An iterator for iterating the points of a fiber.
Allows for both forward and backward iteration of points.
Definition at line 651 of file WDataSetFibers.h.
WFiberPointsIterator::WFiberPointsIterator | ( | WDataSetFibers const * | fibers, |
std::size_t | fbIdx, | ||
std::size_t | idx, | ||
bool | reverse = false |
||
) |
Constructor.
Creates an iterator pointing to a certain point of a fiber.
fibers | The pointer to the fiber data. |
fbIdx | The index of the fiber in the fiber dataset. |
idx | The index of the point of the curent fiber. |
reverse | Whether to iterate backwards. |
Definition at line 515 of file WDataSetFibers.cpp.
WFiberPointsIterator::WFiberPointsIterator | ( | WFiberPointsIterator const & | iter | ) |
Copy constructor.
iter | The iterator to copy from. |
Definition at line 523 of file WDataSetFibers.cpp.
Destructor.
Definition at line 531 of file WDataSetFibers.cpp.
std::size_t WFiberPointsIterator::getBaseIndex | ( | ) | const [protected] |
Calculates the index of this point in the dataset arrays.
But be aware that this index works vertex-wise. This mens, getting the y coordinate of the vertex in the dataset vertex array, use 3 * getBaseIndex() + 1. This depends on the type of array you like to query.
Definition at line 576 of file WDataSetFibers.cpp.
References WDataSetFibers::getLineLengths(), WDataSetFibers::getLineStartIndexes(), m_fiberIndex, m_fibers, m_index, and m_reverse.
Referenced by getColor(), getParameter(), getTangent(), and operator*().
WColor WFiberPointsIterator::getColor | ( | ) | const |
Return the color of the point.
Definition at line 667 of file WDataSetFibers.cpp.
References WDataSetFibers::getColorScheme(), and m_fibers.
Referenced by getColor().
WColor WFiberPointsIterator::getColor | ( | std::size_t | idx | ) | const |
Return the color of the point.
idx | the index of the colorscheme to use. |
WDHNoSuchDataSet | if the colorscheme does not exist. |
Definition at line 672 of file WDataSetFibers.cpp.
References getColor(), WDataSetFibers::getColorScheme(), and m_fibers.
WColor WFiberPointsIterator::getColor | ( | std::string | name | ) | const |
Return the color of the point.
name | the name of the colorscheme to use. |
WDHNoSuchDataSet | if the colorscheme does not exist. |
Definition at line 677 of file WDataSetFibers.cpp.
References getColor(), WDataSetFibers::getColorScheme(), and m_fibers.
WColor WFiberPointsIterator::getColor | ( | const boost::shared_ptr< WDataSetFibers::ColorScheme > | scheme | ) | const |
Return the color of the point.
scheme | the colorscheme to use. |
WDHNoSuchDataSet | if the colorscheme does not exist. |
Definition at line 631 of file WDataSetFibers.cpp.
References getBaseIndex(), WDataSetFibers::ColorScheme::GRAY, WDataSetFibers::ColorScheme::RGB, and WDataSetFibers::ColorScheme::RGBA.
double WFiberPointsIterator::getParameter | ( | double | def = 0.0 | ) | const |
Returns the parameter specified in the vertex parameter array of the dataset.
If no such array was set, the specified default will be returned.
def | the default value which will be returned if no vertex parameter array was defined. |
Definition at line 613 of file WDataSetFibers.cpp.
References getBaseIndex(), WDataSetFibers::getVertexParameters(), and m_fibers.
WPosition WFiberPointsIterator::getTangent | ( | ) | const |
The tangent of the point.
Definition at line 622 of file WDataSetFibers.cpp.
References getBaseIndex(), WDataSetFibers::getTangents(), and m_fibers.
bool WFiberPointsIterator::operator!= | ( | WFiberPointsIterator const & | rhs | ) | const |
Compare to another point iterator.
rhs | The second point iterator. |
Definition at line 608 of file WDataSetFibers.cpp.
References operator==().
WPosition WFiberPointsIterator::operator* | ( | ) |
Returns the coordinates of the point currently pointed to.
Definition at line 590 of file WDataSetFibers.cpp.
References getBaseIndex(), WDataSetFibers::getVertices(), and m_fibers.
WFiberPointsIterator & WFiberPointsIterator::operator++ | ( | ) |
Increment operator.
Makes the iterator point to the next point.
Definition at line 550 of file WDataSetFibers.cpp.
References m_index.
WFiberPointsIterator WFiberPointsIterator::operator++ | ( | int | ) |
Increment operator.
Makes the iterator point to the next point.
Definition at line 556 of file WDataSetFibers.cpp.
References m_fiberIndex, m_fibers, m_index, and m_reverse.
WFiberPointsIterator & WFiberPointsIterator::operator-- | ( | ) |
Decrement operator.
Makes the iterator point to the previous point. 3
Definition at line 563 of file WDataSetFibers.cpp.
References m_index.
WFiberPointsIterator WFiberPointsIterator::operator-- | ( | int | ) |
Decrement operator.
Makes the iterator point to the previous point.
Definition at line 569 of file WDataSetFibers.cpp.
References m_fiberIndex, m_fibers, m_index, and m_reverse.
WFiberPointsIterator & WFiberPointsIterator::operator= | ( | WFiberPointsIterator const & | iter | ) |
Copy operator.
iter | The iterator to copy from. |
Definition at line 535 of file WDataSetFibers.cpp.
References m_fiberIndex, m_fibers, m_index, and m_reverse.
bool WFiberPointsIterator::operator== | ( | WFiberPointsIterator const & | rhs | ) | const |
Compare to another point iterator.
rhs | The second point iterator. |
Definition at line 598 of file WDataSetFibers.cpp.
References m_fiberIndex, m_fibers, m_index, m_reverse, and wlog::warn().
Referenced by operator!=().
std::size_t WFiberPointsIterator::m_fiberIndex [private] |
The index of the fiber.
Definition at line 816 of file WDataSetFibers.h.
Referenced by getBaseIndex(), operator++(), operator--(), operator=(), and operator==().
WDataSetFibers const* WFiberPointsIterator::m_fibers [private] |
The pointer to the fibers.
Definition at line 813 of file WDataSetFibers.h.
Referenced by getBaseIndex(), getColor(), getParameter(), getTangent(), operator*(), operator++(), operator--(), operator=(), and operator==().
std::size_t WFiberPointsIterator::m_index [private] |
The index of the current point.
Definition at line 819 of file WDataSetFibers.h.
Referenced by getBaseIndex(), operator++(), operator--(), operator=(), and operator==().
bool WFiberPointsIterator::m_reverse [private] |
Whether to iterate backwards.
Definition at line 822 of file WDataSetFibers.h.
Referenced by getBaseIndex(), operator++(), operator--(), operator=(), and operator==().