void pcl::ihs::InHandScanner::drawText () { QPainter painter (this); painter.setPen (Qt::white); QFont font; if (starting_grabber_) { font.setPointSize (this->width () / 20); painter.setFont (font); painter.drawText (0, 0, this->width (), this->height (), Qt::AlignHCenter | Qt::AlignVCenter, "Starting the grabber.\n Please wait."); } else { std::string vis_fps ("Visualization: "), comp_fps ("Computation: "); vis_fps.append (visualization_fps_.str ()).append (" fps"); comp_fps.append (computation_fps_.str ()).append (" fps"); const std::string str = std::string (comp_fps).append ("\n").append (vis_fps); font.setPointSize (this->width () / 50); painter.setFont (font); painter.drawText (0, 0, this->width (), this->height (), Qt::AlignBottom | Qt::AlignLeft, str.c_str ()); } }
void pcl::ihs::OfflineIntegration::paintEvent (QPaintEvent* event) { Base::paintEvent (event); QPainter painter (this); painter.setPen (Qt::white); QFont font; font.setPointSize (this->width () / 50); painter.setFont (font); std::string vis_fps ("Visualization: "), comp_fps ("Computation: "); { boost::mutex::scoped_lock lock (mutex_); this->calcFPS (visualization_fps_); vis_fps.append (visualization_fps_.str ()).append (" fps"); comp_fps.append (computation_fps_.str ()).append (" fps"); } const std::string str = std::string (comp_fps).append ("\n").append (vis_fps); painter.drawText (0, 0, this->width (), this->height (), Qt::AlignBottom | Qt::AlignLeft, str.c_str ()); }