NDEVR
API Documentation
LineIterator< t_dims, t_type >

A class to easily iterate each line segment over a Geometry of lines. More...

Inheritance diagram for LineIterator< t_dims, t_type >:
[legend]
Collaboration diagram for LineIterator< t_dims, t_type >:
[legend]

Public Member Functions

 LineIterator ()
 Default constructor creating an empty iterator.
 LineIterator (const LineIterator< t_dims, t_type > &iter)
 Copy constructor.
 LineIterator (PrimitiveProperty primitive_property, VertexProperty vertex_property, Geometry geo)
 Constructs a line iterator from a geometry's primitive and vertex properties.
template<class t_line_type>
LineSegment< t_dims, t_line_type > get (uint04 index) const
 Retrieves the line segment at the given index.
LineSegment< t_dims, t_type > operator[] (uint04 index) const
 Array-style access to a line segment.
uint04 size () const
 Returns the number of line primitives available.
Vector< 2, uint04vertexIndex (uint04 index) const
 Returns the local vertex indices (offset-adjusted) for a line primitive.

Protected Member Functions

bool isHidden (uint04 index) const
 Checks whether a vertex is hidden via its flag.
Vector< 2, uint04rawIndex (uint04 index) const
 Returns raw (non-offset-adjusted) vertex indices for a line primitive.

Protected Attributes

TableColumnm_flag_column
 Pointer to the vertex flag column (may be nullptr).
uint04 m_primitive_count
 The number of line primitives.
Geometry::OptimizedPrimitiveDef m_primitive_def
 Pre-computed primitive definition for fast access.
TableColumnm_vertex_column
 Pointer to the vertex data column.
uint04 m_vertex_offset
 The vertex offset in the shared table.
VertexProperty m_vertex_property
 The vertex property being accessed.

Detailed Description

template<uint01 t_dims, class t_type>
class LineIterator< t_dims, t_type >

A class to easily iterate each line segment over a Geometry of lines.


Definition at line 2598 of file Geometry.h.

Constructor & Destructor Documentation

◆ LineIterator() [1/2]

template<uint01 t_dims, class t_type>
LineIterator< t_dims, t_type >::LineIterator ( PrimitiveProperty primitive_property,
VertexProperty vertex_property,
Geometry geo )
inline

Constructs a line iterator from a geometry's primitive and vertex properties.

Parameters
[in]primitive_propertyThe primitive property containing line indices.
[in]vertex_propertyThe vertex property containing position data.
[in]geoThe geometry to iterate over.

Definition at line 2614 of file Geometry.h.

References e_lines, e_polyline, m_flag_column, m_primitive_count, m_primitive_def, m_vertex_column, m_vertex_offset, Geometry::mode(), Geometry::optimizedPrimitiveDef(), and Geometry::vertexCount().

◆ LineIterator() [2/2]

template<uint01 t_dims, class t_type>
LineIterator< t_dims, t_type >::LineIterator ( const LineIterator< t_dims, t_type > & iter)
inline

Copy constructor.

Parameters
[in]iterThe iterator to copy from.

Definition at line 2647 of file Geometry.h.

References LineIterator(), m_flag_column, m_primitive_count, m_primitive_def, m_vertex_column, m_vertex_offset, and m_vertex_property.

Member Function Documentation

◆ get()

template<uint01 t_dims, class t_type>
template<class t_line_type>
LineSegment< t_dims, t_line_type > LineIterator< t_dims, t_type >::get ( uint04 index) const
inline

Retrieves the line segment at the given index.

Parameters
[in]indexThe line primitive index.
Returns
The line segment, or Invalid if vertices are missing or hidden.

Definition at line 2677 of file Geometry.h.

References isHidden(), IsInvalid(), m_vertex_column, and rawIndex().

Referenced by operator[]().

◆ isHidden()

template<uint01 t_dims, class t_type>
bool LineIterator< t_dims, t_type >::isHidden ( uint04 index) const
inlineprotected

Checks whether a vertex is hidden via its flag.

Parameters
[in]indexThe raw vertex index (including offset).
Returns
True if the vertex is hidden.

Definition at line 2717 of file Geometry.h.

References cast(), e_is_hidden, and m_flag_column.

Referenced by get().

◆ operator[]()

template<uint01 t_dims, class t_type>
LineSegment< t_dims, t_type > LineIterator< t_dims, t_type >::operator[] ( uint04 index) const
inline

Array-style access to a line segment.

Parameters
[in]indexThe line primitive index.
Returns
The line segment at the given index.

Definition at line 2692 of file Geometry.h.

References get().

◆ rawIndex()

template<uint01 t_dims, class t_type>
Vector< 2, uint04 > LineIterator< t_dims, t_type >::rawIndex ( uint04 index) const
inlineprotected

Returns raw (non-offset-adjusted) vertex indices for a line primitive.

Parameters
[in]indexThe line primitive index.
Returns
A 2-component vector of raw vertex indices.

Definition at line 2707 of file Geometry.h.

References m_primitive_def, m_vertex_offset, and Geometry::OptimizedGetPrimitiveVec().

Referenced by get(), and vertexIndex().

◆ size()

template<uint01 t_dims, class t_type>
uint04 LineIterator< t_dims, t_type >::size ( ) const
inline

Returns the number of line primitives available.

Returns
The line count.

Definition at line 2699 of file Geometry.h.

References m_primitive_count.

◆ vertexIndex()

template<uint01 t_dims, class t_type>
Vector< 2, uint04 > LineIterator< t_dims, t_type >::vertexIndex ( uint04 index) const
inline

Returns the local vertex indices (offset-adjusted) for a line primitive.

Parameters
[in]indexThe line primitive index.
Returns
A 2-component vector of local vertex indices.

Definition at line 2661 of file Geometry.h.

References IsInvalid(), m_vertex_offset, and rawIndex().


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