[vtkusers] SetExecuteMethod(void(* f)(void *), void * arg) ???

Axel Wendt a.wendt at fh-oldenburg.de
Fri Oct 5 09:25:59 EDT 2001


Thanks Jianlong,

I still have a problem with
the ReadPoints function.

I define it like:
void* ReadPoints();

but the compiler don't accept. He says, he couldn't convert from
'void *(void)'     to     'void (__cdecl *)(void *)

do you know the solution?

axel

At 15:16 05.10.2001 +0200, you wrote:
>Hi,Axel,
>Just made a blank letter to send.Sorry.
>It should be done like this:
>pointSource->SetExecuteMethod( ReadPoints, (void *) pointSource)
>
>I think it will be ok.
>Jianlong
>
> >
> > I would like to use the vtkProgrammableSource class in a C++ program in 
> the
> > same manner as in the TCL example:
> > ./contrib/examplesTcl/reconstructSurface.tcl.
> >
> > Can anyone give me an example in C++ of the usage of SetExecuteMethod?
> >
> > The function look like:
> > void SetExecuteMethod(void(* f)(void *), void * arg)
> >
> > I define a function : void ReadPoints ()
> > then I use
> > pointSource->SetExecuteMethod( ReadPoints, ??? )
> >
> >
> > What is wrong? The compiler don't accept the first parameter.
> > And the second I don't understand . It doesen't seem to be documented in
> > the manual or the VTK User's Guide. What is arg and why does the TCL
> > example use only one parameter? (Generally you can easily move from TCL to
> > C++ - but not in this case!).
> >
> >
> > thanks for help
> > Axel
> >
> >
> > -----------------------------------------------------------------
> > Axel Wendt
> > Institute for Applied Photogrammetry and Geoinformatics
> > Fachhochschule Oldenburg/Ostfriesland/Wilhelmshaven




More information about the vtkusers mailing list