[vtkusers] vtkBorlandRenderWindow doesn't remove previous picture.

XViz D_E at ukr.net
Fri Oct 5 10:19:56 EDT 2007


Dear VTK users/creators,

I try to plot 2D iso-conturing images. I'm using TurboC and vtkBorlandRenderWindow. Picture is looking excelent, by if I change any parameters (level in vtkContourFilter) and run the plotting procedure again I see both previous image and a new one. So I just cannot delete previously plotted picture! If I use standart vtkRenderWindow everything is fine, but I need a window on my Form! Could someone advise me how to deal with it?
Here is my code:

vtkContourFilter *iso = vtkContourFilter::New();
 iso->SetInput(PlImag);
 iso->GenerateValues(10, LowLevel, HighLevel);
 iso->UpdateWholeExtent();
vtkPolyDataMapper *map = vtkPolyDataMapper::New();
 map->SetInput(iso->GetOutput());
 map->SetScalarRange(LowLevel,HighLevel);
 map->UpdateWholeExtent();
vtkActor *aActor = vtkActor::New();
 aActor->SetMapper(map);
//---------
Form1->vtkBorlandRenderWindow1->GetRenderer()->AddActor2D(aActor);
Form1->vtkBorlandRenderWindow1->GetRenderer()->ResetCamera();
Form1->vtkBorlandRenderWindow1->Invalidate();
//---------
  flipX->Delete();
  logScale->Delete();
  iso->Delete();
  map->Delete();
  aActor->Delete();


Everything is working fine if I insert instead 3 strings with Form1->vtkBorlandRenderWindow1 usual visualization teqnique:

vtkRenderer *aRenderer = vtkRenderer::New();
vtkRenderWindow *renWin = vtkRenderWindow::New();
  renWin->AddRenderer(aRenderer);
vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
  iren->SetRenderWindow(renWin);
  aRenderer->AddActor(aActor);
  aRenderer->ResetCamera ();
  aRenderer->SetBackground(1,1,1);
  renWin->SetSize(800, 600);
  aRenderer->ResetCameraClippingRange();
  iren->Initialize();
  iren->Start();
...
  iren->Delete();
  renWin->Delete();
  aRenderer->Delete();


---------
Oleksandr.


More information about the vtkusers mailing list