[vtkusers] Append text

ChiaWeng Boon chiaweng at gmail.com
Fri Nov 26 15:24:10 EST 2010


Hi,

I would like to label some of my drawings by appending texts (a lot of
them).  I know how to append one.  But is there something similar to
vtkAppendPolyData for appending texts?

text = vtkTextActor::New();

text->SetInput("Hello");

vtkSmartPointer<vtkTextProperty> tprop = text->GetTextProperty();

tprop->SetFontFamilyToArial();

tprop->BoldOn();

tprop->ShadowOn();

tprop->SetLineSpacing(1.0);

tprop->SetFontSize(12);

tprop->SetColor(1.0,0.0,0.0);

tprop->SetShadowOffset(2,2);

text->SetDisplayPosition( 0, 0 );
ren1 = vtkRenderer::New();
ren1->AddActor(contActor);ren1->AddActor2D(text);


Yours,

Chia Weng



More information about the vtkusers mailing list