* src/docgen/PSDrawDoc.py: remove draw_wedge from BaseDoc
* src/ReportBase/_ReportUtils.py: remove draw_wedge from BaseDoc * src/plugins/FanChart.py: remove draw_wedge from BaseDoc * src/BaseDoc.py: remove draw_wedge from BaseDoc svn: r8121
This commit is contained in:
@@ -66,7 +66,6 @@ __revision__ = "Revision:$Id$"
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import os
|
||||
from math import pi, cos, sin
|
||||
from xml.sax.saxutils import escape
|
||||
|
||||
def escxml(d):
|
||||
@@ -1445,55 +1444,3 @@ class BaseDoc:
|
||||
def draw_line(self, style, x1, y1, x2, y2):
|
||||
pass
|
||||
|
||||
def draw_wedge(self, style, centerx, centery, radius, start_angle,
|
||||
end_angle, short_radius=0):
|
||||
|
||||
assert(self.init_called)
|
||||
while end_angle < start_angle:
|
||||
end_angle += 360
|
||||
|
||||
p = []
|
||||
|
||||
degreestoradians = pi / 180.0
|
||||
radiansdelta = degreestoradians / 2
|
||||
sangle = start_angle * degreestoradians
|
||||
eangle = end_angle * degreestoradians
|
||||
while eangle < sangle:
|
||||
eangle = eangle + 2 * pi
|
||||
angle = sangle
|
||||
|
||||
if short_radius == 0:
|
||||
if (end_angle - start_angle) != 360:
|
||||
p.append((centerx, centery))
|
||||
else:
|
||||
origx = (centerx + cos(angle) * short_radius)
|
||||
origy = (centery + sin(angle) * short_radius)
|
||||
p.append((origx, origy))
|
||||
|
||||
while angle < eangle:
|
||||
x = centerx + cos(angle) * radius
|
||||
y = centery + sin(angle) * radius
|
||||
p.append((x, y))
|
||||
angle = angle + radiansdelta
|
||||
x = centerx + cos(eangle) * radius
|
||||
y = centery + sin(eangle) * radius
|
||||
p.append((x, y))
|
||||
|
||||
if short_radius:
|
||||
x = centerx + cos(eangle) * short_radius
|
||||
y = centery + sin(eangle) * short_radius
|
||||
p.append((x, y))
|
||||
|
||||
angle = eangle
|
||||
while angle >= sangle:
|
||||
x = centerx + cos(angle) * short_radius
|
||||
y = centery + sin(angle) * short_radius
|
||||
p.append((x, y))
|
||||
angle = angle - radiansdelta
|
||||
self.draw_path(style, p)
|
||||
|
||||
delta = (eangle - sangle) / 2.0
|
||||
rad = short_radius + (radius - short_radius) / 2.0
|
||||
|
||||
return ( (centerx + cos(sangle + delta) * rad),
|
||||
(centery + sin(sangle + delta) * rad))
|
||||
|
Reference in New Issue
Block a user