"Selection tool" examples or libraries for Processing?

I have recently been working on a collection of mouse-controlled selection tools for Processing, much like the Adobe "marquee tools".

Users can a rectangle or a path-point-by-point method to draw multiple selections with the mouse, click on existing selections to move, modigy, or delete them, nudge active selections or selection points with keyboard keys, etc. etc. Selection objects store PVector lists and render as PShapes.

Are there existing tutorials / code examples / libraries for Processing that enable similar functionality?

This is interface for a piece of research software, but I don't want to re-invent the wheel if something similar is already out there. On the other hand, if nothing is out there and there is community interest then I could turn this into a library at some point.

Screen Shot 2016-09-26 at 15.13.59

Tagged:

Answers

  • So, nobody is aware of anything similar in any of the Processing GUI libraries or the map libraries? And no image editing or image markup tools in Processing?

    I'm a bit surprised if nobody has heard of anything for manipulating hand-drawn closed paths in Processing.

    Maybe selection tools are something that people would generally do with Java Swing rather than in Processing (or just write a C++ application, or use ImageJ GIMP etc. and not develop them at all).

  • How would your tool work if you select a section of a rectangle for example?

    I would be interested in your tool as I would like to manipulate geolocation data. When you return the selected objects, would I get access to my originally input data or just screen coordinates' information?

    Kf

  • edited September 2016

    Currently drawing a selection with a mouse creates a new selection object on the selection stack.

    A selection object contains a list of vertices -- e.g. a rectangle ((0,0),(100,0),(100,100),(0,100)). The vertices are rendering coordinates -- whatever that means for the screen in terms of the transform matrix -- and designed by default to take mouseX/Y input and display to screenX/Y. A selection has two built-in render methods, drawLine(), which uses line() to trace a shape, for live input and editing, and drawShape(), which returns a closed polygon PShape built out of the vertex list. It also has a containsPoint() method for detecting mouse hovering or clicking on polygonal selections.

    I'm not sure how your geolocation data / library / app works, however if I'm understanding right you could create a generic screen-to-geo coordinate mapping function, so myGeoVector = geoConvert(selection.vecs.get(i));. Or you could extend the selection class to return those conversions as a class method, so myGeoVector = selection.geoVecs.get(i)); or myGeoVectorList = selection.getGeoVecs(); For my applications in image annotation, selections have types and metadata.

Sign In or Register to comment.