[vtk-developers] vtkLiteObject?

Roland Schwarz roland.schwarz at chello.at
Thu Apr 11 01:58:06 EDT 2002


> > Another possibly naive suggestion:
> >
> > Why not make vtkContainer and vtkCommand simply subclasses of vtkObject?
>
> Because vtkObject uses vtkCommand inside, which would mean that every
> time you create an object, you would create a command, which would
> inside create another command, which would inside create another
....

ok, I understand.

>
> > Or let vtkObject be the root of all classes, that describes what is
common
> > to all,
> > as creation, getclassname, reference counting and the like, and have a
new
> > subclass
> > of vtkObject that holds the rest?
....

>
> Now this would require:
> 1. Major changing of VTK API (if there is such a thing).
> 2. Changing of every single vtk class (that inherits from vtkObject).
> 3. Major headache of all people who are trying to port their code from
> VTK 3.2 to VTK 4.0...
>

Hmmm... As far as I can see this should be not so problematic. Basically
what I am saying is:

rename every vtkObject to vtkNewObject (better vtkObservableObject ).
use the name vtkObject instead of vtkSuper[Basic, Meta..whatever]Object.


The first step can be done with a simple script that replaces every
vtkObject by its new name.
So you are freeing this name for the new purpose.

I can't see what this would change in the API? The only user code that will
be affected is user code that derives directly from vtkObject, which I
expect is not seen too often.

> Anyway, not feasible in my opinion.

Please don't get me wrong, but:
"It is easy to suggest solutions, when you know nothing about the problem.
;-)"

To be honest, I have no detailed idea of the intricacies of such a change,
and basically I just put another naming variation into the discussion. From
my point of view the implementation is not affected at all. It simply is not
different. I just propose using the names
vtkObject and
vtkObservableObject

instead of
vtkSuperObject and
vtkObject

the latter sounding less specific, at last to me.

Roland

N.B.: Of course the new vtkObject should retain its Runtime Type Information
and class factory capability.

>
> Andy
>
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at public.kitware.com
> http://public.kitware.com/mailman/listinfo/vtk-developers
>






More information about the vtk-developers mailing list