diff -rupN gazebo-10.1.0/gazebo/gui/plot/IncrementalPlot.cc gazebo-10.1.0-new/gazebo/gui/plot/IncrementalPlot.cc --- gazebo-10.1.0/gazebo/gui/plot/IncrementalPlot.cc 2019-03-29 01:58:32.000000000 +0100 +++ gazebo-10.1.0-new/gazebo/gui/plot/IncrementalPlot.cc 2022-12-21 18:08:37.162024275 +0100 @@ -25,6 +25,8 @@ #include +#include + #include "gazebo/common/Console.hh" #include "gazebo/common/Time.hh" diff -rupN gazebo-10.1.0/gazebo/gui/plot/PlotCurve.cc gazebo-10.1.0-new/gazebo/gui/plot/PlotCurve.cc --- gazebo-10.1.0/gazebo/gui/plot/PlotCurve.cc 2019-03-29 01:58:32.000000000 +0100 +++ gazebo-10.1.0-new/gazebo/gui/plot/PlotCurve.cc 2022-12-22 10:41:46.139129727 +0100 @@ -62,71 +62,71 @@ namespace gazebo /// \return Bounding box of the sample. public: virtual QRectF boundingRect() const { - if (this->d_boundingRect.width() < 0.0) - this->d_boundingRect = qwtBoundingRect(*this); + if (this->boundingRect().width() < 0.0) + this->boundingRect() = qwtBoundingRect(*this); // set a minimum bounding box height // this prevents plot's auto scale to zoom in on near-zero // floating point noise. double minHeight = 1e-3; - double absHeight = std::fabs(this->d_boundingRect.height()); + double absHeight = std::fabs(this->boundingRect().height()); if (absHeight < minHeight) { double halfMinHeight = minHeight * 0.5; - double mid = this->d_boundingRect.top() + + double mid = this->boundingRect().top() + (absHeight * 0.5); - this->d_boundingRect.setTop(mid - halfMinHeight); - this->d_boundingRect.setBottom(mid + halfMinHeight); + this->boundingRect().setTop(mid - halfMinHeight); + this->boundingRect().setBottom(mid + halfMinHeight); } - return this->d_boundingRect; + return this->boundingRect(); } /// \brief Add a point to the sample. /// \param[in] _point Point to add. public: inline void Add(const QPointF &_point) { - this->d_samples += _point; + this->m_samples += _point; - if (this->d_samples.size() > maxSampleSize) + if (this->m_samples.size() > maxSampleSize) { // remove sample window // update bounding rect? - this->d_samples.remove(0, windowSize); + this->m_samples.remove(0, windowSize); } - if (this->d_samples.size() == 1) + if (this->m_samples.size() == 1) { // init bounding rect - this->d_boundingRect.setTopLeft(_point); - this->d_boundingRect.setBottomRight(_point); + this->boundingRect().setTopLeft(_point); + this->boundingRect().setBottomRight(_point); return; } // expand bounding rect - if (_point.x() < this->d_boundingRect.left()) - this->d_boundingRect.setLeft(_point.x()); - else if (_point.x() > this->d_boundingRect.right()) - this->d_boundingRect.setRight(_point.x()); - if (_point.y() < this->d_boundingRect.top()) - this->d_boundingRect.setTop(_point.y()); - else if (_point.y() > this->d_boundingRect.bottom()) - this->d_boundingRect.setBottom(_point.y()); + if (_point.x() < this->boundingRect().left()) + this->boundingRect().setLeft(_point.x()); + else if (_point.x() > this->boundingRect().right()) + this->boundingRect().setRight(_point.x()); + if (_point.y() < this->boundingRect().top()) + this->boundingRect().setTop(_point.y()); + else if (_point.y() > this->boundingRect().bottom()) + this->boundingRect().setBottom(_point.y()); } /// \brief Clear the sample data. public: void Clear() { - this->d_samples.clear(); - this->d_samples.squeeze(); - this->d_boundingRect = QRectF(0.0, 0.0, -1.0, -1.0); + this->m_samples.clear(); + this->m_samples.squeeze(); + this->boundingRect() = QRectF(0.0, 0.0, -1.0, -1.0); } /// \brief Get the sample data. /// \return A vector of same points. public: QVector Samples() const { - return this->d_samples; + return this->m_samples; } /// \brief maxium sample size of this curve.