Run-time type information and vtkWhatever::New()

John Biddiscombe j.biddiscombe at rl.ac.uk
Tue Jan 18 11:07:04 EST 2000


Whilst you're at the run time stuff.....

Is it possible to do (something like) this

class X;
class Y : public X ....
class Z : public Y .....

under Borland you can get typeinfo and do 

typeinfo tx = typeid(X);
typeinfo ty = typeid(Y);

but you can't do 
if (ty.InheritsFrom(tx)) ...

which is very nasty. you can dynamic_cast if you have a pointer, but if you
just have a class reference (or typeinfo) you can't do it. Seems the
virtual method tables must have the info available - implementing rtti as
static members would allow one to get type derivations without actually
having a pointer available (??? true or false ???)

The reason I want to do it, is because when dragging an output from one
filter to another, it'd be nice to be able to pass a class reference (not
an actual class object), and test the drop point for inheritance. Requiring
an object means calling filter->GetOutput(....) which is not always possible.

>These changes have been checked in and will be available in tonight's
release.
>You might give it a day or two until everything stabilizes (check the
dashboard).

[for reference : Haven't been able to access this for several days.]

John B



-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------




More information about the vtkusers mailing list