[vtkusers] Rendering slow with many actors

Jothy jothybasu at gmail.com
Mon Jul 25 08:06:13 EDT 2011


Thanks, will try this.

Jothy

On Mon, Jul 25, 2011 at 12:23 PM, David Doria <daviddoria at gmail.com> wrote:

> On Mon, Jul 25, 2011 at 5:40 AM, Jothy <jothybasu at gmail.com> wrote:
> > Hi all,
> >
> > I am adding many actors to the renderer in a for loop.
> >
> > But the rendering becomes slow, is there any way to make it fast.
> > vtkAppendPolyData will not work for me as I want to keep their color
> > different.
> >
> > here is my code
> >
> > for (int i=0;i<this->NumberOfROIs;i++)
> >
> >     {
> >
> >         double r=this->ROIColors[i][0]/255;
> >
> >         double g=this->ROIColors[i][1]/255;
> >
> >         double b= this->ROIColors[i][2]/255;
> >
> >         vtkActor* axROI=vtkActor::New();
> >
> >         axROI=this->cutAxialROI(this->meshList[i],scrollValue,r,g,b);
> >
> >         this->axialRenderer->AddActor(axROI);
> >
> >     }
> >
> >
> >
> >
> >
> > }
> >
> >
> >
> >     this->ui->AxialWidget->GetRenderWindow()->Render();
>
> You could set the colors as an array of the CellData and set that
> array to be the active scalars. Then you don't need to color the
> actor, so the AppendPolyData method should work. You can color the
> objects something like this:
>
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/ColoredLines
>
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110725/868da514/attachment.htm>


More information about the vtkusers mailing list