[vtkusers] SphereSource as input to the TriangleFilter in a function!!!!!

David Doria daviddoria at gmail.com
Thu Aug 23 09:59:30 EDT 2012


> I had make that line in my program (style->SetDefaultRenderer(renderer)),

Why are you calling OnLeftButtonDown manually? The function must be
defined to take no arguments (like this one:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MouseEvents)
because the idea is to re-implement a virtual function in the parent
class.

My guess is that the Interactor is NULL because you haven't entered
the event loop yet (and the interactor has not been properly
initialized.). I see you have added a member variable called Data, but
you need to give the InteractorStyle the "Data" by doing:

interactorStyle->Data = yourData;

Then when the OnLeftButtonDown function gets called when you actually
perform a left click, the OnLeftButtonDown will have access to
yourData via the Data pointer.

Also, when you post code, please ensure the indentation is sane (what
you have posted is very hard to read), and remove any extraneous bits
of code. By posting 229 lines of code you are not encouraging anyone
to look closely at it.

David



More information about the vtkusers mailing list