[vtkusers] (Resend) PlaneWidget and InteractorStyle in vtkBorlan dRenderWindow
Dean Inglis
dean.inglis at camris.ca
Mon Dec 1 15:24:43 EST 2003
Hi Yang,
1) you need to add
void __fastcall TVTK_Form::FormDestroy(TObject *Sender)
{
vtkWindow1->GetRenderer()->RemoveAllProps();
}
to avoid the access violation when you close the application.
2) I ran the code in your posting, turning on/off the interactor
with "i" key without any problems although I did remove the lines
vtkWindow1->GetInteractor()->Initialize();
vtkWindow1->GetInteractor()->Start();
as they are unecessary. Also, you should not use Delete() on
any vtk components until you have actually used them. For your
posted example, I would just not call Delete within the Button's
OnClick event otherwise you will get access violations.
I would advise making some of the vtk objects as
member data for the Borland Form, create them in the Form's
OnCreate event and call Delete() in the Form's OnDestroy event.
You can initialize them in the Button1 OnClick event.
Dean
More information about the vtkusers
mailing list