From b2f6eb0606be607c176121ad4ae272e3112f44eb Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 4 Jun 2004 20:12:01 +0000 Subject: [PATCH] Since everything in the submodules is to appear in the pacakge namespace rename the submodule to have a leading underscore to make it easier to document it that way. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27634 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/wx/lib/ogl/__init__.py | 26 +++++++----- wxPython/wx/lib/ogl/{basic.py => _basic.py} | 40 +++++++++---------- .../wx/lib/ogl/{bmpshape.py => _bmpshape.py} | 2 +- wxPython/wx/lib/ogl/{canvas.py => _canvas.py} | 4 +- .../wx/lib/ogl/{composit.py => _composit.py} | 4 +- .../wx/lib/ogl/{diagram.py => _diagram.py} | 0 .../wx/lib/ogl/{divided.py => _divided.py} | 4 +- wxPython/wx/lib/ogl/{lines.py => _lines.py} | 39 +++++++++--------- .../wx/lib/ogl/{oglmisc.py => _oglmisc.py} | 16 ++++---- 9 files changed, 71 insertions(+), 64 deletions(-) rename wxPython/wx/lib/ogl/{basic.py => _basic.py} (99%) rename wxPython/wx/lib/ogl/{bmpshape.py => _bmpshape.py} (98%) rename wxPython/wx/lib/ogl/{canvas.py => _canvas.py} (99%) rename wxPython/wx/lib/ogl/{composit.py => _composit.py} (99%) rename wxPython/wx/lib/ogl/{diagram.py => _diagram.py} (100%) rename wxPython/wx/lib/ogl/{divided.py => _divided.py} (99%) rename wxPython/wx/lib/ogl/{lines.py => _lines.py} (97%) rename wxPython/wx/lib/ogl/{oglmisc.py => _oglmisc.py} (95%) diff --git a/wxPython/wx/lib/ogl/__init__.py b/wxPython/wx/lib/ogl/__init__.py index 667ed0afe1..c295f49323 100644 --- a/wxPython/wx/lib/ogl/__init__.py +++ b/wxPython/wx/lib/ogl/__init__.py @@ -3,12 +3,20 @@ The Object Graphics Library provides for simple drawing and manipulation of 2D objects. """ -__all__ = ["basic", "diagram", "canvas", "lines", "bmpshape", "divided", "composit"] - -from basic import * -from diagram import * -from canvas import * -from lines import * -from bmpshape import * -from divided import * -from composit import * +from _basic import * +from _diagram import * +from _canvas import * +from _lines import * +from _bmpshape import * +from _divided import * +from _composit import * + + + +# Set things up for documenting with epydoc. The __docfilter__ will +# prevent some things from beign documented, and anything in __all__ +# will appear to actually exist in this module. +import wx._core as _wx +__docfilter__ = _wx.__DocFilter(globals()) +__all__ = [name for name in dir() if not name.startswith('_')] + diff --git a/wxPython/wx/lib/ogl/basic.py b/wxPython/wx/lib/ogl/_basic.py similarity index 99% rename from wxPython/wx/lib/ogl/basic.py rename to wxPython/wx/lib/ogl/_basic.py index 43bdb74248..5b6fca3b06 100644 --- a/wxPython/wx/lib/ogl/basic.py +++ b/wxPython/wx/lib/ogl/_basic.py @@ -14,9 +14,9 @@ from __future__ import division import wx -from math import pi, sqrt, atan, sin, cos +import math -from oglmisc import * +from _oglmisc import * DragOffsetX = 0.0 DragOffsetY = 0.0 @@ -484,7 +484,7 @@ class Shape(ShapeEvtHandler): e = self.GetAttachmentPositionEdge(i) if e: xp, yp = e - l = sqrt(((xp - x) * (xp - x)) + (yp - y) * (yp - y)) + l = math.sqrt(((xp - x) * (xp - x)) + (yp - y) * (yp - y)) if l2 * pi: - self._rotation -= 2 * pi + self._rotation += 2 * math.pi + elif self._rotation>2 * math.pi: + self._rotation -= 2 * math.pi def GetBackgroundPen(self): """Return pen of the right colour for the background.""" @@ -2528,7 +2528,7 @@ class PolygonShape(Shape): e = self.GetAttachmentPositionEdge(i) if e: xp, yp = e - l = sqrt((xp - x) * (xp - x) + (yp - y) * (yp - y)) + l = math.sqrt((xp - x) * (xp - x) + (yp - y) * (yp - y)) if ly1: theta = pi / 2 elif x2>x1 and y2 >= y1: - theta = atan((y2-y1) / (x2-x1)) + theta = math.atan((y2-y1) / (x2-x1)) elif x2x1 and y2y2: - y4 = y1 - sqrt((b1 * b1 - (((x2 - x1) * (x2 - x1)) * (b1 * b1) / (a1 * a1)))) + y4 = y1 - math.sqrt((b1 * b1 - (((x2 - x1) * (x2 - x1)) * (b1 * b1) / (a1 * a1)))) else: - y4 = y1 + sqrt((b1 * b1 - (((x2 - x1) * (x2 - x1)) * (b1 * b1) / (a1 * a1)))) + y4 = y1 + math.sqrt((b1 * b1 - (((x2 - x1) * (x2 - x1)) * (b1 * b1) / (a1 * a1)))) return x4, y4 # Calculate the x and y coordinates of the point where arc intersects ellipse @@ -393,10 +393,10 @@ def DrawArcToEllipse(x1, y1, width1, height1, x2, y2, x3, y3): if K >= 0: # In this case the line intersects the ellipse, so calculate intersection if x2 >= x1: - ellipse1_x = ((F*-1) + sqrt(K)) / (2 * E) + ellipse1_x = ((F*-1) + math.sqrt(K)) / (2 * E) ellipse1_y = ((H * (ellipse1_x - x2)) + y2) else: - ellipse1_x = (((F*-1) - sqrt(K)) / (2 * E)) + ellipse1_x = (((F*-1) - math.sqrt(K)) / (2 * E)) ellipse1_y = ((H * (ellipse1_x - x2)) + y2) else: # in this case, arc does not intersect ellipse, so just draw arc @@ -408,7 +408,7 @@ def DrawArcToEllipse(x1, y1, width1, height1, x2, y2, x3, y3): def FindEndForCircle(radius, x1, y1, x2, y2): - H = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)) + H = math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)) if H == 0: return x1, y1 -- 2.50.0