[vtkusers] Find closest point on Mesh B from a point on Mesh A. - with off topic comments
Jim Peterson
jimcp at cox.net
Sun Nov 28 21:18:33 EST 2010
> Addressing only one of your points for the moment:
>
> Of course we can catch these events:
>
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MouseEventsObserver
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/KeypressObserver
>
> The problem is that it is crazy (at least to me) in an OO language to
> have to package everything up into a void* clientData to have access
> to it in the observer. With the subclass approach, we can directly set
> member variables (keeping their types) and access the objects that
> way.
>
> David
>
>
I guess the real issue is the static vs instance method callback scheme.
The Java callbacks are instance methods, not class methods, so there is
no "packaging up" required. whatever the instance class the callback is
defined in is available to it when it is invoked. I suppose I should try
to be sympathetic with the C++ stuff, but I have never considered C++ an
OO language, Just my opinion of course, but C++ is at best an OO capable
language, one must be very careful and diligent to achieve a truly
extensible OO solution in C++. My coworkers keep a phrase at hand;
"complexity is frequently the path of least resistance, the simple
solution is rarely the first to spring to mind."
I see your point though. I would say that in this particular case, the
event callbacks evolved into a better implementation in the Java wrapped
version than the original event methods into the callbacks in C++.
FWIW, I have always felt that being an OO system user is supposed to
involve some different techniques that being an OO system developer. In
my opinion, C+ systems never establish that difference.
Also, try to remember, I don't have any real problem with any of these
items, except that with a well established set of capabilities, the
Java, TCL, Python and DotNet communities using vtk are likely to be a
considerably larger group that the C++ group. I would expect that the
functional parts of vtk will always be C++ however.
Jim
More information about the vtkusers
mailing list