<html>
<head>
</head>
<body>
<br>
<br>
Berk Geveci wrote:<br>
<blockquote type="cite" cite="mid:1035205051.1735.7.camel@caemlyn.kitwarein.com">
<pre wrap="">If you added the vtkTypeMacro to your class' header, you<br>can use SafeDownCast. This is much safer down static casting:<br><br>vtkActorCollection *actors = vtkRenderer->GetActors() ;<br>vtkActor *actor;<br><br>for (actors->InitTraversal();actor=actors->GetNextActor());)<br> {<br> vtkMyActor* myactor = vtkMyActor::SafeDownCast(actor);<br> if (myactor)<br> {<br> actor->MyExtendedMethod();<br> }<br> // etc etc<br> }<br><br>-Ber</pre>
</blockquote>
Thank's a lot. How do I add the vtkTypeMacro to my class' header ?<br>
<blockquote type="cite" cite="mid:1035205051.1735.7.camel@caemlyn.kitwarein.com">
<pre wrap=""><br><br>On Sun, 2002-10-20 at 08:43, Steffen Oeltze wrote:<br></pre>
<blockquote type="cite">
<pre wrap="">Malcolm Drummond wrote:<br><br></pre>
<blockquote type="cite">
<pre wrap="">Hi Steffen<br><br>Try casting to your type of actor - the actor collection contains pointers<br>to type vtkActor.<br><br></pre>
</blockquote>
<pre wrap="">Unfortunately, I'm not very familiar with C. How does casting work ? <br>What is the syntax ?<br><br>Steffen<br><br></pre>
<blockquote type="cite">
<pre wrap=""><br>Malcolm<br><br>----- Original Message -----<br>From: "Steffen Oeltze" <a class="moz-txt-link-rfc2396E" href="mailto:Steffen.Oeltze@Student.Uni-Magdeburg.DE"><Steffen.Oeltze@Student.Uni-Magdeburg.DE></a><br>To: "VTK users" <a class="moz-txt-link-rfc2396E" href="mailto:vtkusers@public.kitware.com"><vtkusers@public.kitware.com></a><br>Sent: Saturday, October 19, 2002 6:05 PM<br>Subject: [vtkusers] deriving my own class from vtkActor<br><br><br></pre>
<blockquote type="cite">
<pre wrap="">Dear VTK-users,<br><br>I have derived my own class from vtkActor and I have added a couple of<br>methods to this new class.<br>After creating and modifying such a new actor I add it to my existing<br>renderer. At some point I use<br>vtkRenderer->GetActors() to retrieve my custom actors. Then, I would<br>like to traverse the returned<br>list and apply a custom method to each of my selfmade actors. However, I<br>get the error:<br><br></pre>
<blockquote type="cite">
<pre wrap="">'method' : is not an element of 'vtkActor'<br><br></pre>
</blockquote>
<pre wrap="">I guess this is a problem of backward compatibility but I don't know how<br>to solve it. Can anybody help me ?<br><br>Steffen<br><br><br>_______________________________________________<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at:<br><br></pre>
</blockquote>
<pre wrap=""><a class="moz-txt-link-rfc2396E" href="http://public.kitware.com/cgi-bin/vtkfaq"><http://public.kitware.com/cgi-bin/vtkfaq></a><br><br></pre>
<blockquote type="cite">
<pre wrap="">Follow this link to subscribe/unsubscribe:<br><a class="moz-txt-link-freetext" href="http://public.kitware.com/mailman/listinfo/vtkusers">http://public.kitware.com/mailman/listinfo/vtkusers</a><br><br><br></pre>
</blockquote>
<pre wrap=""><br>_______________________________________________<br>This is the private VTK discussion list. <br>Please keep messages on-topic. Check the FAQ at: <a class="moz-txt-link-rfc2396E" href="http://public.kitware.com/cgi-bin/vtkfaq"><http://public.kitware.com/cgi-bin/vtkfaq></a><br>Follow this link to subscribe/unsubscribe:<br><a class="moz-txt-link-freetext" href="http://public.kitware.com/mailman/listinfo/vtkusers">http://public.kitware.com/mailman/listinfo/vtkusers</a><br><br></pre>
</blockquote>
</blockquote>
<pre wrap=""><!----><br><br><br><br><br></pre>
</blockquote>
<br>
</body>
</html>