Beispiel #1
0
 def insertSegment(self,
                   index,
                   type=None,
                   points=None,
                   smooth=False,
                   segment=None):
     """
     Insert a segment into the contour.
     """
     if segment is not None:
         if type is not None:
             type = segment.type
         if points is None:
             points = [(point.x, point.y) for point in segment.points]
         smooth = segment.smooth
     index = normalizers.normalizeIndex(index)
     type = normalizers.normalizeSegmentType(type)
     pts = []
     for pt in points:
         pt = normalizers.normalizeCoordinateTuple(pt)
         pts.append(pt)
     points = pts
     smooth = normalizers.normalizeBoolean(smooth)
     self._insertSegment(index=index,
                         type=type,
                         points=points,
                         smooth=smooth)
Beispiel #2
0
 def appendSegment(self, type, points, smooth=False):
     """
     Append a segment to the contour.
     """
     type = normalizers.normalizeSegmentType(type)
     pts = []
     for pt in points:
         pt = normalizers.normalizeCoordinateTuple(pt)
         pts.append(pt)
     points = pts
     smooth = normalizers.normalizeBoolean(smooth)
     self._appendSegment(type=type, points=points, smooth=smooth)
Beispiel #3
0
 def insertSegment(self, index, type, points, smooth=False):
     """
     Insert a segment into the contour.
     """
     index = normalizers.normalizeIndex(index)
     type = normalizers.normalizeSegmentType(type)
     pts = []
     for pt in points:
         pt = normalizers.normalizeCoordinateTuple(pt)
         pts.append(pt)
     points = pts
     smooth = normalizers.normalizeBoolean(smooth)
     self._insertSegment(index=index, type=type,
                         points=points, smooth=smooth)
Beispiel #4
0
 def appendSegment(self, type=None, points=None, smooth=False, segment=None):
     """
     Append a segment to the contour.
     """
     if segment is not None:
         if type is not None:
             type = segment.type
         if points is None:
             points = [(point.x, point.y) for point in segment.points]
         smooth = segment.smooth
     type = normalizers.normalizeSegmentType(type)
     pts = []
     for pt in points:
         pt = normalizers.normalizeCoordinateTuple(pt)
         pts.append(pt)
     points = pts
     smooth = normalizers.normalizeBoolean(smooth)
     self._appendSegment(type=type, points=points, smooth=smooth)
Beispiel #5
0
 def _set_base_type(self, value):
     value = normalizers.normalizeSegmentType(value)
     self._set_type(value)
Beispiel #6
0
 def _get_base_type(self):
     value = self._get_type()
     value = normalizers.normalizeSegmentType(value)
     return value
Beispiel #7
0
 def _set_base_type(self, value):
     value = normalizers.normalizeSegmentType(value)
     self._set_type(value)
Beispiel #8
0
 def _get_base_type(self):
     value = self._get_type()
     value = normalizers.normalizeSegmentType(value)
     return value