Deriving from VTK classes?
Roland Schwarz
roland.schwarz at telecom.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
extentions
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
every
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
users/designers
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
dynamic_cast<>
route. Given I will succeed, do you know how this could make it into the
official
release? (at least for Windows VC++) I think I would not be the only one who
can
take advantage of this.
BTW.: Do other compilers support this feature as well?
Regards,
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