<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"><<a href="mailto:daviddoria@gmail.com">daviddoria@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><div></div><div class="h5">On Mon, Jul 25, 2011 at 5:40 AM, Jothy <<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>> wrote:<br>
> Hi all,<br>
><br>
> I am adding many actors to the renderer in a for loop.<br>
><br>
> But the rendering becomes slow, is there any way to make it fast.<br>
> vtkAppendPolyData will not work for me as I want to keep their color<br>
> different.<br>
><br>
> here is my code<br>
><br>
> for (int i=0;i<this->NumberOfROIs;i++)<br>
><br>
> {<br>
><br>
> double r=this->ROIColors[i][0]/255;<br>
><br>
> double g=this->ROIColors[i][1]/255;<br>
><br>
> double b= this->ROIColors[i][2]/255;<br>
><br>
> vtkActor* axROI=vtkActor::New();<br>
><br>
> axROI=this->cutAxialROI(this->meshList[i],scrollValue,r,g,b);<br>
><br>
> this->axialRenderer->AddActor(axROI);<br>
><br>
> }<br>
><br>
><br>
><br>
><br>
><br>
> }<br>
><br>
><br>
><br>
> this->ui->AxialWidget->GetRenderWindow()->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'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>