[vtk-developers] abstract/concrete etc

David Gobbi dgobbi at irus.rri.on.ca
Sat Feb 24 21:30:12 EST 2001


On Sun, 25 Feb 2001, John Biddiscombe wrote:

> You can't create a vtkProcessObject or a vtkObject. 

I beg to differ.  You most certainly can :)  If you couldn't, then
there would be no problem here.

>                                     They are abstract in 
> the "completely pointless subclasses on their own" sense

Well, not completely pointless.  If you said 'pointless 99.99% of the
time' I would agree with you.  Someone will find a use for them, for
better or for worse.

> It would break some of my code, because I use plain-vanilla vtkObject
> >instances as timestamps (because vtkTimeStamp itself isn't wrapped).
> >Why do you want to make these changes?
> 
> because my RPD GUI wrapper generator parses the whole vtk library and 
> generates wrapper classes and menu/object structures for each class. 
> Abstract ones need to be flagged so that the user can't create a 
> "vtkProcessObjext window" but can create a "vtkElevationFilter window" etc 
> etc. Allowing vtkImagesource, vtkPolyDataSource and all the rest, a 
> concrete existence is wrong in my view. TCL wrappers ought to do the same 
> to prevent the user from creating a vtkObject on its own.

Ah.  So it is a matter of opinion, style, and 'correctness.'  

I would take a different tact here.  I would say that it is bad for
vtkObject to be concrete because some of its derived classes are
abstract, and deriving an abstract class from a concrete class just
doesn't jive with the way I write code.  But that is just my style,
and I haven't really thought things through yet. 

Anyway, I'm getting philosophical here at your expense (and perhaps
I'm trying the patience of others on this mailing list).  My only
problem with the change is that it will require me to rewrite some
of my code, and all I ask is that you give me some time to think 
up an alternative way to write my own code such that I no longer
need to create bare naked vtkObjects.

 - David

--
  David Gobbi, MSc                    dgobbi at irus.rri.on.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario





More information about the vtk-developers mailing list