[Insight-developers] {Mesh, DefaultDynamicMeshTraits, MapContainer} & Iterators

Luis Ibanez ibanez@choroid.cs.unc.edu
Thu, 4 Oct 2001 23:06:35 -0400 (EDT)


Hi,

I'm trying to use itk::Mesh with the traits defined
by default for a dynamic mesh.

It seems that MapContainer is the default container
for points and for pixel values when the dynamic traits
are used.

MapContainer derives privately from std::map, and its
Iterator derives from std::map::iterator.

The Value() method of an MapContainer::Iterator is defined
as a    (*this)->second   in order to get the second
element of the pair indicated by the iterator.

However, when the Value() method is invoked on the
MapContainer::Iterator object, the compiler (gcc on
Linux) reports that there is no "second" member in
Iterator.

If instead of using the "Iterator", the "std::map::iterator"
is used, and is accessed as it->second, everything seems
to work fine.

An example illustrating the problem has been checked in
under  Insight/Testing/Code/Common/itkDynamicMeshTest.cxx
The lines that are not working are commented out.


Any suggestions ?


Thanks