add classes for constraints

This commit is contained in:
Josh Holtrop committed 2011-03-25 15:42:12 -04:00
1 parent 36c6f092fd
commit da1c47441e
4 files changed
+23

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
class Constraint(object):
pass
+10
View File
@@ -0,0 +1,10 @@
from Constraint import Constraint
class DistanceConstraint(Constraint):
def __init__(self, shape1, attr1, shape2, attr2, dist):
self.shape1 = shape1
self.shape2 = shape2
self.attr1 = attr1
self.attr2 = attr2
self.dist = dist
+9
View File
@@ -0,0 +1,9 @@
from Constraint import Constraint
class EqualConstraint(Constraint):
def __init__(self, shape1, attr1, shape2, attr2):
self.shape1 = shape1
self.shape2 = shape2
self.attr1 = attr1
self.attr2 = attr2
+1
View File
@@ -2,6 +2,7 @@
class Sketch(object): class Sketch(object):
def __init__(self): def __init__(self):
self.shapes = [] self.shapes = []
self.constraints = []
def __iter__(self): def __iter__(self):
return self.shapes.__iter__() return self.shapes.__iter__()