[Insight-developers] IRIX64-6.5-CC-n32-Continuous errors and CastImageFilter

Lorensen, William E (Research) lorensen at crd . ge . com
Mon, 5 Aug 2002 14:46:32 -0400


Brad can comment on whether or not it is part of the standard.

At any rate, if there is a work around (that works on the other platforms) we should use it. SGI is a
supported platform.

Bill


-----Original Message-----
From: Aljaz Noe [mailto:noe@grasp.cis.upenn.edu]
Sent: Monday, August 05, 2002 2:39 PM
To: 'Brad King'
Cc: 'Brian'; 'Insight Developers'; Lorensen, William E (Research)
Subject: RE: [Insight-developers] IRIX64-6.5-CC-n32-Continuous errors
and CastImageFilter


I'm confused... Is this part of C++ specifications or a 'feature' of SGI
compilers?

It seems that on all other platforms the compiler is able to
automatically find the class specializations provided by the code in
*.cxx file. By the time the static member function Rectangular is used,
the compiler already knows the exact specialization of the class
GenerateMesh and since the file itkFEMGenerateMesh.h was included, it
should also be able to use the specialized declaration of the class and
all of its member functions. Therefore the additional declaration of the
specialized membera seems redundant.

Furthermore, forward declaring the template parameter doesn't work. The
class used as a template parameter has to be completely declared (at
least the way class GenerateMesh is implemented now, because
GenerateMesh references one of its typedefs...).

I implemented this class as templated one so that later, when new
elements are introduced, it should be quite simple to write functions
that generate various types of meshes from these new elements in a
consistently way. Basically you just need to provide the implementation
(specialization) of the member functions of GenerateMesh class for the
specific element type without the need for changing the existing library
code (file itkFEMGenerateMesh.h) and enforcing consistent syntax.

The additional declaration of each specialized function in file
itkFEMGenerateMesh.h seems to defeat the purpose of using manual
specialization in the first place. Do you have any ideas, how these
things could be implemented in some other way?

Aljaz


> -----Original Message-----
> From: insight-developers-admin@public.kitware.com 
> [mailto:insight-developers-admin@public.kitware.com] On 
> Behalf Of Brad King
> Sent: Monday, August 05, 2002 1:20 PM
> To: Brad King
> Cc: Brian; Insight Developers; Bill Lorensen
> Subject: Re: [Insight-developers] 
> IRIX64-6.5-CC-n32-Continuous errors and CastImageFilter
> 
> 
> > In itkFEMGenerateMesh.h, just below the class definition of
> > GenerateMesh, but before closing the fem or itk namespaces, 
> add these
> > lines:
> >
> > template<>
> > void
> > GenerateMesh<Element2DC0LinearQuadrilateral>
> > ::Rectangular(ElementType::ConstPointer e0, Solver& S,
> >               VectorType& orig, VectorType& size,
> >               VectorType& Nel);
> >
> > template<>
> > void
> > GenerateMesh<Element3DC0LinearHexahedron>
> > ::Rectangular(ElementType::ConstPointer e0, Solver& S,
> >               VectorType& orig, VectorType& size,
> >               VectorType& Nel);
> 
> Oh, but for these lines to compile, the classes
> Element2DC0LinearQuadrilateral and 
> Element3DC0LinearHexahedron also need
> to be forward-declared if they are not available.
> 
> -Brad
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers
>