[vtkusers] bug in vtkInteractorStyleFlight ?

shahid shahed at isb.paknet.com.pk
Mon Jun 2 01:59:37 EDT 2003


try creating and attaching new interactor first and then deleting the old
one. I am not sure but it may help.

shahed

-----Original Message-----
From: vtkusers-admin at public.kitware.com
[mailto:vtkusers-admin at public.kitware.com]On Behalf Of Jean-Dominique
Barnichon
Sent: Saturday, May 31, 2003 2:53 AM
To: vtkusers at public.kitware.com
Subject: [vtkusers] bug in vtkInteractorStyleFlight ?


Hi,

I am developing a soft with VC++ 6.0 and vtk4.0, in which I want the user to
be able to choose between several interaction modes (joystick, trackball,
flight).

Everything works fine in most cases, i.e. the user is able to change the
interaction mode. However, from time to time, the program crashes on such a
change without any explicit message.
The "strange" thing is that when a crash occurs, it is always on the
selection of the flight mode, never for the other modes. As the code
responsible (see herebelow) of changing the interaction mode looks pretty
much the same in the 3 cases, I am wondering if this could be a problem/bug
in vtkInteractorStyleFlight.

Does anybody has already experienced such a problem, or has any idea of
where it could come from?

Thanks,
Jean-Do

When the user changes the interaction mode, the current mode is deleted, a
new one is created and assigned to the interactor.

// Joystick interaction mode
void CMyView::OnJoystick()
{	if (this->Interactor) {
this->Interactor->GetInteractorStyle()->Delete(); }
	vtkInteractorStyleTrackball* JoystickStyle =
vtkInteractorStyleTrackball::New();
	JoystickStyle->SetTrackballModeToJoystick();
	this->Interactor->SetInteractorStyle(JoystickStyle);
}

// Flight interaction mode
void CMyView::OnPilot()
{	if (this->Interactor) {
this->Interactor->GetInteractorStyle()->Delete(); }
	vtkInteractorStyleFlight* FlightStyle = vtkInteractorStyleFlight::New();
	double data[3]={0,0,1};
	FlightStyle->SetFixedUpVector(data);
	FlightStyle->FixUpVectorOn();
	this->Interactor->SetInteractorStyle(FlightStyle);
}

// Trackball interaction mode
void CMyView::OnTrackball()
{	if (this->Interactor) {
this->Interactor->GetInteractorStyle()->Delete(); }
	vtkInteractorStyleTrackball* TrackballStyle =
vtkInteractorStyleTrackball::New();
	TrackballStyle->SetTrackballModeToTrackball();
	this->Interactor->SetInteractorStyle(TrackballStyle);
}



_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers






More information about the vtkusers mailing list