]> git.saurik.com Git - wxWidgets.git/blame - wxPython/wx/lib/floatcanvas/__init__.py
Remove const bool
[wxWidgets.git] / wxPython / wx / lib / floatcanvas / __init__.py
CommitLineData
42463de2
RD
1"""
2This is the floatcanvas package. It provides two primary modules, and a
3support module.
4
2a0495c9 5FloatCanvas.py contains the main FloatCanvas class, and its supporting
42463de2
RD
6classes. NavCanvas.py contains a wrapper for the FloatCanvas that
7provides the canvas and a toolbar with tools that allow you to navigate
8the canvas (zooming, panning, etc.) Resources.py is a module that
9contains a few resources required by the FloatCanvas (icons, etc)
10
11The FloatCanvas is a high level window for drawing maps and anything
12else in an arbitrary coordinate system.
13
14The goal is to provide a convenient way to draw stuff on the screen
15without having to deal with handling OnPaint events, converting to pixel
16coordinates, knowing about wxWindows brushes, pens, and colors, etc. It
17also provides virtually unlimited zooming and scrolling
18
19I am using it for two things:
201) general purpose drawing in floating point coordinates
212) displaying map data in Lat-long coordinates
22
23If the projection is set to None, it will draw in general purpose
24floating point coordinates. If the projection is set to 'FlatEarth', it
25will draw a FlatEarth projection, centered on the part of the map that
26you are viewing. You can also pass in your own projection function.
27
28It is double buffered, so re-draws after the window is uncovered by
29something else are very quick.
30
31It relies on NumPy, which is needed for speed (maybe, I haven't profiled
0b0849b5 32properly) and convenience.
42463de2
RD
33
34Bugs and Limitations: Lots: patches, fixes welcome
35
36For Map drawing: It ignores the fact that the world is, in fact, a
37sphere, so it will do strange things if you are looking at stuff near
38the poles or the date line. so far I don't have a need to do that, so I
39havn't bothered to add any checks for that yet.
40
41Zooming: I have set no zoom limits. What this means is that if you zoom
42in really far, you can get integer overflows, and get weird results. It
43doesn't seem to actually cause any problems other than weird output, at
44least when I have run it.
45
46Speed: I have done a couple of things to improve speed in this app. The
47one thing I have done is used NumPy Arrays to store the coordinates of
48the points of the objects. This allowed me to use array oriented
49functions when doing transformations, and should provide some speed
50improvement for objects with a lot of points (big polygons, polylines,
51pointsets).
52
53The real slowdown comes when you have to draw a lot of objects, because
54you have to call the wx.DC.DrawSomething call each time. This is plenty
55fast for tens of objects, OK for hundreds of objects, but pretty darn
56slow for thousands of objects.
57
58If you are zoomed in, it checks the Bounding box of an object before
59drawing it. This makes it a great deal faster when there are a lot of
60objects and you are zoomed in so that only a few are shown.
61
42463de2
RD
62Mouse Events:
63
095315e2
RD
64There are a full set of custom mouse events. They are just like the
65regular mouse events, but include an extra attribute: Event.GetCoords(),
66that returns the (x,y) position in world coordinates, as a length-2
67NumPy vector of Floats.
42463de2 68
2a0495c9 69There are also a full set of bindings to mouse events on objects, so
095315e2 70that you can specify a given function be called when an object is
2a0495c9
RD
71clicked, mouse-over'd, etc.
72
42463de2
RD
73See the Demo for what it can do, and how to use it.
74
75Copyright: Christopher Barker
42463de2
RD
76License: Same as the version of wxPython you are using it with.
77
0b0849b5
RD
78TRAC site for some docs and updates:
79http://morticia.cs.dal.ca/FloatCanvas/
42463de2 80
0b0849b5
RD
81SVN for latest code:
82svn://morticia.cs.dal.ca/FloatCanvas
42463de2 83
0b0849b5
RD
84Mailing List:
85http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas
86
87Check for updates or answers to questions, send me an email.
88Please let me know if you're using this!!!
42463de2
RD
89Contact me at:
90
91Chris.Barker@noaa.gov
92
93"""
94
0b0849b5 95__version__ = "0.9.18"
42463de2
RD
96
97