[vtkusers] Differences in display of vtkTextActors between vtk5.0.4 and vtk5.2.1 (shadow and accentuated characters) ??

pof jd379252 at gmail.com
Sun Jan 11 14:29:16 EST 2009


One precision if it can help,
- the vtk5.0.4 lib was compiled from the project built using CMake2.4.x
- the vtk5.2.1 lib was compiled from the project built using CMake2.6.2
both using default CMake values.

> Hello,
>
> I'am trying to upgrade from vtk5.0.4 to vtk5.2.1, and I have two 
> problems with the rendering of vtkTextActor.
> Basically :
> - the shadow property looks rather strange in 5.2.1 compared to 5.0.4
> - accuentuated characters (é, è...) are no longer displayed in 5.2.1
>
> Herebelow, a small test program that reproduces the behaviour is given.
> I also joined links to illustrate the graphical output obtained with :
> - vtk5.0.4 -> 
> http://www.imageshare.web.id/images/mjg8s8miucbecde84rh0.png
> - vtk5.2.1 http://www.imageshare.web.id/images/x1ijylcbtox56lbzn12.png
>
> I compiled both vtk version with VC++2005 under WinVista.
> Any hints of where the problem may come from?
> Thanks
> JD
>
> // Example code to show the difference in rendering of vtkTextActor
> // Compiled and run either with vtk5.0.4 or vtk5.2.1
> //
> #include "vtkCylinderSource.h"
> #include "vtkPolyDataMapper.h"
> #include "vtkActor.h"
> #include "vtkRenderer.h"
> #include "vtkRenderWindow.h"
> #include "vtkRenderWindowInteractor.h"
> #include "vtkProperty.h"
> #include "vtkCamera.h"
> #include "vtkTextProperty.h"
> #include "vtkTextActor.h"
>
> int main()
> {
>    // Create an example text actor.
>    vtkTextActor *textActor = vtkTextActor::New();
>    
> textActor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport(); 
>
>    textActor->SetPosition(0.50,0.90);
>    textActor->SetInput("Geometry based on vtkCylinderSource\nGéométrie 
> basée sur vtkCylinderSource\nvtk5.x.x");
>    textActor->GetTextProperty()->SetFontSize(18);
>    textActor->GetTextProperty()->SetFontFamilyToArial();
>    textActor->GetTextProperty()->SetJustificationToCentered();
>    textActor->GetTextProperty()->BoldOn();
>    textActor->GetTextProperty()->ItalicOn();
>    textActor->GetTextProperty()->ShadowOn();
>    textActor->GetTextProperty()->SetColor(1, 0, 0);
>
>    // Creates a polygonal cylinder model with eight circumferential 
> facets.
>    vtkCylinderSource *cylinder = vtkCylinderSource::New();
>    cylinder->SetResolution(8);
>    vtkPolyDataMapper *cylinderMapper = vtkPolyDataMapper::New();
>    cylinderMapper->SetInputConnection(cylinder->GetOutputPort());
>    vtkActor *cylinderActor = vtkActor::New();
>    cylinderActor->SetMapper(cylinderMapper);
>    cylinderActor->GetProperty()->SetColor(1.0000, 0.3882, 0.2784);
>    cylinderActor->RotateX(30.0);
>    cylinderActor->RotateY(-45.0);
>
>    // Create the graphics structure.
>    vtkRenderer *ren = vtkRenderer::New();
>    vtkRenderWindow *renWin = vtkRenderWindow::New();
>
>    renWin->AddRenderer(ren);
>    renWin->SetSize(600, 600);
>
>    vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
>    iren->SetRenderWindow(renWin);
>
>    // Add the actors to the renderer, set the background and size
>    ren->AddActor(cylinderActor);
>    ren->AddActor(textActor);
>    ren->SetBackground(0.1, 0.2, 0.4);
>
>    // We'll zoom in a little by accessing the camera and invoking a 
> "Zoom"
>    // method on it.
>    ren->ResetCamera();
>    ren->GetActiveCamera()->Zoom(1.5);
>    renWin->Render();
>
>    // This starts the event loop and as a side effect causes an 
> initial render.
>    iren->Start();
>
>    // Exiting from here, we have to delete all the instances that
>    // have been created.
>    textActor->Delete();
>    cylinder->Delete();
>    cylinderMapper->Delete();
>    cylinderActor->Delete();
>    ren->Delete();
>    renWin->Delete();
>    iren->Delete();
>
>    return 0;
> }
>
>




More information about the vtkusers mailing list