Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
OpenMesh::Python::IteratorWrapperT< Iterator, n_items > Class Template Reference

#include <libs_required/OpenMesh/src/Python/Iterator.hh>

Public Member Functions

 IteratorWrapperT (const PolyMesh &_mesh, typename Iterator::value_type _hnd, bool _skip=false)
 
 IteratorWrapperT (const TriMesh &_mesh, typename Iterator::value_type _hnd, bool _skip=false)
 
IteratorWrapperT iter () const
 
Iterator::value_type next ()
 
unsigned int len () const
 

Private Attributes

const OpenMesh::PolyConnectivitymesh_
 
size_t(OpenMesh::ArrayKernel::* n_items_ )() const
 
Iterator iterator_
 
Iterator iterator_end_
 

Detailed Description

template<class Iterator, size_t(OpenMesh::ArrayKernel::*)() const n_items>
class OpenMesh::Python::IteratorWrapperT< Iterator, n_items >

Wrapper for mesh item iterators.

This class template is used to wrap mesh item iterators for Python. It implements Python's iterator protocol (the magic methods __iter__ and __next__).

Template Parameters
IteratorAn iterator type.
n_itemsA member function pointer that points to the mesh function that returns the number of items to iterate over (e.g. n_vertices).

Definition at line 21 of file Iterator.hh.

Constructor & Destructor Documentation

template<class Iterator, size_t(OpenMesh::ArrayKernel::*)() const n_items>
OpenMesh::Python::IteratorWrapperT< Iterator, n_items >::IteratorWrapperT ( const PolyMesh _mesh,
typename Iterator::value_type  _hnd,
bool  _skip = false 
)
inline

Constructor

Parameters
_meshThe mesh that contains the items to iterate over.
_hndThe handle of the first item to iterate over.
_skipSpecifies if deleted/hidden elements are skipped.

Definition at line 31 of file Iterator.hh.

template<class Iterator, size_t(OpenMesh::ArrayKernel::*)() const n_items>
OpenMesh::Python::IteratorWrapperT< Iterator, n_items >::IteratorWrapperT ( const TriMesh _mesh,
typename Iterator::value_type  _hnd,
bool  _skip = false 
)
inline

Constructor

Parameters
_meshThe mesh that contains the items to iterate over.
_hndThe handle of the first item to iterate over.
_skipSpecifies if deleted/hidden elements are skipped.

Definition at line 44 of file Iterator.hh.

Member Function Documentation

template<class Iterator, size_t(OpenMesh::ArrayKernel::*)() const n_items>
IteratorWrapperT OpenMesh::Python::IteratorWrapperT< Iterator, n_items >::iter ( ) const
inline

Implementation of Python's __iter__ magic method.

Returns
This iterator.

Definition at line 55 of file Iterator.hh.

template<class Iterator, size_t(OpenMesh::ArrayKernel::*)() const n_items>
unsigned int OpenMesh::Python::IteratorWrapperT< Iterator, n_items >::len ( ) const
inline

Implementation of Python's __len__ magic method.

Returns
The number of items in the mesh.

Definition at line 83 of file Iterator.hh.

template<class Iterator, size_t(OpenMesh::ArrayKernel::*)() const n_items>
Iterator::value_type OpenMesh::Python::IteratorWrapperT< Iterator, n_items >::next ( )
inline

Implementation of Python's __next__ magic method.

Returns
The next item. Raises a Python StopIteration exception if there are no more items.

Definition at line 65 of file Iterator.hh.


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