[vtkusers] Problem using vtkXYActor in vtk6.2.0 (and vtk6.3.0rc2)

pof jd379252 at gmail.com
Wed Sep 9 18:53:39 EDT 2015


Hi all,

I have got an application that is currently linked against vtk6.1.0 
(compiled on VC++2010, win64).
One of its windows uses vtkXYChart to display 2D graphs, and it works 
just perfectly with vtk6.1.0.

Here is the code relevant portion:
...
     ////////////////////////////////////////////////////
     // Create the Chart and all its related objects
     ////////////////////////////////////////////////////
     vtkChartXY *chart = vtkChartXY::New();
     vtkContextScene *chartScene = vtkContextScene::New();
     vtkContextActor *chartActor = vtkContextActor::New();

     chartScene->AddItem(chart);
     chartActor->SetScene(chartScene);

     Renderer->AddActor(chartActor); // BUG is induced by this line
     chartScene->SetRenderer(Renderer);

     // Create a table for the displayed variables
     vtkTable *table = vtkTable::New();
     // Fill the table
...
...
     // Add the plot
     vtkPlot *line = chart->AddPlot(vtkChart::LINE);
#if VTK_MAJOR_VERSION <= 5
     line->SetInput(table, 0, 1);
#else
     line->SetInputData(table, 0, 1);
#endif
...

Now I am trying to upgrade to vtk6.2.0. It compiles and links fine.
However, the vtkXYActor is no longer displayed, the line causing the 
trouble is this one:
     Renderer->AddActor(chartActor); // BUG is induced by this line
Running in debug, and exiting the program after this line returns the 
following message:
First chance exception at 0x000007fef5340cfc 
(vtkRenderingContext2D-6.2.dll) in myapp.exe : 0xC0000005: Access 
violation reading location 0x0000000000000000.

So my question is simple, though the answer might not be:
Were there any changes between vtk6.1 and vtk6.2 related to vtkXYActor 
that could explain such behaviour?

Any ideas or advices are welcome.
Thanks
Pof



More information about the vtkusers mailing list