jzaremba / guiqwt

Automatically exported from code.google.com/p/guiqwt
Other
0 stars 1 forks source link

How to customize a shape produced by a tool like FreeFormTool #29

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi guys !
First of all, thanks for the job, it's quite nice !

I am building an app in which I need to select clusters of points. For that 
purpose I saw the FreeFormTool and it is able to build one polygon for me. The 
problem is that I want to create several polygons each one with a different 
color/marker. Is there ant way to specify in advance the properties of a newly 
created polygon ? Once a Polygon is created, how can I get a handle to interact 
with it, i.e. obtain the coordinates ?

Thanks

Original issue reported on code.google.com by heman...@gmail.com on 19 Jun 2012 at 6:44

GoogleCodeExporter commented 9 years ago
Also, how can I send a signal that I stopped creating a polygon, and that I 
would like to create another one ?

Thanks

Original comment by heman...@gmail.com on 19 Jun 2012 at 6:46

GoogleCodeExporter commented 9 years ago
A quick word regarding the FreeFormTool (and MultiLineTool) event handlers:
  * left mouse click and hold to set the first line
  * left mouse clicks for adding more points
  * press Enter to validate the shape and add a new one

To customize a newly validated shape, that's easy: you just have to pass the 
'handle_final_shape_cb' option to the FreeFormTool class constructor.

I'll add an example shortly.

Original comment by pierre.raybaut on 7 Nov 2012 at 11:07

GoogleCodeExporter commented 9 years ago
This issue was updated by revision a2705e3b0628.

Original comment by pierre.raybaut on 7 Nov 2012 at 4:22