1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2014, Nicolas P. Rougier
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
class Rect(object):
def __init__(self, x=0, y=0, width=1, height=1, rx=0, ry=0):
self.x = x
self.y = y
self.width = width
self.height = height
self.rx = rx
self.ry = ry
def parse(self, expression):
""" """
class Line(object):
def __init__(self, x1=0, y1=0, x2=0, y2=0):
self.x1 = x2
self.y1 = y2
self.x2 = x2
self.y2 = y2
class Circle(object):
def __init__(self, cx=0, cy=0, r=1):
self.cx = cx
self.cy = cy
self.r = r
class Ellipse(object):
def __init__(self, cx=0, cy=0, rx=1, ry=1):
self.cx = cx
self.cy = cy
self.rx = rx
self.ry = ry
class Polygon(object):
def __init__(self, points=[]):
self.points = points
class Polyline(object):
def __init__(self, points=[]):
self.points = points
|