linetypes.py

changeset 35
865cd526e8b6
parent 7
0ab0d61ccee8
child 38
66c9591b733d
equal deleted inserted replaced
34:7ed2e831acd4 35:865cd526e8b6
92 def textual_representation(self): 92 def textual_representation(self):
93 return '4 ' + self.base_textual_representation() 93 return '4 ' + self.base_textual_representation()
94 def typename(self): 94 def typename(self):
95 return 'quadrilateral' 95 return 'quadrilateral'
96 96
97 class Contour(LineSegment): 97 class ConditionalLine(LineSegment):
98 def __init__(self, *, colour, geometry, control_points): 98 def __init__(self, *, colour, geometry, control_points):
99 super().__init__(colour = colour, geometry = geometry) 99 super().__init__(colour = colour, geometry = geometry)
100 self.control_points = control_points 100 self.control_points = control_points
101 assert(len(self.control_points) == 2) 101 assert(len(self.control_points) == 2)
102 def __repr__(self): 102 def __repr__(self):
103 return str.format('linetypes.Contour(' \ 103 return str.format('linetypes.ConditionalLine(' \
104 'colour = {colour!r}, ' \ 104 'colour = {colour!r}, ' \
105 'geometry = {geometry!r}, ' \ 105 'geometry = {geometry!r}, ' \
106 'control_points = {control_points!r})', **self.__dict__) 106 'control_points = {control_points!r})', **self.__dict__)
107 def textual_representation(self): 107 def textual_representation(self):
108 result = '5 ' + self.base_textual_representation() 108 result = '5 ' + self.base_textual_representation()

mercurial