<div dir="ltr">Thanks, will try this.<br><br>Jothy<br><br><div class="gmail_quote">On Mon, Jul 25, 2011 at 12:23 PM, David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria@gmail.com">daviddoria@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><div></div><div class="h5">On Mon, Jul 25, 2011 at 5:40 AM, Jothy &lt;<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>&gt; wrote:<br>

&gt; Hi all,<br>
&gt;<br>
&gt; I am adding many actors to the renderer in a for loop.<br>
&gt;<br>
&gt; But the rendering becomes slow, is there any way to make it fast.<br>
&gt; vtkAppendPolyData will not work for me as I want to keep their color<br>
&gt; different.<br>
&gt;<br>
&gt; here is my code<br>
&gt;<br>
&gt; for (int i=0;i&lt;this-&gt;NumberOfROIs;i++)<br>
&gt;<br>
&gt;     {<br>
&gt;<br>
&gt;         double r=this-&gt;ROIColors[i][0]/255;<br>
&gt;<br>
&gt;         double g=this-&gt;ROIColors[i][1]/255;<br>
&gt;<br>
&gt;         double b= this-&gt;ROIColors[i][2]/255;<br>
&gt;<br>
&gt;         vtkActor* axROI=vtkActor::New();<br>
&gt;<br>
&gt;         axROI=this-&gt;cutAxialROI(this-&gt;meshList[i],scrollValue,r,g,b);<br>
&gt;<br>
&gt;         this-&gt;axialRenderer-&gt;AddActor(axROI);<br>
&gt;<br>
&gt;     }<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;     this-&gt;ui-&gt;AxialWidget-&gt;GetRenderWindow()-&gt;Render();<br>
<br>
</div></div>You could set the colors as an array of the CellData and set that<br>
array to be the active scalars. Then you don&#39;t need to color the<br>
actor, so the AppendPolyData method should work. You can color the<br>
objects something like this:<br>
<br>
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/ColoredLines" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/ColoredLines</a><br>
<font color="#888888"><br>
David<br>
</font></blockquote></div><br></div>