[vtkusers] InteractionEvent in clojure?

Nikhil Shetty nikhil.shetty at kitware.com
Mon Mar 5 11:02:28 EST 2012


Hi Antonio,

I do not think VTK officially supports clojure and I am not aware of
anybody else doing this type of work. I am not a clojure expert but can
read clojure (common lisp in general) so maybe can give a shot at  this.

So it seems like your main problem is that you need to register a clojure
callback into the java API so that when an event is triggered your method
gets executed. I found this solution online and hope it helps you

http://clojure.org/java_interop
http://stackoverflow.com/questions/2181774/calling-clojure-from-java

What I gather is that you may have to declare a clojure method and define
it pretended with a dash ('-') for java to be able to call it. Let me know
if this helps.

-Nix


On Sat, Mar 3, 2012 at 5:33 PM, Antonio Recio <amdx64bt at gmail.com> wrote:

> I want to translate the example Cone6.java to clojure. I don't know
> how to use InteractionEvent in clojure. Can you give some advice? Do
> yo know some tutorials/projects for vtk in clojure?
>
> void myCallback() {
>        vtkTransform t = new vtkTransform();
>        boxWidget.GetTransform(t);
>        boxWidget.GetProp3D().SetUserTransform(t);
> }
>
> boxWidget.AddObserver("InteractionEvent", this, "myCallback");
>
>
> Sources:
> http://www.cmake.org/Wiki/VTK/Examples/Java/Miscellaneous/Cone6
> http://www.vtk.org/doc/nightly/html/classvtkBoxWidget.html
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120305/a31ad98d/attachment.htm>


More information about the vtkusers mailing list