LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Track mouse up event in 3D Graph with cursor

Solved!
Go to solution

Hello Don,

 

Please see the attached code. I am tracking a couple of ActiveX events for the 3D Graph via event callback VIs. This will give you the rotation information that you are looking for.

 

All,

 

Does anybody have any ideas about breaking the exclusion between tracking the 3D Graph Cursor and tracking the Mouse Cursor Click Position?

 

If you set the track mode of the graph to "cwG3DTrackAllEvents" to track where the mouse was clicked (plot and point). But in this mode the graph does not respond to mouse drag, so you can't drag the Graph Cursors and you can not rotate, pan or zoom the graph. If you set the track mode to "cwG3DTrackZoomPanRotate", the graph works fine for tracking zoom, pan, rotate and Graph Cursor move, but doesn't track mouse cursor click position.

 

As for the issue about the mouse up event mentioned in my original post, here is what I've learnt so far.

The Graph generates a Mouse Up event if you just click on the graph.
If you drag and leave the mouse button, Mouse Up event is generated in the "cwG3DTrackAllEvents", but not in "cwG3DTrackZoomPanRotate"

 

Ravi Beniwal

 

P.S. I'm using LabVIEW 8.6

0 Kudos
Message 11 of 20
(4,177 Views)

Hello Ravi:

 

Can you save / will this work in 8.5?

 

I have to release an executable in 8.5 and will be ugrading after that.

 

For now just using extra mouse click on graph like you said to get the updated orientation..... 

 

Thanks,

 

Don

0 Kudos
Message 12 of 20
(4,157 Views)
....Or simply post a few screenshots with the essential code strategy.....Don
0 Kudos
Message 13 of 20
(4,145 Views)

Hello Don,

 

Here's the code, saved for LabVIEW 8.5.

Let me know if you have any questions.

 

Ravi Beniwal

0 Kudos
Message 14 of 20
(4,135 Views)

This looks awfully sweet.

 

What I have done preliminarily (since at the moment I am just interested in rotation info) is simplify the event structure quite extensively.

 

I just change the trackmode = cwG3DTrackZoomPanRotate on a mouse down event on surface graph and then rotate with mouse and the orientation is read as I rotate.  Then really I don't think I even need the mouse up event at this point.

 

But your overall strategy is a good one because I can see needing the zoom and pan in the future.

 

Sincerely,

 

Don

 

0 Kudos
Message 15 of 20
(4,125 Views)

One more interesting point about this.  Even though the rotate triggers a change in the 'Rotate (New Orientation)' indicator, a value change event on this indicator is not fired.  Yet I need such an event.  Any reason why not - is it just related to the callback strategy approach?

 

My workaround is actually to use a 'Mouse Move' event which is triggered during the rotate (even though I did not think this event would be triggered since we are in the TrackZoomPanRotate trackmode).

 

Any thoughts?

 

Don

0 Kudos
Message 16 of 20
(4,107 Views)

Hello Don,

 

The value change event doesn't fire when you change the value of any control or indicator programatically, using the "Value" property.

 

If you want the value change event to fire, please change the "Value" property in the Event Callback VI for Rotation Info to "Value (Signaling)". 

 

Ravi Beniwal

0 Kudos
Message 17 of 20
(4,103 Views)

Of course I was thinking of value signaling but how do you implement this (we are not talking a property node here)?  It might be staring me in the face but can you mod the simple VI I have posted or post a screenshot to illustrate?

 

Thanks,

 

Don

0 Kudos
Message 18 of 20
(4,098 Views)
Solution
Accepted by topic author Ravi_Beniwal
We are using a property node in the Rotation Callback VI. Please see the attached image (I've already changed the property node to Value (Signaling).
0 Kudos
Message 19 of 20
(4,095 Views)
Yes - I see.  Thanks so much!  Great work....Don
0 Kudos
Message 20 of 20
(4,091 Views)