SOFA API  3944ba52
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

int 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 (int index=0)
 
 BaseCollisionElementIterator (int index, VIterator it, VIterator itend)
 
 BaseCollisionElementIterator (VIterator it, VIterator itend)
 
Iterator Interface
void next ()
 Increment this iterator to reference the next element. More...
 
void operator++ ()
 Increment this iterator to reference the next element. More...
 
void operator++ (int)
 Increment this iterator to reference the next element. More...
 
int 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

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

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

int sofa::core::BaseCollisionElementIterator::index
protected

index of the referenced element inside the CollisionModel.

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

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

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

sofa::core::BaseCollisionElementIterator::BaseCollisionElementIterator ( int  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).

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

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

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

int 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()).

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.

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.

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

Increment this iterator to reference the next element.

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

Increment this iterator to reference the next element.

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

Increment this iterator to reference the next element.