Deriving from VTK classes?

Roland Schwarz at
Fri Sep 17 15:05:48 EDT 1999

Thank you Bryan,

>True, it would be nice not to have to keep track, but as you point out,
>the only obvious good way to do that (besides dynamic_cast) is to deepen
>the class hierarchy or modify the base class.

Keeping track indeed is not what I desire. The same effect could be obtained
checking the actual class name with 'GetClassName()', at the same time being
more efficient. I still would not be able to recognize classes from my own
that I will write later on. This would require that any new module that
derives from
my extended class adds to a global pointer list, or inserts its pointer into
object that will ever reference it. I think this is impossible.

>As you say, this is what dynamic_cast is for, are you constrained not to
>use it?

My constraints are:
i)    I would like to be able to use the standard vtkdll.dll
          (it is not compiled with RTT turned on by default)
ii)   I would like to use it in a consistent manner that other
      have found to work well


>I would also suggest there is a difference between customizing and
>extending.  Customizing is easy - you provide a new implementation for
>an existing interface.  Since the interface stays the same, the types
>are the same and you don't run into the problems you are experiencing.
>Trying to add to the interface presents a more dificult scenario.

I take a more pragmatic view: Customization is everything I can do without
altering the library code.

I will try to compile the library with RTT turned on, and take the
route.  Given I will succeed, do you know how this could make it into the
release? (at least for Windows VC++) I think I would not be the only one who
take advantage of this.

BTW.: Do other compilers support this feature as well?

Roland Schwarz
Business Email: RSchwarz at
Private Email: at

This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.

More information about the vtkusers mailing list