Deriving from VTK classes?

Roland Schwarz roland.schwarz at telecom.at
Fri Sep 17 07:06:13 EDT 1999


Dear VTK users,

    every class in the VTK library implements the
'GetClassName' function which allows to check for
the correct class before calling a member function
(late binding). 

If I have a pointer to a derived class, the class name
is that of the derived class, but the meber function
is the original one, and could still be called. Since
the class name is different from the parent class,
there seems to be no way to figure out what the parent 
class actually is. I would expect some pointer to the 
class name of the parent, so I could walk the class 
hierarchy.

In the book of Bjarne Stroustrup I found that there is a
concept called runtime-type-information. I expect that
the 
dynamic_cast<vtkBaseClass>(vtkParentClass)
operator would do the job. But the vtk class library seems
to make no use of it. Does anyone know the reason for
this?

If I would use it, I had to recompile the library to activate
runtime type information, but then I am not sure if there
are any counter-arguments to using this feature.

Also since this duplicates/interferes with a standard convention
in the vtk library I would like to use standard conventions
as much as possible.

Is there any development going on in this direction?
(a pointer to the parent class would be fine too.)

Thank you,

Roland Schwarz
Business Email: RSchwarz at riegl.co.at
Private Email: roland.schwarz at telecom.at



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