#include "apiMeshIterator.h"
#include <maya/MIOStream.h>
apiMeshGeomIterator::apiMeshGeomIterator(
void * geom,
MObjectArray & comps )
geometry( (apiMeshGeom*)geom )
{
reset();
}
apiMeshGeomIterator::apiMeshGeomIterator(
void * geom,
MObject & comps )
geometry( (apiMeshGeom*)geom )
{
reset();
}
apiMeshGeomIterator::~apiMeshGeomIterator(){}
void apiMeshGeomIterator::reset()
{
setCurrentPoint( 0 );
if ( NULL != geometry ) {
int maxVertex = geometry->vertices.length();
setMaxPoints( maxVertex );
}
}
MPoint apiMeshGeomIterator::point() const
{
if ( NULL != geometry ) {
unsigned int idx = index();
if ( idx < geometry->vertices.length())
pnt = geometry->vertices[ index() ];
}
return pnt;
}
void apiMeshGeomIterator::setPoint(
const MPoint & pnt )
const
{
if ( NULL != geometry ) {
unsigned int idx = index();
if ( idx < geometry->vertices.length())
geometry->vertices.set( pnt, index() );
}
}
int apiMeshGeomIterator::iteratorCount() const
{
return geometry->vertices.length();
}
bool apiMeshGeomIterator::hasPoints() const
{
return true;
}