[vtkusers] vtkInteractorStyle

Steffen Oeltze Steffen.Oeltze at Student.Uni-Magdeburg.DE
Sat Oct 5 09:58:30 EDT 2002



Jeremy Winston wrote:

>Steffen Oeltze wrote:
>
>>Alan McIntyre wrote:
>>
>>>Steffen,
>>>
>>>As far as passing function pointers goes, there is a difference
>>>between this:
>>>    obj->SetSomething(my_function());
>>>and this:
>>>    obj->SetSomething(&my_function);
>>>
>>I receive an error during compiling saying that this is not a valid call
>>for a member-function.
>>
>>obj->SetLeftButtonPressMethodArgDelete(&this->get_mousePos);
>>
>
>Shouldn't it just be
>
>        "(this->get_mousePos)" ?
>
>(Versus "(&this->get_mousePos)"
>     or "(this->get_mousePos())" ).
>
You are right but this doesn't work either. I have programed a slice 
viewer object which
has a mapper, a render window and an interactor. Now, I'd like to define 
my own
vtkInteractorStyleUser. My source code is:

...
vtkRenderWindowInteractor *intAct = vtkRenderWindowInteractor::New();
vtkInteractorStyleUser *style = vtkInteractorStyleUser::New();
    style->SetLeftButtonPressMethodArgDelete(this->get_mousePos);
    intAct->SetInteractorStyle(style);
...

void SliceView::get_mousePos(void *)
{           
    ...
}

The error I get is:

coversion of parameter 1 from 'void (void *)' to 'void (__cdecl *) (void 
*)' is not possible


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20021005/f2db1e60/attachment.htm>


More information about the vtkusers mailing list