SOFA API  d36dcf8a
Open source framework for multi-physics simuation
sofa::core::BaseCollisionElementIterator Class Reference

#include <CollisionElement.h>

Base class for reference to an collision element defined by its index More...

Inheritance diagram for sofa::core::BaseCollisionElementIterator:

Detailed Description

Base class for reference to an collision element defined by its index

Protected Attributes

Index index
 index of the referenced element inside the CollisionModel. More...
 
VIterator it
 current position in a vector of indices, in case this iterator traverse a non-contiguous set of indices More...
 
VIterator itend
 end position in a vector of indices, in case this iterator traverse a non-contiguous set of indices More...
 

Static Protected Attributes

static std::vector< int > SOFA_CORE_API emptyVector
 empty vector to be able to initialize the iterator to an empty pair More...
 

Public Member Functions

 BaseCollisionElementIterator (Index index=0)
 
 BaseCollisionElementIterator (Index index, VIterator it, VIterator itend)
 
 BaseCollisionElementIterator (VIterator it, VIterator itend)
 
Iterator Interface
void next ()
 Increment this iterator to reference the next element. More...
 
BaseCollisionElementIteratoroperator++ ()
 Prefix increment this iterator to reference the next element. More...
 
BaseCollisionElementIterator operator++ (int)
 Postfix increment this iterator to reference the next element. More...
 
BaseCollisionElementIteratoroperator+= (int n)
 
BaseCollisionElementIterator operator+ (int n) const
 
Index getIndex () const
 
const VIteratorgetVIterator () const
 Return the current iterator in the vector of indices, in case such a vector is currently used. More...
 
const VIteratorgetVIteratorEnd () const
 Return the end iterator in the vector of indices, in case such a vector is currently used. More...
 

Attribute details

◆ emptyVector

std::vector< int > sofa::core::BaseCollisionElementIterator::emptyVector
staticprotected

empty vector to be able to initialize the iterator to an empty pair

◆ index

Index sofa::core::BaseCollisionElementIterator::index
protected

index of the referenced element inside the CollisionModel.

◆ it

VIterator sofa::core::BaseCollisionElementIterator::it
protected

current position in a vector of indices, in case this iterator traverse a non-contiguous set of indices

◆ itend

VIterator sofa::core::BaseCollisionElementIterator::itend
protected

end position in a vector of indices, in case this iterator traverse a non-contiguous set of indices

Constructor details

◆ BaseCollisionElementIterator() [1/3]

sofa::core::BaseCollisionElementIterator::BaseCollisionElementIterator ( Index  index = 0)
inline

Constructor. In most cases it will be used by the CollisionModel to create interators to its elements (such as in the begin() and end() methods).

◆ BaseCollisionElementIterator() [2/3]

sofa::core::BaseCollisionElementIterator::BaseCollisionElementIterator ( Index  index,
VIterator  it,
VIterator  itend 
)
inline

Constructor. This constructor should be used in case a vector of indices is used.

◆ BaseCollisionElementIterator() [3/3]

sofa::core::BaseCollisionElementIterator::BaseCollisionElementIterator ( VIterator  it,
VIterator  itend 
)
inline

Constructor. This constructor should be used in case a vector of indices is used.

Function details

◆ getIndex()

Index sofa::core::BaseCollisionElementIterator::getIndex ( ) const
inline

Return the index of the referenced element inside the CollisionModel.

This methods should rarely be used. Users should call it.draw() instead of model->draw(it.getIndex()).

◆ getVIterator()

const VIterator& sofa::core::BaseCollisionElementIterator::getVIterator ( ) const
inline

Return the current iterator in the vector of indices, in case such a vector is currently used.

◆ getVIteratorEnd()

const VIterator& sofa::core::BaseCollisionElementIterator::getVIteratorEnd ( ) const
inline

Return the end iterator in the vector of indices, in case such a vector is currently used.

◆ next()

void sofa::core::BaseCollisionElementIterator::next ( )
inline

Increment this iterator to reference the next element.

◆ operator+()

BaseCollisionElementIterator sofa::core::BaseCollisionElementIterator::operator+ ( int  n) const
inline

◆ operator++() [1/2]

BaseCollisionElementIterator& sofa::core::BaseCollisionElementIterator::operator++ ( )
inline

Prefix increment this iterator to reference the next element.

◆ operator++() [2/2]

BaseCollisionElementIterator sofa::core::BaseCollisionElementIterator::operator++ ( int  )
inline

Postfix increment this iterator to reference the next element.

◆ operator+=()

BaseCollisionElementIterator& sofa::core::BaseCollisionElementIterator::operator+= ( int  n)
inline