<div class="gmail_quote">On Sat, Feb 20, 2010 at 8:27 AM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Fri, Feb 19, 2010 at 11:43 PM, Kenneth Porter <<a href="mailto:shiva@sewingwitch.com">shiva@sewingwitch.com</a>> wrote:<br>
> --On Friday, February 19, 2010 10:18 PM -0700 David Gobbi<br>
> <<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>> wrote:<br>
><br>
>> All VTK classes also have a casting method called SafeDownCast() that<br>
>> should be used instead of dynamic_cast<>().<br>
><br>
> Again, this only works for leaf classes. It doesn't have any machinery for<br>
> matching an intermediate class. Leaf classes are the most common case, so<br>
> this will work in most cases.<br>
<br>
</div>Both IsA() and SafeDownCast() have the appropriate machinery and they<br>
just fine for intermediate classes. Can you give an example where<br>
they don't work?<br>
</blockquote><div><br></div><div>I was about to ask the same question. I have used IsA() to check whether a vtAbstractArray was one of the vtkDataArray subclasses before doing a cast and numerical calculations. I assumed that this was a general mechanism that could be used. I thought for the vtkObject derived classes this was the preferable method to dynamic_cast.</div>
<div><br></div><div>Marcus</div></div>