[vtkusers] Crash with many vtkVectorText actors

Luca Tersi luca.tersi at unibo.it
Mon Mar 8 05:00:13 EST 2010


Dears,
I need to display thousands of labels on a 2D image, indicating the
coordinates of some particular points.
My code works with a limited number of actors, but the rendering crashes on
bigger images (more points to display).
Is there a limitation on the maximum number of actors in a scene? Or what's
wrong in my code?

for (int i=0;i<n;i++)
{
        vtkVectorText* vecText = vtkVectorText::New();
        char *num= ( char* ) malloc ( sizeof ( char ) );
        sprintf ( num, "%d,%d",  cx[i] ,  cy[i]);
        vecText->SetText(num);

        vtkPolyDataMapper *txtMapper = vtkPolyDataMapper::New();

        txtMapper->SetInput( vecText->GetOutput() );
        vtkActor *txtActor = vtkActor::New();

        txtActor->SetMapper(txtMapper)
;

        txtActor->SetPosition (
(c->GetX()-double(size[0]/2))*this->fluoro1->GetSpacing(),(c->GetY()-double(size[0]/2))*this->fluoro1->GetSpacing(),
2 );
        txtActor -> GetProperty() -> SetColor ( 1, 0, 0 );
        txtActor -> GetProperty() -> SetSpecular ( 0.4 );
        txtActor -> SetScale(0.5+vnl_math_rnd(BLOB_DISTANCE*2/10));
        txtActor -> PickableOff();

        renderer->AddActor(txtActor);

        txtMapper->Delete();
        vecText->Delete();
        free(num);
}


imView->Render();

And I get the error:
vbo/vbo_save_api.c:216: map_vertex_store: Assertion 'vertex_store-buffer'
failed


Thank you in advance

Luca


-- 
Eng. Luca Tersi
PhD Student in Bioengineering

University of Bologna
DEIS - Department of Electronics, Computer Science, and Systems
Via Venezia 52, I-47023 Cesena (FC) - Italy

--------------------------------------
Phone: (+39) 0547 3 38953
Mobile: (+39) 349 84 92 262
Fax: (+39) 0522 18 40 145
Skype: lucatersi
E-Mail :
luca.tersi at unibo.it
lucatersi at gmail.com
--------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100308/4ac1f43d/attachment.htm>


More information about the vtkusers mailing list