def add_clearance_graph(self):
     print("-----------------------------------------")
     horizontal_clearance = self.clearance_analysis.horizontal_clearance
     x_init = self.graph_zero[0] + self.line_extend
     y_init = self.graph_zero[1]
     for i in range(len(horizontal_clearance)):
         clearance_points = horizontal_clearance[i]
         x = x_init + i * self.dimension_analysis.section_distance * self.length_multiplier
         left = -self.dimension_analysis.domain_length
         right = self.dimension_analysis.domain_length
         if clearance_points[0]:
             left = clearance_points[0]
         if clearance_points[1]:
             right = clearance_points[1]
         clearance = right - left
         y_top = y_init + left * self.height_multiplier
         y_bottom = y_init + right * self.height_multiplier
         pen_red = QPen()
         red = Color.create_qcolor_from_rgb_tuple(Color.red)
         pen_red.setColor(red)
         pen_green = QPen()
         green = Color.create_qcolor_from_rgb_tuple(Color.green)
         pen_green.setColor(green)
         line = QGraphicsLineItem(x, y_top, x, y_bottom)
         if clearance < self.min_horizontal_clearance:
             line.setPen(pen_red)
         else:
             line.setPen(pen_green)
         self.addToGroup(line)
     pass
 def init_color_interpolation(self):
     color_start = Color.create_qcolor_from_rgb_tuple(Color.red)
     color_end = Color.create_qcolor_from_rgb_tuple(Color.green)
     self.color_interpolation = ColorInterpolation(color_start, color_end, self.vertical_clearance_min, self.vertical_clearance_max)