Re: How I can use InteractionEvent in clojure?

2012-03-08 Thread Antonio Recio
It works!!! Thanks Aaron Cohen and Mark Rathwell. The code final that works 100% of the example cone6 of vtk in clojure is this: (ns example (:import (javax.swing JFrame JPanel SwingUtilities))) (clojure.lang.RT/loadLibrary vtkCommonJava) (clojure.lang.RT/loadLibrary vtkWidgetsJava) (def

Re: How I can use InteractionEvent in clojure?

2012-03-07 Thread Aaron Cohen
Unfortunately, I've been unable to get vtk to compile locally. At this point, it's seeming to me that your issue is more vtk-related than clojure, though. Can you put a println in the callback to confirm that it's at least being called? One question, is it significant that your code is slightly

Re: How I can use InteractionEvent in clojure?

2012-03-07 Thread Antonio Recio
When I print myCallback I obtain this: (println myCallback) user = #example$myCallback example$myCallback@6e1c51b4 I have used this: (doto coneMapper (.SetInput (.GetOutput cone))) And the applications runs, with not errors in the prompt too, but the boxWidget still doesn't work. On

Re: How I can use InteractionEvent in clojure?

2012-03-07 Thread Aaron Cohen
I meant do: (def myCallback (fn [] (println Invoked!) (let [t (vtk.vtkTransform.)] (.GetTransform t) (- boxWidget .GetProp3D (.SetUserTransform t) -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group,

Re: How I can use InteractionEvent in clojure?

2012-03-07 Thread Antonio Recio
It seems that callback is not called. I have added (println Testing callback) in the definition of myCallback and there is not message in the prompt when I run the application. (def myCallback (fn [] (let [t (vtk.vtkTransform.)] (.GetTransform t) (- boxWidget .GetProp3D

Re: How I can use InteractionEvent in clojure?

2012-03-07 Thread Aaron Cohen
On Mon, Mar 5, 2012 at 5:50 PM, Antonio Recio amdx6...@gmail.com wrote:       (.AddObserver interactionEvent myCallback run) I suspect this is mis-capitalized, it need to be InteractionEvent. --Aaron -- You received this message because you are subscribed to the Google Groups Clojure group.

Re: How I can use InteractionEvent in clojure?

2012-03-07 Thread Antonio Recio
You are right. I have capitalized InteractionEvent and now callback it is called and it prints invoke. The application runs but the boxWidget still doesn't work, and I obtain an error message: Exception in thread main java.lang.IllegalArgumentException: No matching field found: GetTransform

Re: How I can use InteractionEvent in clojure?

2012-03-07 Thread Mark Rathwell
You are trying to call method GetTransform on an instance of vtk.vtkTransform, and this method does not exist (you are probably wanting to call that method on boxWidget, not t). On Thu, Mar 8, 2012 at 12:32 AM, Antonio Recio amdx6...@gmail.com wrote: You are right. I have capitalized

Re: How I can use InteractionEvent in clojure?

2012-03-05 Thread Antonio Recio
Yes I have tried using fn and I gives me the same error : Exception in thread main java.lang.NoSuchMethodError: invoke -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from

Re: How I can use InteractionEvent in clojure?

2012-03-05 Thread Aaron Cohen
Actually, one last try before I build vtk and try it myself. The problem seems to me that vtk is looking for a method that takes no parameters and return void. invoke returns Object, let's use run instead. So try this: (def myCallback (fn [] (let [t (vtkTransform.)]

Re: How I can use InteractionEvent in clojure?

2012-03-05 Thread Antonio Recio
I have tried the new code. There are not errors in the prompt, but the boxWidget still doesn't work. It seems like boxWidget and the cone are not well connected. The final code that I have after using run: (ns example (:import (javax.swing JFrame JPanel SwingUtilities)))

Re: How I can use InteractionEvent in clojure?

2012-03-04 Thread Antonio Recio
How I can use proxy to set the AddObserver? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To

Re: How I can use InteractionEvent in clojure?

2012-03-04 Thread Aaron Cohen
On Sun, Mar 4, 2012 at 10:07 AM, Antonio Recio amdx6...@gmail.com wrote: How I can use proxy to set the AddObserver? I'm not sure what you mean, sorry, but I'll take a guess. If for some reason you want to use proxy rather than fn, it's possible. Also note, there's nothing magic about using IFn

Re: How I can use InteractionEvent in clojure?

2012-03-04 Thread Antonio Recio
I obtain this error: Exception in thread main java.lang.NoSuchMethodError: invoke -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be

Re: How I can use InteractionEvent in clojure?

2012-03-04 Thread Antonio Recio
This example works if you have installed vtk in your system, but it is not possible to re-size the cone using the boxWidget. I have disabled the line of AddObserver because it gives an error (Exception in thread main java.lang.NoSuchMethodError: invoke). What I am doing wrong? The source of

Re: How I can use InteractionEvent in clojure?

2012-03-04 Thread Antonio Recio
If it is not possible to use AddObserver, how I can use gen-class in this example? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be

Re: How I can use InteractionEvent in clojure?

2012-03-04 Thread Aaron Cohen
On Sun, Mar 4, 2012 at 2:17 PM, Antonio Recio amdx6...@gmail.com wrote: If it is not possible to use AddObserver, how I can use gen-class in this example? Hi Antonio, I can't use vtk on my laptop at the moment and don't want to send you down any more blind alleys with anything I can't

Re: How I can use InteractionEvent in clojure?

2012-03-03 Thread Antonio Recio
Any advice? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send

Re: How I can use InteractionEvent in clojure?

2012-03-03 Thread Aaron Cohen
On Sat, Mar 3, 2012 at 12:47 PM, Antonio Recio amdx6...@gmail.com wrote: Any advice? This is an odd library. My first shot would be to try something like: (def myCallback (fn [] (let [t (vtkTransform.)] (.GetTransform t) (- boxWidget .GetProp3D

How I can use InteractionEvent in clojure?

2012-03-02 Thread Antonio Recio
How I can translate this InteractionEvent written for a java example to clojure? void myCallback() { vtkTransform t = new vtkTransform(); boxWidget.GetTransform(t); boxWidget.GetProp3D().SetUserTransform(t);} boxWidget.AddObserver(InteractionEvent, this, myCallback);