[vtk-developers] vtkLiteObject?

Andy Cedilnik andy.cedilnik at kitware.com
Wed Apr 10 16:14:04 EDT 2002


On Wed, 2002-04-10 at 15:58, Roland Schwarz wrote:
> 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
command, which would inside create another command, which would inside
create another command, which would inside create another command, which
would inside create another command, which would inside create another
command, which would inside create another command, which would inside
create another command, which would inside create another command, which
would inside create another command, which would inside create another
command, which would inside create another command, which would inside
create another command, which would inside create another command, which
would inside create another command, which would inside create another
command, which would inside create another command, ... huh, enough!!
Would not work.
 
> 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?
> Put it another way:
> vtkObject will be broken into the following hierarchy:
> class vtkObject
> class vtkNewObject: public vtkObject
> every class that derived from class vtkObject will now derive from
> vtkNewObject. The latter will have the full interface of the old vtkObject
> class.
> vtkCommand now can derive from vtkObject and inherit reference counting, and
> noting more.
> Of course vtkNewObject should be replaced by something more meaningful than
> New. But this could depend on which functions made it into this new object.

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...

Anyway, not feasible in my opinion.
	
				Andy




More information about the vtk-developers mailing list