[Insight-developers] Re: [cable] wrap::ListClasses

Luis Ibanez ibanez@choroid.cs.unc.edu
Tue, 30 Oct 2001 05:38:16 -0500 (EST)


Hi Brad,

Thanks for adding the ListClasses command.
It is quite useful.

I would like to suggest to add to it the
capability of printing the alias(tag) names of
the classes for Tcl.  The current list shows
the C++ prototypes fo the classes (which is
good), that helps to know which classes are
available, but at the moment of actually
using these classes we need the alias-names
(tags) that were assigned to them in  the
CMakeList.txt.

I don't know if that should be an option
to the command or maybe a separate command...
the idea will be to have a list like:

   tag given              C++ prototype
   in CMakeList.txt
    ---------------      -----------------
    itkImage             itk::Image<char,3>
    myVector             itk::Vector<double,2>
    myPoint              itk::Pointer<int,3>
    ...

so anybody knows that for instantiating a
itk::Vector<double,2> they need to do:

      set vvv [ myVector ]

------

Your idea of returning the methods and
classes as Tcl lists instead of
strings sounds good.

About the partition of methods by class/
superclass, this is useful for getting
familiar with the particular toolkit,
but it is bit conterintuitive that for
example for the itkVector I can not see
the [] operator unless itk::Array (the base
class that actually implement this method)
is also wrapped. C++ intuition makes you
think that if you got the derived class, you
should also get the methods of the parents.

At this point, maybe the best option is to
let evolution play its role, so just create
more and more wrap:: commands and with time
identify which ones are commonly used, so
the less used can be eventualy removed.



Thanks,


Luis


----------------



On Mon, 29 Oct 2001, Brad King wrote:

> Hello, all:
>
> At Luis's request, I have added a new general support command to CABLE's
> Tcl facility.  It is called "wrap::ListClasses", and takes no
> arguments.  It simply returns a string listing the classes that have been
> wrapped.
>
> I'm thinking of changing the behavior of both wrap::ListClasses and
> wrap::ListMethods to return Tcl list objects instead of strings.  This
> would allow iteration over the results.  The only problem is that
> ListMethods breaks down the list by class (chainging up through
> superclasses).  Any thoughts on the following format?
>
> { class-name1 {method1 method2 ...}
>   class-name2 {method1 method2 ...} }
>
> Each method would still be only the C++ method prototype.  Support may be
> possible later to actually further break down methods into names and
> result/argument types.
>
> -Brad
>
> _______________________________________________
> cable mailing list
> cable@public.kitware.com
> http://public.kitware.com/mailman/listinfo/cable
>

-- 
Luis Ibanez                                      CB#:   7060
Research Assistan Professor                      phone: (919) 843 5436
Division of Neurosurgery                         fax:   (919) 966 6627
University of North Carolina at Chapel Hill      email: ibanez@cs.unc.edu
Chapel Hill, NC 27599-7060                       http://www.cs.unc.edu/~ibanez