Discussion:
[fc] Problem creating duplicate shape on new selected location
Farrukh
2014-08-05 10:45:18 UTC
Permalink
Hi
i have drawn polygon on floatcanvas and when i create duplicate shape
that overwritten on same shape because of coordinates. my coorindates
are like this
[(-198.12865497076021, 355.08771929824559), (-210.9941520467836,
460.584795321
63739), (288.18713450292393, 512.046783625731), (321.63742690058479,
375.6725146
1988303), (108.07017543859648, 370.52631578947364), (133.80116959064327,
303.625
73099415204), (-198.12865497076021, 355.08771929824559)]

now i don't know how i can change coordinates to new X, Y and preserving
shape as it is. any help is appreciated.

Farrukh


---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
Chris Barker - NOAA Federal
2014-08-06 02:04:54 UTC
Permalink
Hi,

Sorry, on a phone now, so can't give examples. But I'm not sure I
understand what you want to do.

If two polygons happen to have the same coordinates, one will simply
be drawn on top of the other.

There is no automatic way to great a copy of a draw object -- you need
to create a new one with the same properties ( though copy.copy may
work -- I haven't tried it ).

If you want to change the coordinates, you can call Polygon.SetPoints(
theNewPoints )
Or

Polygon.Move()
If you want to keep it the same shape and move the whole thing.

HTH,

Chris
Post by Farrukh
Hi
i have drawn polygon on floatcanvas and when i create duplicate shape
that overwritten on same shape because of coordinates. my coorindates
are like this
[(-198.12865497076021, 355.08771929824559), (-210.9941520467836,
460.584795321
63739), (288.18713450292393, 512.046783625731), (321.63742690058479,
375.6725146
1988303), (108.07017543859648, 370.52631578947364), (133.80116959064327,
303.625
73099415204), (-198.12865497076021, 355.08771929824559)]
now i don't know how i can change coordinates to new X, Y and preserving
shape as it is. any help is appreciated.
Farrukh
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
_______________________________________________
FloatCanvas mailing list
http://mailman.paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
Farrukh
2014-08-06 06:51:43 UTC
Permalink
Thank you Polygon.Move() is exactly what i needed.

I have another question that obj coordinates like polygon can be drawn
using list of points, i need to get those list of points on which moved
shape is present.
Post by Chris Barker - NOAA Federal
Hi,
Sorry, on a phone now, so can't give examples. But I'm not sure I
understand what you want to do.
If two polygons happen to have the same coordinates, one will simply
be drawn on top of the other.
There is no automatic way to great a copy of a draw object -- you need
to create a new one with the same properties ( though copy.copy may
work -- I haven't tried it ).
If you want to change the coordinates, you can call Polygon.SetPoints(
theNewPoints )
Or
Polygon.Move()
If you want to keep it the same shape and move the whole thing.
HTH,
Chris
Post by Farrukh
Hi
i have drawn polygon on floatcanvas and when i create duplicate shape
that overwritten on same shape because of coordinates. my coorindates
are like this
[(-198.12865497076021, 355.08771929824559), (-210.9941520467836,
460.584795321
63739), (288.18713450292393, 512.046783625731), (321.63742690058479,
375.6725146
1988303), (108.07017543859648, 370.52631578947364), (133.80116959064327,
303.625
73099415204), (-198.12865497076021, 355.08771929824559)]
now i don't know how i can change coordinates to new X, Y and preserving
shape as it is. any help is appreciated.
Farrukh
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
_______________________________________________
FloatCanvas mailing list
http://mailman.paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
_______________________________________________
FloatCanvas mailing list
http://mailman.paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
Chris Barker - NOAA Federal
2014-08-06 15:09:38 UTC
Permalink
Post by Farrukh
Thank you Polygon.Move() is exactly what i needed.
I have another question that obj coordinates like polygon can be drawn
using list of points, i need to get those list of points on which moved
shape is present.
Shape.Points

As it is not well documented, browsing the source is the best way to
figure this sort of thing out.

As well as introspection:

Print dir( shape )

Will show you all the attributes of your shape -- the names are pretty
self-explanatory.

-Chris


-Chris
Post by Farrukh
Post by Chris Barker - NOAA Federal
Hi,
Sorry, on a phone now, so can't give examples. But I'm not sure I
understand what you want to do.
If two polygons happen to have the same coordinates, one will simply
be drawn on top of the other.
There is no automatic way to great a copy of a draw object -- you need
to create a new one with the same properties ( though copy.copy may
work -- I haven't tried it ).
If you want to change the coordinates, you can call Polygon.SetPoints(
theNewPoints )
Or
Polygon.Move()
If you want to keep it the same shape and move the whole thing.
HTH,
Chris
Post by Farrukh
Hi
i have drawn polygon on floatcanvas and when i create duplicate shape
that overwritten on same shape because of coordinates. my coorindates
are like this
[(-198.12865497076021, 355.08771929824559), (-210.9941520467836,
460.584795321
63739), (288.18713450292393, 512.046783625731), (321.63742690058479,
375.6725146
1988303), (108.07017543859648, 370.52631578947364), (133.80116959064327,
303.625
73099415204), (-198.12865497076021, 355.08771929824559)]
now i don't know how i can change coordinates to new X, Y and preserving
shape as it is. any help is appreciated.
Farrukh
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
_______________________________________________
FloatCanvas mailing list
http://mailman.paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
_______________________________________________
FloatCanvas mailing list
http://mailman.paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
_______________________________________________
FloatCanvas mailing list
http://mailman.paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
Farrukh
2014-08-06 16:06:53 UTC
Permalink
Thank you once again it is what i wanted to do, sorry for my lack of
knowledge.

Farrukh
Post by Chris Barker - NOAA Federal
Post by Farrukh
Thank you Polygon.Move() is exactly what i needed.
I have another question that obj coordinates like polygon can be drawn
using list of points, i need to get those list of points on which moved
shape is present.
Shape.Points
As it is not well documented, browsing the source is the best way to
figure this sort of thing out.
Print dir( shape )
Will show you all the attributes of your shape -- the names are pretty
self-explanatory.
-Chris
-Chris
Post by Farrukh
Post by Chris Barker - NOAA Federal
Hi,
Sorry, on a phone now, so can't give examples. But I'm not sure I
understand what you want to do.
If two polygons happen to have the same coordinates, one will simply
be drawn on top of the other.
There is no automatic way to great a copy of a draw object -- you need
to create a new one with the same properties ( though copy.copy may
work -- I haven't tried it ).
If you want to change the coordinates, you can call Polygon.SetPoints(
theNewPoints )
Or
Polygon.Move()
If you want to keep it the same shape and move the whole thing.
HTH,
Chris
Post by Farrukh
Hi
i have drawn polygon on floatcanvas and when i create duplicate shape
that overwritten on same shape because of coordinates. my coorindates
are like this
[(-198.12865497076021, 355.08771929824559), (-210.9941520467836,
460.584795321
63739), (288.18713450292393, 512.046783625731), (321.63742690058479,
375.6725146
1988303), (108.07017543859648, 370.52631578947364), (133.80116959064327,
303.625
73099415204), (-198.12865497076021, 355.08771929824559)]
now i don't know how i can change coordinates to new X, Y and preserving
shape as it is. any help is appreciated.
Farrukh
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
_______________________________________________
FloatCanvas mailing list
http://mailman.paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
_______________________________________________
FloatCanvas mailing list
http://mailman.paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
_______________________________________________
FloatCanvas mailing list
http://mailman.paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
_______________________________________________
FloatCanvas mailing list
http://mailman.paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

Loading...