VTK-5.0 prints white text

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

VTK-5.0 prints white text

KarlBlau
Hi,

the following code should draw a black text "Test" in the lower left corner. Background white:

  _logo_mapper = vtkTextMapper::New();
  _logo_actor =  vtkActor2D   ::New();

  _logo_mapper->SetInput("Test");

  _logo_actor->SetMapper(_logo_mapper);
  _logo_actor->GetProperty()->SetColor(0.0,0.0,0.0);
  _logo_actor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
  _logo_actor->GetPositionCoordinate()->SetValue(0.1,0.1,0.1);

  _logo_mapper->Delete(); // Ref. counted !

  _ren = vtkRenderer::New();
  _ren_win->AddRenderer(_ren);
  _ren->SetBackground(1.,1.,1.);
  _ren->Delete(); // Ref. counted !
  _ren->AddActor2D(_logo_actor);

  _logo_actor->Delete(); // Ref. counted !

I get a white text on white background! This remains the same if I change SetColor() to some other values.
When I run the same code with VTK-4.2 the thing works just that way!

Any idea?

Thanks, MB


______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193

_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: VTK-5.0 prints white text

Biddiscombe, John A.
Martin

I can't remember as far back as 4.2, but try using vtkTextActor and
vtkTextProperties. These have replaced the older textmapper/actor2D
combinations and make life much easier. (Also check out the text widget
so you can drag labels around etc)

JB

> Hi,
>
> the following code should draw a black text "Test" in the lower left corner. Background white:
>
>   _logo_mapper = vtkTextMapper::New();
>   _logo_actor =  vtkActor2D   ::New();
>
>   _logo_mapper->SetInput("Test");
>
>   _logo_actor->SetMapper(_logo_mapper);
>   _logo_actor->GetProperty()->SetColor(0.0,0.0,0.0);
>   _logo_actor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
>   _logo_actor->GetPositionCoordinate()->SetValue(0.1,0.1,0.1);
>
>   _logo_mapper->Delete(); // Ref. counted !
>
>   _ren = vtkRenderer::New();
>   _ren_win->AddRenderer(_ren);
>   _ren->SetBackground(1.,1.,1.);
>   _ren->Delete(); // Ref. counted !
>   _ren->AddActor2D(_logo_actor);
>
>   _logo_actor->Delete(); // Ref. counted !
>
> I get a white text on white background! This remains the same if I change SetColor() to some other values.
> When I run the same code with VTK-4.2 the thing works just that way!
>
> Any idea?
>
> Thanks, MB
>
>
> ______________________________________________________________
> Verschicken Sie romantische, coole und witzige Bilder per SMS!
> Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>  


--
John Biddiscombe,                            email:biddisco @ cscs.ch
http://www.cscs.ch/about/BJohn.php
CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07
Via Cantonale, 6928 Manno, Switzerland      | Fax:  +41 (91) 610.82.82


_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers