void BoundingBoxDisplay::processMessage(
    const jsk_recognition_msgs::BoundingBox::ConstPtr& msg)
  {
    // Store latest message
    latest_msg_ = msg;

    // Convert bbox to bbox_array to show it
    jsk_recognition_msgs::BoundingBoxArrayPtr bbox_array_msg(new jsk_recognition_msgs::BoundingBoxArray);
    bbox_array_msg->header = msg->header;
    std::vector<jsk_recognition_msgs::BoundingBox> boxes;
    boxes.push_back(*msg);
    bbox_array_msg->boxes = boxes;

    if (!only_edge_) {
      showBoxes(bbox_array_msg);
    }
    else {
      showEdges(bbox_array_msg);
    }

    if (show_coords_) {
      showCoords(bbox_array_msg);
    }
    else {
      hideCoords();
    }
  }
void MaxFlowVisualizer::paintEvent(QPaintEvent *event) {
    QPainter painter(this);
    // Включает сглаживание.
    painter.setRenderHint(QPainter::Antialiasing);
    showEdges(painter);
    showVertecies(painter);
    drawHeightsBar(painter);
}