Some Py3 and various other fixes from wxGuru.

Merged and squashed from https://github.com/RobinD42/Phoenix/pull/15,
with additional edits.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@74364 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2013-07-05 20:54:22 +00:00
parent de0fab0786
commit 2e30a88173
17 changed files with 129 additions and 150 deletions

View File

@@ -5,7 +5,11 @@ A Bounding Box object and assorted utilities , subclassed from a numpy array
"""
import numpy as N
try:
import numpy as N
except ImportError:
pass
# raise ImportError("I could not import numpy")
class BBox(N.ndarray):
"""
@@ -267,7 +271,7 @@ class RectBBox(BBox):
return BBox.__new__(self, data)
def __init__(self, data, edges=None):
''' assume edgepoints are ordered such you can walk along all edges with left rotation sense
""" assume edgepoints are ordered such you can walk along all edges with left rotation sense
This may be:
left-top
left-bottom
@@ -275,11 +279,11 @@ class RectBBox(BBox):
right-top
or any rotation.
'''
"""
BBox.BBox(data)
self.edges = np.asarray(edges)
print "new rectbbox created"
print("new rectbbox created")
def ac_leftOf_ab(self, a, b, c):
@@ -289,7 +293,7 @@ class RectBBox(BBox):
return (ac[0]*ab[1] - ac[1]*ab[0]) <= 0
def PointInside(self, point):
print "point inside called"
print("point inside called")
for edge in xrange(4):
if self.ac_leftOf_ab(self.edges[edge],