Skip to content

Commit

Permalink
Merge branch 'update_3.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
facontidavide committed Nov 13, 2023
2 parents c72a6f2 + 0764a61 commit ee678b0
Show file tree
Hide file tree
Showing 20 changed files with 392 additions and 308 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ros1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ jobs:
strategy:
matrix:
env:
- {ROS_DISTRO: melodic, ROS_REPO: main}
- {ROS_DISTRO: noetic, ROS_REPO: main}
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/ros2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ jobs:
strategy:
matrix:
env:
- {ROS_DISTRO: foxy, ROS_REPO: main}
- {ROS_DISTRO: galactic, ROS_REPO: main}
- {ROS_DISTRO: humble, ROS_REPO: main}
- {ROS_DISTRO: rolling, ROS_REPO: main}
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions 3rdparty/Qt-Advanced-Docking/src/DockOverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -806,10 +806,10 @@ void CDockOverlayCross::setIconColors(const QString& Colors)
{"Arrow", CDockOverlayCross::ArrowColor},
{"Shadow", CDockOverlayCross::ShadowColor}};

auto ColorList = Colors.split(' ', QString::SkipEmptyParts);
auto ColorList = Colors.split(' ', QString::SkipEmptyParts);
for (const auto& ColorListEntry : ColorList)
{
auto ComponentColor = ColorListEntry.split('=', QString::SkipEmptyParts);
auto ComponentColor = ColorListEntry.split('=', QString::SkipEmptyParts);
int Component = ColorCompenentStringMap.value(ComponentColor[0], -1);
if (Component < 0)
{
Expand Down
5 changes: 4 additions & 1 deletion 3rdparty/qwt/src/qwt_abstract_scale_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,10 @@ double QwtAbstractScaleDraw::maxTickLength() const
*/
QwtText QwtAbstractScaleDraw::label( double value ) const
{
return QLocale().toString( value );
auto str = QLocale().toString( value, 'f', 6 );
str.remove( QRegExp("0+$") ); // Remove any number of trailing 0's
str.remove( QRegExp("\\.$") ); // If the last character is just a '.' then remove it
return str;
}

/*!
Expand Down
6 changes: 5 additions & 1 deletion 3rdparty/qwt/src/qwt_date_scale_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ static double qwtIntervalWidth( const QDateTime& minDate,
{
case QwtDate::Millisecond:
{
return minDate.msecsTo( maxDate );
const double secsTo = minDate.secsTo( maxDate );
const double msecs = maxDate.time().msec() -
minDate.time().msec();

return secsTo * 1000 + msecs;
}
case QwtDate::Second:
{
Expand Down
4 changes: 2 additions & 2 deletions 3rdparty/qwt/src/qwt_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

// QWT_VERSION is (major << 16) + (minor << 8) + patch.

#define QWT_VERSION 0x060201
#define QWT_VERSION_STR "6.2.1"
#define QWT_VERSION 0x060300
#define QWT_VERSION_STR "6.3.0"

#if defined( _MSC_VER ) /* MSVC Compiler */
/* template-class specialization 'identifier' is already instantiated */
Expand Down
41 changes: 30 additions & 11 deletions 3rdparty/qwt/src/qwt_picker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -825,9 +825,26 @@ QRect QwtPicker::trackerRect( const QFont& font ) const
return QRect();

const QSizeF textSize = text.textSize( font );
QRect textRect( 0, 0, qwtCeil( textSize.width() ), qwtCeil( textSize.height() ) );

const int w = qwtCeil( textSize.width() );
const int h = qwtCeil( textSize.height() );

return trackerRect( QSize( w, h ) );
}

/*!
Calculate the geometry of the tracker that is needed to display
information of a specific size at the tracker position
\param size Size
\return Bounding rectangle of the tracker
\sa trackerPosition()
*/
QRect QwtPicker::trackerRect( const QSize& size ) const
{
const QPoint& pos = m_data->trackerPosition;
QRect infoRect( 0, 0, size.width(), size.height() );

int alignment = 0;
if ( isActive() && m_data->pickedPoints.count() > 1
Expand All @@ -840,35 +857,37 @@ QRect QwtPicker::trackerRect( const QFont& font ) const
alignment |= ( pos.y() > last.y() ) ? Qt::AlignBottom : Qt::AlignTop;
}
else
{
alignment = Qt::AlignTop | Qt::AlignRight;
}

const int margin = 5;

int x = pos.x();
if ( alignment & Qt::AlignLeft )
x -= textRect.width() + margin;
x -= infoRect.width() + margin;
else if ( alignment & Qt::AlignRight )
x += margin;

int y = pos.y();
if ( alignment & Qt::AlignBottom )
y += margin;
else if ( alignment & Qt::AlignTop )
y -= textRect.height() + margin;
y -= infoRect.height() + margin;

textRect.moveTopLeft( QPoint( x, y ) );
infoRect.moveTopLeft( QPoint( x, y ) );

const QRect pickRect = pickArea().boundingRect().toRect();

int right = qMin( textRect.right(), pickRect.right() - margin );
int bottom = qMin( textRect.bottom(), pickRect.bottom() - margin );
textRect.moveBottomRight( QPoint( right, bottom ) );
int right = qMin( infoRect.right(), pickRect.right() - margin );
int bottom = qMin( infoRect.bottom(), pickRect.bottom() - margin );
infoRect.moveBottomRight( QPoint( right, bottom ) );

int left = qMax( textRect.left(), pickRect.left() + margin );
int top = qMax( textRect.top(), pickRect.top() + margin );
textRect.moveTopLeft( QPoint( left, top ) );
int left = qMax( infoRect.left(), pickRect.left() + margin );
int top = qMax( infoRect.top(), pickRect.top() + margin );
infoRect.moveTopLeft( QPoint( left, top ) );

return textRect;
return infoRect;
}

/*!
Expand Down
1 change: 1 addition & 0 deletions 3rdparty/qwt/src/qwt_picker.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ class QWT_EXPORT QwtPicker : public QObject, public QwtEventPattern
const QwtWidgetOverlay* trackerOverlay() const;

const QPolygon& pickedPoints() const;
QRect trackerRect( const QSize& ) const;

private:
void init( QWidget*, RubberBand rubberBand, DisplayMode trackerMode );
Expand Down
139 changes: 138 additions & 1 deletion 3rdparty/qwt/src/qwt_plot_curve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,22 @@ void QwtPlotCurve::drawCurve( QPainter* painter, int style,
case Dots:
drawDots( painter, xMap, yMap, canvasRect, from, to );
break;
case LinesAndDots: {
if (testCurveAttribute(Fitted)) {
from = 0;
to = dataSize() - 1;
}
drawLines(painter, xMap, yMap, canvasRect, from, to);

QPen prev_pen = painter->pen();
QPen new_pen = prev_pen;
new_pen.setWidth(prev_pen.width() * 3);

painter->setPen(new_pen);
drawDots(painter, xMap, yMap, canvasRect, from, to);
painter->setPen(prev_pen);
} break;

case NoCurve:
default:
break;
Expand Down Expand Up @@ -1044,7 +1060,7 @@ double QwtPlotCurve::baseline() const
\param pos Position, where to look for the closest curve point
\param dist If dist != NULL, closestPoint() returns the distance between
the position and the closest curve point
the position and the closest curve point in paint device coordinates
\return Index of the closest curve point, or -1 if none can be found
( f.e when the curve has no points )
\note closestPoint() implements a dumb algorithm, that iterates
Expand Down Expand Up @@ -1089,6 +1105,127 @@ int QwtPlotCurve::closestPoint( const QPointF& pos, double* dist ) const
return index;
}

/*!
Find the curve point with the smallest coordinate larger than a specific value
The coordinates have to be monotonic in direction of the orientation.
\param orientation Qt::Horizontal corresponds to x, Qt::Vertical to y coordinates
\param value x or y coordinate, depending on the orientation
\return Index of the curve point with the smalles coordinate above value
or -1 if there is none.
\note The implementation uses a binary search algorithm and requires the
points being ordered in direction of the orientation.
\sa qwtUpperSampleIndex()
*/
int QwtPlotCurve::adjacentPoint( Qt::Orientation orientation, qreal value ) const
{
const QwtSeriesData< QPointF >* data = this->data();
if ( data == nullptr )
return -1;

if ( orientation == Qt::Horizontal )
{
struct compareX
{
inline bool operator()( const double x, const QPointF& pos ) const
{
return ( x < pos.x() );
}
};

return qwtUpperSampleIndex< QPointF >( *data, value, compareX() );
}
else
{
struct compareY
{
inline bool operator()( const double y, const QPointF& pos ) const
{
return ( y < pos.y() );
}
};

return qwtUpperSampleIndex< QPointF >( *data, value, compareY() );
}

return -1;
}

/*!
Calculate a fictive curve point by interpolating between the adjacent
points. The curve points have to be monotonic in direction of the orientation.
\param orientation For Qt::Horizontal value is a x coordinate and a y coordinate
is returned. For Qt::Vertical value is a x coordinate
\param value x or y coordinate, depending on the orientation
\return Interpolated coordinate or qQNaN() if value is outside the bounding
rectangle of the curve
\note The implementation uses a binary search algorithm and requires the
points being ordered in direction of the orientation.
\sa adjacentPoint()
*/
qreal QwtPlotCurve::interpolatedValueAt( Qt::Orientation orientation, double value ) const
{
const QRectF br = boundingRect();
if ( br.width() <= 0.0 )
return qQNaN();

double v;

if ( orientation == Qt::Horizontal )
{
if ( value < br.left() || value > br.right() )
return qQNaN();

const int index = adjacentPoint( orientation, value );

if ( index == -1 )
{
const QPointF last = sample( dataSize() - 1 );

if ( value != last.x() )
return qQNaN();

v = last.y();
}
else
{
const QLineF line( sample( index - 1 ), sample( index ) );
v = line.pointAt( ( value - line.p1().x() ) / line.dx() ).y();
}
}
else
{
if ( value < br.top() || value > br.bottom() )
return qQNaN();

const int index = adjacentPoint( orientation, value );

if ( index == -1 )
{
const QPointF last = sample( dataSize() - 1 );

if ( value != last.y() )
return qQNaN();

v = last.x();
}
else
{
const QLineF line( sample( index - 1 ), sample( index ) );
v = line.pointAt( ( value - line.p1().y() ) / line.dy() ).x();
}
}

return v;
}

/*!
\return Icon representing the curve on the legend
Expand Down
5 changes: 5 additions & 0 deletions 3rdparty/qwt/src/qwt_plot_curve.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ class QWT_EXPORT QwtPlotCurve
*/
Dots,

LinesAndDots,

/*!
Styles >= QwtPlotCurve::UserCurve are reserved for derived
classes of QwtPlotCurve that overload drawCurve() with
Expand Down Expand Up @@ -271,6 +273,9 @@ class QWT_EXPORT QwtPlotCurve
void setSamples( QwtSeriesData< QPointF >* );

virtual int closestPoint( const QPointF& pos, double* dist = NULL ) const;
virtual int adjacentPoint( Qt::Orientation orientation, qreal value ) const;

qreal interpolatedValueAt( Qt::Orientation, double ) const;

double minXValue() const;
double maxXValue() const;
Expand Down
Loading

0 comments on commit ee678b0

Please sign in to comment.