File: shapes.py

package info (click to toggle)
python-vispy 0.15.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,868 kB
  • sloc: python: 59,799; javascript: 6,800; makefile: 69; sh: 6
file content (57 lines) | stat: -rw-r--r-- 1,194 bytes parent folder | download | duplicates (5)
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