[vtkusers] Adding vtkSetObjectMacro to a class

Wolfram H Volpi whv88240 at Bayou.UH.EDU
Sun Mar 4 02:26:27 EST 2001


Hello.
What is the correct way to add SetImplicitFunction to a class?

I am trying to add a SetImplicitFunction to the class
vtkVolumeRayCastMIPFunction.  I copied from vtkSampleFunction.h
"vtkSetObjectMacro(ImplicitFunction,vtkImplicitFunction);"
and pasted it into vtkVolumeRayCastMIPFunction.h.  It built fine.
Then I execute a program that uses the SetImplicitFunction and got a
memory error.

// the code that uses SetImplicitFunction
vtkSphere *syntheticFunction = vtkSphere::New();
vtkVolumeRayCastMIPFunction *RayFunction = vtkVolumeRayCastMIPFunction::New();
	RayFunction->SetImplicitFunction(syntheticFunction);

// the memory error
The instruction at "0x00a82a05" referenced memory at "0xcdcdcdcd". 
The memory could not be "read".
Unhandled exception in DiffMIP.exe(VTKGRAPHICS2.DLL):0xC000005: Access
Violation.

Thank you,
Wolfv.





More information about the vtkusers mailing list