<div class="gmail_quote">On Sat, Feb 20, 2010 at 8:27 AM, David Gobbi <span dir="ltr">&lt;<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>&gt;</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 &lt;<a href="mailto:shiva@sewingwitch.com">shiva@sewingwitch.com</a>&gt; wrote:<br>
&gt; --On Friday, February 19, 2010 10:18 PM -0700 David Gobbi<br>
&gt; &lt;<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; All VTK classes also have a casting method called SafeDownCast() that<br>
&gt;&gt; should be used instead of dynamic_cast&lt;&gt;().<br>
&gt;<br>
&gt; Again, this only works for leaf classes. It doesn&#39;t have any machinery for<br>
&gt; matching an intermediate class. Leaf classes are the most common case, so<br>
&gt; 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&#39;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>