Home > Community > Forums > Custom IC SKILL > Freeform drawing with mouse

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Freeform drawing with mouse 

Last post Wed, Mar 26 2014 10:51 AM by girig. 5 replies.
Started by girig 25 Mar 2014 04:53 AM. Topic has 5 replies and 345 views
Page 1 of 1 (6 items)
Sort Posts:
  • Tue, Mar 25 2014 4:53 AM

    • girig
    • Not Ranked
    • Joined on Wed, Apr 17 2013
    • Posts 9
    • Points 150
    Freeform drawing with mouse Reply

    Hi,

      Is it possible to draw freeform curves/shapes in virtuoso?

    If not, any tricks that can make use of multiple piecewise "line" shapes tracking mouse movement?

    I was able to get a crude piece of code working through enterPoints, but that can only track clicks, so the user has to click in short bursts close enough to get the desired shape. It would be ideal if a mouse-drag can be used to draw piecewise linear points tracking the cursor - amounting to a free-form shape.

    procedure(addPt(win points)

     cv = deGetCellView(win)

     size = length(points)

     if(size>1 then

       pt1 = nthelem(size,points)

       pt2 = nthelem(size-1, points)

       dbCreateLine(cv list("text" "drawing") list(pt1 pt2))

      )

    )

    enterPoints(?prompts list("Enter Points") ?addPointProc "addPt" )

    Thanks !
    Giri. 
    • Post Points: 20
  • Wed, Mar 26 2014 10:04 AM

    Re: Freeform drawing with mouse Reply

    Giri,

    I don't believe this is possible (at least not with a public API). The "strokes" interface sort of does this, but it doesn't give you access to all the drawn points. This would need an enhancement request - so you'd have to contact customer support with an explanation as to why you need it (it's a slightly unusual request).

    Regards,

    Andrew.

    • Post Points: 20
  • Wed, Mar 26 2014 10:29 AM

    • girig
    • Not Ranked
    • Joined on Wed, Apr 17 2013
    • Posts 9
    • Points 150
    Re: Freeform drawing with mouse Reply
    Thanks Andrew. It was more for advanced gesture recognition, and as you rightly pointed out "strokes" doesn't give access to the co-ordinates. Plus if I remember right, the associated binaries only worked on solaris I guess? Anyways I'll see if there is enough RoI before going ahead with an enhancement request. Thanks, Giri.
    • Post Points: 35
  • Wed, Mar 26 2014 10:32 AM

    Re: Freeform drawing with mouse Reply

    Strokes still work, and you can create strokes in current versions. The old "sted" executable (which was only supported on Solaris and not Linux) has been retired and was replaced some time back with a new editor "stroke_editor" which runs on all platforms.

    So maybe if you use that you won't have to invent your own?

    The strokes interface does allow you to access the first and last points, as well as the bounding box of the stroke for use in your callback after the stroke has been recognized.

    Regards,

    Andrew.

    • Post Points: 5
  • Wed, Mar 26 2014 10:34 AM

    • skillUser
    • Top 10 Contributor
    • Joined on Fri, Sep 19 2008
    • Austin, TX
    • Posts 2,576
    • Points 15,725
    Re: Freeform drawing with mouse Reply

    Hi Giri,

    That used to be the case, but now you can access the Stroke Editor through the binary stroke_editor.  Take a look at Solution Article 11618300.

    Hopefully this will help you?

    Regards,

    Lawrence.

    • Post Points: 20
  • Wed, Mar 26 2014 10:51 AM

    • girig
    • Not Ranked
    • Joined on Wed, Apr 17 2013
    • Posts 9
    • Points 150
    Re: Freeform drawing with mouse Reply

    Andrew, Lawrence, 

     Thanks a bunch. This is really useful, sorry I had missed the updates towards linux support. I was able to invoke the stroke editor successfully. My original intent was to try and extract co-ordinates along the path of the gesture too (ceases to be a 'gesture' at that point and is more of a freeform shape), but this is definitely a good start and might cater to a good chunk of what I was looking for.

    Thanks once again!

    Giri. 

    • Post Points: 5
Page 1 of 1 (6 items)
Sort Posts:
Started by girig at 25 Mar 2014 04:53 AM. Topic has 5 replies.