iterator question.

Jason Kraftcheck kraftche at cae.wisc.edu
Thu Oct 29 11:00:28 CDT 2009


Mark Beall wrote:
> So is the iGeom behavior different than the iMesh one then?
> 

Probably.  Both originally had the iGeom behavior.  When the iMesh behavior
was corrected, apparently the iGeom version was overlooked.

> The iGeom behavior doesn't make sense if the iterator is iterating on an
> empty list (behavior is undefined). The simple fix is to return a null
> for the value, but then lists can't have nulls (not sure if they can
> anyhow) and the flag returned by iGeom_getNextEntIter isn't actually
> needed in that case (since the behavior if you just look at the entity
> is the same as the iMesh iterator).
> 

There is nothing that prohibits 0 from being a valid handle value.  So
returning NULL clearly wouldn't work.  For the current iGeom_getNextEntIter
definition to work for an empty set, the initEntIter call would have to also
return a boolean value indicating whether or not the first call to
getNextEntIter will succeed.

- jason


More information about the tstt-interface mailing list