On 5/6/11 3:25 AM, meliuss wrote:
> i like to use Floatcanvas2 with collision-detection.
> I create some Polygons with a list of Contourpoints.
> Now in Navcanvas i switch to GUI-Mode Move.
> I start move a Polygon
You may be a bit confused -- the built-in Move GUI-mode doesn't move the
polygon in world coordinates, it moves the view of the image -- so the
world-coordinates are not changed. This is probably not what you want.
> - How can I get the real-world(2d-Transformed) Polygonpoints (or for
> speed the Boundingbox) from the moving Node to check if there is a
> Collision with other Polygons(Nodes)
Every DrawObject should have a .BoundingBox attribute that you can
access. It is a floatcanvas.utilities.BBox.BBox object. That object has
methods like:
def Overlaps(self, BB):
"""
Overlap(BB):
Tests if the given Bounding Box overlaps with this one.
Returns True is the Bounding boxes overlap, False otherwise
If they are just touching, returns True
"""
which should be useful.
the Polygon object also has a .Points attribute, which is a numpy array
of the points.
> Are there some examples.
There are a lot of examples in:
http://svn.wxwidgets.org/viewvc/wx/wxPython/3rdParty/FloatCanvas/Demos/
Look at MovingElements.py in particular.
It's also well worth looking at the source code -- I haven't written
good docs, so that's the only way to know what's there.
Someone used Doxygen to build docs once -- that was pretty nice. It
would be good to revive that effort -- or, better yet, build docs with
Sphinx -- anyone want to help?
HTH,
- Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
[email protected]
_______________________________________________
FloatCanvas mailing list
[email protected]
http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas