[vtkusers] VTKcallbackcommand passing a class function

harshanand harsha.nyshadham at gmail.com
Fri Mar 29 14:38:50 EDT 2013


Hi Guys,

I am new to programming and I am not sure how to fix this.

I have a class GBConnecivity and would like to setup vtkcallback to use
function from this class.

This is what I am doing:

<.h>
class GBConnectivityApp
{
public:
void ClickCallbackFunction (vtkObject* caller, long unsigned int eventId,
void* clientData, void* callData);
}

<.cpp>
void GBConnectivityApp::ClickCallbackFunction(vtkObject* vtkNotUsed(caller),
long unsigned int vtkNotUsed(eventId), void* clientData, void*
vtkNotUsed(callData))
{
.................some stuff
}

I am calling it like this from another function of same
class(GBConnectivityApp)

vtkSmartPointer<vtkCallbackCommand> clickCallback = 
		vtkSmartPointer<vtkCallbackCommand>::New();
	
	clickCallback->SetCallback (ClickCallbackFunction );
	ui.qvtkWidget->update();

It would  not accept this, I tried GBConnectivityApp::ClickCallbackFunction
, would not take it. I get the error missing parameters to functions. So I
pass the parameters to cliclcallbackFunction, it would  not take it too.

What am i doing wrong?

Thanks for the help!!!






--
View this message in context: http://vtk.1045678.n5.nabble.com/VTKcallbackcommand-passing-a-class-function-tp5719722.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list