parameters: (self, pt1, pt2, nth, noArcs, line)
return_statement: return x, y
docstring: Assuming the attachment lies along a vertical or horizontal line,
          calculate the position on that point.
  
          Parameters:
  
          pt1
              The first point of the line repesenting the edge of the shape.
  
          pt2
              The second point of the line representing the edge of the shape.
  
          nth
              The position on the edge (for example there may be 6 lines at
              this attachment point, and this may be the 2nd line.
  
          noArcs
              The number of lines at this edge.
  
          line
              The line shape.
  
          Remarks
  
          This function expects the line to be either vertical or horizontal,
          and determines which.
docstring_summary: Assuming the attachment lies along a vertical or horizontal line,
          calculate the position on that point.
docstring_tokens: Assuming the attachment lies along a vertical or horizontal line calculate the position on that point .
function: def CalcSimpleAttachment(self, pt1, pt2, nth, noArcs, line):
          """Assuming the attachment lies along a vertical or horizontal line,
          calculate the position on that point.
  
          Parameters:
  
          pt1
              The first point of the line repesenting the edge of the shape.
  
          pt2
              The second point of the line representing the edge of the shape.
  
          nth
              The position on the edge (for example there may be 6 lines at
              this attachment point, and this may be the 2nd line.
  
          noArcs
              The number of lines at this edge.
  
          line
              The line shape.
  
          Remarks
  
          This function expects the line to be either vertical or horizontal,
          and determines which.
          """
          isEnd = line and line.IsEnd(self)
  
          # Are we horizontal or vertical?
          isHorizontal = RoughlyEqual(pt1[1], pt2[1])
  
          if isHorizontal:
              if pt1[0] > pt2[0]:
                  firstPoint = pt2
                  secondPoint = pt1
              else:
                  firstPoint = pt1
                  secondPoint = pt2
  
              if self._spaceAttachments:
                  if line and line.GetAlignmentType(isEnd) == LINE_ALIGNMENT_TO_NEXT_HANDLE:
                      # Align line according to the next handle along
                      point = line.GetNextControlPoint(self)
                      if point[0] < firstPoint[0]:
                          x = firstPoint[0]
                      elif point[0] > secondPoint[0]:
                          x = secondPoint[0]
                      else:
                          x = point[0]
                  else:
                      x = firstPoint[0] + (nth + 1) * (secondPoint[0] - firstPoint[0]) / (noArcs + 1.0)
              else:
                  x = (secondPoint[0] - firstPoint[0]) / 2.0 # Midpoint
              y = pt1[1]
          else:
              assert RoughlyEqual(pt1[0], pt2[0])
  
              if pt1[1] > pt2[1]:
                  firstPoint = pt2
                  secondPoint = pt1
              else:
                  firstPoint = pt1
                  secondPoint = pt2
  
              if self._spaceAttachments:
                  if line and line.GetAlignmentType(isEnd) == LINE_ALIGNMENT_TO_NEXT_HANDLE:
                      # Align line according to the next handle along
                      point = line.GetNextControlPoint(self)
                      if point[1] < firstPoint[1]:
                          y = firstPoint[1]
                      elif point[1] > secondPoint[1]:
                          y = secondPoint[1]
                      else:
                          y = point[1]
                  else:
                      y = firstPoint[1] + (nth + 1) * (secondPoint[1] - firstPoint[1]) / (noArcs + 1.0)
              else:
                  y = (secondPoint[1] - firstPoint[1]) / 2.0 # Midpoint
              x = pt1[0]
  
          return x, y
function_tokens: def CalcSimpleAttachment ( self , pt1 , pt2 , nth , noArcs , line ) : isEnd = line and line . IsEnd ( self ) # Are we horizontal or vertical? isHorizontal = RoughlyEqual ( pt1 [ 1 ] , pt2 [ 1 ] ) if isHorizontal : if pt1 [ 0 ] > pt2 [ 0 ] : firstPoint = pt2 secondPoint = pt1 else : firstPoint = pt1 secondPoint = pt2 if self . _spaceAttachments : if line and line . GetAlignmentType ( isEnd ) == LINE_ALIGNMENT_TO_NEXT_HANDLE : # Align line according to the next handle along point = line . GetNextControlPoint ( self ) if point [ 0 ] < firstPoint [ 0 ] : x = firstPoint [ 0 ] elif point [ 0 ] > secondPoint [ 0 ] : x = secondPoint [ 0 ] else : x = point [ 0 ] else : x = firstPoint [ 0 ] + ( nth + 1 ) * ( secondPoint [ 0 ] - firstPoint [ 0 ] ) / ( noArcs + 1.0 ) else : x = ( secondPoint [ 0 ] - firstPoint [ 0 ] ) / 2.0 # Midpoint y = pt1 [ 1 ] else : assert RoughlyEqual ( pt1 [ 0 ] , pt2 [ 0 ] ) if pt1 [ 1 ] > pt2 [ 1 ] : firstPoint = pt2 secondPoint = pt1 else : firstPoint = pt1 secondPoint = pt2 if self . _spaceAttachments : if line and line . GetAlignmentType ( isEnd ) == LINE_ALIGNMENT_TO_NEXT_HANDLE : # Align line according to the next handle along point = line . GetNextControlPoint ( self ) if point [ 1 ] < firstPoint [ 1 ] : y = firstPoint [ 1 ] elif point [ 1 ] > secondPoint [ 1 ] : y = secondPoint [ 1 ] else : y = point [ 1 ] else : y = firstPoint [ 1 ] + ( nth + 1 ) * ( secondPoint [ 1 ] - firstPoint [ 1 ] ) / ( noArcs + 1.0 ) else : y = ( secondPoint [ 1 ] - firstPoint [ 1 ] ) / 2.0 # Midpoint x = pt1 [ 0 ] return x , y