00001 // ***************************************************************************** 00002 // 00003 // Copyright (c) 2015, Southwest Research Institute® (SwRI®) 00004 // All rights reserved. 00005 // 00006 // Redistribution and use in source and binary forms, with or without 00007 // modification, are permitted provided that the following conditions are met: 00008 // * Redistributions of source code must retain the above copyright 00009 // notice, this list of conditions and the following disclaimer. 00010 // * Redistributions in binary form must reproduce the above copyright 00011 // notice, this list of conditions and the following disclaimer in the 00012 // documentation and/or other materials provided with the distribution. 00013 // * Neither the name of Southwest Research Institute® (SwRI®) nor the 00014 // names of its contributors may be used to endorse or promote products 00015 // derived from this software without specific prior written permission. 00016 // 00017 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00018 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00019 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00020 // ARE DISCLAIMED. IN NO EVENT SHALL Southwest Research Institute® BE LIABLE 00021 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00022 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00023 // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00024 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00025 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00026 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 00027 // DAMAGE. 00028 // 00029 // ***************************************************************************** 00030 #include <swri_profiler_tools/time_plot_widget.h> 00031 00032 #include <QPainter> 00033 #include <QMouseEvent> 00034 00035 #include <swri_profiler_tools/profile_database.h> 00036 00037 namespace swri_profiler_tools 00038 { 00039 TimePlotWidget::TimePlotWidget(QWidget *parent) 00040 : 00041 QWidget(parent), 00042 db_(NULL) 00043 { 00044 setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); 00045 } 00046 00047 TimePlotWidget::~TimePlotWidget() 00048 { 00049 } 00050 00051 QSize TimePlotWidget::sizeHint() const 00052 { 00053 return QSize(200, 200); 00054 } 00055 00056 void TimePlotWidget::setDatabase(ProfileDatabase *db) 00057 { 00058 if (db_) { 00059 // note(exjohnson): we can implement this later if desired, but 00060 // currently no use case for it. 00061 qWarning("TimePlotWidget: Cannot change the profile database."); 00062 return; 00063 } 00064 00065 db_ = db; 00066 } 00067 00068 void TimePlotWidget::setActiveNode(int profile_key, int node_key) 00069 { 00070 } 00071 00072 void TimePlotWidget::enterEvent(QEvent *event) 00073 { 00074 } 00075 00076 void TimePlotWidget::leaveEvent(QEvent *event) 00077 { 00078 } 00079 00080 void TimePlotWidget::mouseMoveEvent(QMouseEvent *event) 00081 { 00082 } 00083 00084 void TimePlotWidget::mousePressEvent(QMouseEvent *event) 00085 { 00086 } 00087 00088 void TimePlotWidget::mouseDoubleClickEvent(QMouseEvent *event) 00089 { 00090 } 00091 00092 void TimePlotWidget::paintEvent(QPaintEvent *) 00093 { 00094 QPainter painter(this); 00095 00096 painter.setPen(Qt::NoPen); 00097 painter.fillRect(0, 0, width(), height(), QColor(255, 255, 255)); 00098 painter.setPen(Qt::black); 00099 00100 } 00101 } // namespace swri_profiler_tools