Linetool.rb snap
-
I have been messing with the linetool.rb example and copy parts into my tool class, which is the code in the linetool.rb that makes the coloured dots appear over vertices before you click? I assume its in the mousemove function but I tried replicating it to no avail.
Sorry if its a dumb question but its hard to find much info about and the google docs can seem a bit vague. -
That's the InputPoints that draws them. Look in the
draw
method. -
@casey said:
... which is the code in the linetool.rb that makes the coloured dots appear over vertices before you click?
That function is built into the UI::InputPoint class, and is called "inferencing".
You can clear or lock the inferencing using the view.lock_inference method.
You cannot totally disable inferencing, if your tool is using UI::InputPoint.@casey said:
I assume its in the mousemove function but I tried replicating it to no avail.
If you wish to use your own special inferencing (or snap feature,) you must write it yourself, by using UI::PickHelper object, instead of a UI::InputPoint class object. You will be responsible for drawing the point at the proper place on the view, using one of the view draw methods: view.draw, view.draw2d, view.draw_points, etc.
@casey said:
Sorry if its a dumb question but its hard to find much info about and the google docs can seem a bit vague.
Yes the docs are vague. For more help see:
-
aiai... I meant to do a new version of that guide. ...one that made sense...
Advertisement