[vtkusers] Help regarding 'vtkInteractorStyleUser' needed!

Rahul Goela rahulgoela at yahoo.com
Sat Nov 29 10:02:50 EST 2003


Hi VTK gurus,

I need some help regarding using
vtkInteractorStyleUser. I am trying to create a custom
style and override the usual function of middle
button. 

I am getting the following error :

error C2664: 'SetMiddleButtonPressMethod' : cannot
convert parameter 1 from 'void' to 'void (__cdecl
*)(void *)'

The following is the snippet of the code i am
currently using -:

myStyle = vtkInteractorStyleUser::New();
myStyle->SetMiddleButtonPressMethod(startPushPlane(),(void
*)myStyle);
 
myStyle->SetMiddleButtonReleaseMethod(endPushPlane(),
(void *)myStyle);
  myStyle->SetUserInteractionMethod(pushPlane(), (void
*) myStyle);

The Push Plane functions is as follows: 

static void pushPlane()
{
  int newcord[2];
  int oldcord[2];
  float norm1[3];
  float norm2[3];
  
  //Get the most latest position of the mouse!
  myStyle->GetLastPos(newcord);
  myStyle->GetOldPos(oldcord);
  if (newcord[0] != oldcord[0])
  {

     //--- Get the normal place with respect to the
current camera position --------
    
renderer->GetActiveCamera()->GetViewPlaneNormal(norm1);
     plane->GetNormal(norm2);
     if ((norm1[0]*norm2[0] + norm1[1]*norm2[1] +
norm1[2]*norm2[2]) < 0)
	   plane->Push(0.005*(newcord[0]-oldcord[0]));
     else   
	   plane->Push(0.005*(oldcord[0]-newcord[0]));
     iren->Render();
  }
}
-------------------------------------------------------

any help would be greatly appreciated.

thanks alot!

regards

rahul




________________________________________________________________________
Yahoo! India Mobile: Download the latest polyphonic ringtones.
Go to http://in.mobile.yahoo.com



More information about the vtkusers mailing list