New Features
- True LTTB downsampling for curves (FilterPointsLTTB rework)
FilterPointsLTTBnow implements the real Largest-Triangle-Three-Buckets algorithm ( newQwtPointMapper::LTTBReduceflag,qwtLttbReduce()): the visible data is divided into 4 x canvas-width equal-count buckets and each bucket keeps the sample forming the largest triangle with the previously selected point and the average of the next bucket; the first and last sample are always kept- Narrow Gaussian peaks keep their shape instead of collapsing into vertical strokes; the activation threshold ( 4 x canvas-width visible samples ) and the output budget ( ~4 points per pixel column ) match the previous MinMax bucket algorithm
- The MinMax bucket algorithm moved to the new
FilterPointsMinMaxLTTBpaint attribute - it is the exact behavior ofFilterPointsLTTBin v7.3.2 - v7.4.2 - Dispatch priority:
PixelColumnReduce>LTTBReduce>MinMaxReduce>WeedOutIntermediatePoints>WeedOutPoints; the default staysClipPolygons | FilterPointsLTTB( now the shape-preserving LTTB ) - Regression tests:
tests/downsampling_test;examples/bench/renderbenchgains aFilterPointsMinMaxLTTBbenchmark mode
- 3D waterfall plot item (Qwt3DWaterfall)
- New
Qwt3DPlotItemrendering a sequence of 1D traces (spectra, chromatograms, ...) as stacked curves along the depth axis, with a built-in sliding window:pushTrace()appends the newest trace and drops the oldest, no user-side window or depth bookkeeping - Axes follow the module convention (value axis up, as in
Qwt3DSurface): x = bin value, y = trace position in the window (depth), z = amplitude; the depth axis is the one to label withQwt3DTextScale - The depth coordinate of a trace is its slot index, so the hull z-range grows monotonically to
[0, traceCapacity()-1]and then stays pinned - no per-frame depth autoscale jitter in a live waterfall - Four geometry styles:
Ribbon(filled curtain, default),RibbonMesh(curtain + outline, outline always drawn after the fill),Wireframe,Tube(lit, same construction asQwt3DLine::Tube) - Three color modes:
ByDepth(default),ByAmplitude(colormap over the sample value),Solid; fixed color range viasetColorRange()for stable live amplitude colors; baseline, opacity and outline controls; one item contributes exactly one legend gradient - New example
examples/3D/waterfall3D: 2D live spectrum + peak hold on top, 3D sliding-window waterfall below, both fed the identical frame; toolbar controls for window size / style / colormap / color mode / opacity; automation hooks--screenshot,--selftest,--fps(measured 51.8 fps at 64 traces x 256 bins with both views updating) - New usage guide "3D Waterfall" (EN/CN, with screenshot); RTTI value
Rtti_Plot3DWaterfall = 1004; theme branch inQwt3DTheme::applyToItem(); classincludes forwarding headers
- New
- Qwt3DTextScale: user supplied tic labels for the depth axis
- Linear scale whose major tic labels come from a string list, so a waterfall depth axis can read "-63", "-48", ..., "0" (frames ago) instead of raw numbers; indices beyond the list fall back to the numeric label
- Qwt3DColorMapColor: selectable source axis
- New
Qwt3DColorSourceenum (ColorFromX/ColorFromY/ColorFromZ) withsetSourceAxis()/sourceAxis(); the active range applies to the selected axis. The defaultColorFromZkeeps existing surface/bar/line rendering pixel-identical;ColorFromYpowers amplitude coloring.Qwt3DWaterfall::setColorMode()retargets the functor automatically
- New
- Qwt3DPlot: configurable mouse driven view interaction
setMouseSpeed()/mouseSpeed()set the drag speeds (rotation turns per widget dimension, exponential gain of drag scaling, world units of drag shifting); the defaults are (0.5, 5, 2), i.e. half a turn per widget dimension, the sensitivity of matplotlib's 3D rotationsetRollMouse()/rollMouse()add an extra gesture for the y axis rotation (the roll, the one angle a plain left drag cannot reach); the middle button carries it by default and the Shift+left assignment keeps working
- Gap semantics for curve rendering (
QwtPlotCurve::BreakAtNan)- New curve attribute rendering NaN/Inf samples as gaps instead of bridging them: for
LinesandStepsevery run of consecutive finite samples becomes an independent polyline, so gaps stay blank (matplotlib behavior). Off by default - without it gaps are bridged exactly as before - Each run is smoothed, fitted, clipped and filled on its own, so neither the smoothing kernel nor the fill area crosses a gap; downsampling budgets apply per run.
Dots/Sticksare unaffected (per-sample styles already leave gaps blank) - The finite sample runs are scanned once per data change and cached (invalidated via
dataChanged(), same lifecycle as the series bounding rect cache), so interactive repaints don't repeat the O(n) scan - Documented in the "NaN Handling" usage guide (EN/CN); rendering semantics and the bridging-chord measurements:
docs/zh/tech-report/nan-rendering.md
- New curve attribute rendering NaN/Inf samples as gaps instead of bridging them: for
Bug Fixes
-
Fixed downsampling destroying the visual shape of narrow peaks and ignoring antialiasing: the default
FilterPointsLTTB( MinMax buckets, v7.3.2 - v7.4.2 ) kept only the argmin/argmax sample per bucket, so a peak sampled by more points than its bucket held collapsed into a flat-topped vertical stroke with the shoulders lost, and all reduce paths snapped the mapped coordinates to integer pixels regardless of theRoundPointsflag - enabling antialiasing changed nothing. Both reduce algorithms now honorRoundPoints( sub pixel precision when the painter does not align to integers, including the below-threshold fallback ), and the default downsampling is the true LTTB preserving peak shapes. Regression test:tests/downsampling_test -
Fixed the amalgamated single-file build (
src-amalgamate, consumed byexamples/staticExample) not linking since the 3D waterfall landed: the amalgamate templates never listedqwt3d_waterfall.h/.cpp, soQwt3DTheme::applyToItem()referencedQwt3DWaterfallsetters that had no definition inside the amalgamation. Templates updated andsrc-amalgamateregenerated; the duplicate file-localclampf()helper ofqwt3d_waterfall.cppwas renamed toclampFloat()so the single translation unit compiles. Also dropped the Qt5-onlyQwtPlotGLCanvasinclude fromtests/flat_style_test, which failed to compile under Qt6 (<qgl.h>does not exist there ) -
Fixed the axis backbones not intersecting at the canvas corners and the axis/tick lines rendering with inconsistent widths on HiDPI displays:
QwtScaleDrawnow paints backbone and ticks as device pixel aligned filled rectangles (the pen width truncates to whole device pixels, sosetPenWidthF(1.0)stays a one pixel hairline at any device pixel ratio), ticks end exactly at the inner edge of the backbone instead of crossing it, ticks at the scale borders snap onto the perpendicular backbone so the corner reads as a clean cross without a one pixel step between the border tick and the perpendicular axis line, and the newQwtScaleDraw::setCornerMiter()flags - set byQwtScaleWidgetfrom the visibility of the perpendicular axes - extend each backbone by one pen width into the shared canvas corner, so perpendicular backbones meet in a clean L instead of a diagonal step (or, at fractional scaling, an outright gap). Regression test:tests/axis_corner_test -
Fixed
Qwt3DPlot::attach()not recalculating the scene: an item whose data was loaded beforeattach()- with no setter (and therefore noitemChanged()) in between - left the plot hull at (0,0,0)-(0,0,0) and the widget rendered blank without any warning. The z-order sort + hull union + coordinate system update is extracted into a privaterecalculateScene(), now also called fromattach()anddetach(), so detaching items shrinks the hull correctly as well. Regression tests added (tests/waterfall_test) -
Fixed derived
Qwt3DScaleclasses being sliced insideQwt3DAxis::setScale(): theQwt3DClonePtrassignment clones viaclone(), and any derived scale without aclone()override silently lost its customticLabel()(verified pixel-identical rendering).Qwt3DTextScaleoverridesclone();Qwt3DLinearScalegains a protectedcopyLinearScaleState()so derived implementations can copy the autoscaler state -
Fixed
Qwt3DWaterfall::pushTrace()reading past the end of a short trace: incoming frames are fitted into the established bin count (longer truncated, shorter zero-padded) -
Fixed the 3D axis titles never showing on live plots:
Qwt3DCoordinateSystem::destroy()(called byinit()on every coordinate system recreation) cleared all axis label strings, and title drawing stayed off unlesssetLabel(true)was called separately.setLabelString()now enables drawing for a non-empty title andinit()/destroy()keep the titles;Qwt3DAxis::label()exposes the draw flag -
Fixed
Qwt3DCoordinateSystem::init()resetting every axis scale toLINEARSCALEon each recreation: for items whose hull changes per update (a live waterfall) this silently discarded a user-setQwt3DTextScaleand fell back to numeric depth labels.init()now rebuilds geometry only, andQwt3DAxis::scale()exposes the active scale -
Fixed
Qwt3DWaterfall::Tubefusing into a single blob and collapsing the frame rate: the sweep radius was isotropic in data space, so under anisotropic view scales neighboring traces overlapped and cross sections stretched into slabs, and every ring station of every trace was rebuilt per frame. The radius is now a per-axis fraction of the hull extents (view-circular, capped below half a slot spacing) and dense traces are decimated to <=129 ring stations (measured 17 -> 62 fps at 128 traces x 256 bins) -
Fixed the 3D view rotation being too fast and quantized to whole degrees: the mouse/keyboard handlers stored
int(round(angle)) % 360, which discarded the sub degree motion of a slow drag (on a 2000 px wide widget a 1 px move is 0.09 degrees, so the scene did not move at all) and let the angle leave the canonical range; the gain was three full turns per drag across the widget (measured: 200 px -> 220 degrees). Angles are kept as doubles wrapped into [0, 360) and the default gain is half a turn per widget dimension (measured on the same drag: 36 degrees). Regression tests:tests/plot3d_rotation_test -
Fixed the MinMax bucket downsampler (
FilterPointsMinMaxLTTB,FilterPointsLTTBbefore the v7.5.0 rework) emitting phantom vertices for data with non-finite coordinates: the raw-pointer fast path pre-scanned only the y values withisnan, so a sample with NaN x could win a bucket extremum and be mapped toqRound(NaN) == 0(a fake spike pinned to the left canvas edge), and +/-Inf y values passed the pre-scan into the SIMD path producingINT_MINpixel coordinates. The pre-scan now rejects non-finite y values (!isfinite), bucket winners with a non-finite x are caught by a per-bucket post-check that recomputes the bucket with the scalar loop, and the scalar loop skips non-finite x/y samples - aligning the raw-pointer path with the genericsample()path. Index-based series (no raw x array) are unaffected. The pre-scan deliberately stays y-only: scanning x as well was measured to cost +11% frame time on 1M clean points (extra memory traffic). Regression tests:tests/nan_curve_test -
Fixed
qwtToPolylineFiltered(theFilterPoints/WeedOutPointsmapper path) returning a single-vertex polygon holding a NaN coordinate for all-NaN input: the first-non-NaN scan stopped at the last sample and wrote it unconditionally. All-NaN ranges now return an empty polygon, mirroring the early exit of the Quad path, so the "empty polygon == no data" convention holds for callers. Regression tests:tests/nan_curve_test -
Fixed the Percentile whisker levels of
QwtBoxStatisticsCalculatorbeing exchanged:whiskerLowertook the (100-c)-th percentile andwhiskerUpperthe c-th one, so any coefficient below 50 producedwl > wu, an invalid sample and every datum counted as an outlier (64/64 in the technical report's regression case). The levels now follow the coefficient (c = tail percentage, e.g. 5 for the 5th/95th percentiles),QwtBoxSamplecarries ameanfield that the calculator fills andQwtPlotBoxChartdraws its mean marker at it (it used to duplicate the median), and the vestigial instance interface (setWhiskerMethod()/setWhiskerCoefficient(), consumed by no calculation path) is removed. Newtests/box_statistics_test -
Fixed
QwtClipper::clipCirclemapping a point above the center to3*pi/2on vertical tangents (the opposite ofqwtPolar2Posand of its own non-vertical branches), which returned pi too much whenever the center sat exactly on a vertical rectangle edge; the sweep also merges cutting points that coincide within a small angular tolerance (a circle through a rectangle corner is reported by both adjacent edges with a few ulp of difference) and classifies every angular segment on its own, removing the 1-ulp dependent "full circle vs. zero-length arcs" corner cases and theangles[1]out-of-bounds read for a single cutting point. Newtests/clipper_testwith directed cases and a brute-force cross check -
Fixed the gl2ps vector export producing undefined surface colors: the feedback buffer records the fixed-function vertex color, which the GLSL render path never writes (fully transparent fills - invisible surfaces - on the machine of the original measurement, data-independent colors elsewhere).
Qwt3DSurface, the coordinate-system grid/axis lines and the color legend now emit immediate-mode geometry with explicit per-vertex colors while the feedback replay is active (Qwt3DPlot::isVectorExportActive(), derived from the GL render mode), so PDF/SVG exports carry the data colors. Newtests/plot3d_vector_export_testand thesurface_export_check.cppprobe -
Fixed the Qwt3DIO format registry comparing format strings case-sensitively while the raster keys are the lowercase names of
QImageWriter(savePixmap(file, "PNG")failed silently - the official 3D example hit this); lookups, registrations and thesaveVector/savePixmapformat checks are case-insensitive now, unregistered formats produce a qWarning and the example derives the format from the file suffix. Newtests/plot3d_io_test -
Fixed the 3D lighting and material parameters being discarded:
setLightComponent()/setMaterialComponent()/setShininess()store their arguments now andQwt3DSurfaceuploads them as shader uniforms (light position fromsetLightRotation, per-component ambient/diffuse/specular, shininess); the defaults reproduce the previously hardcoded values pixel for pixel andilluminate()/blowout()switch the single light, so the 5 theme lighting presets finally differ. New getters andtests/plot3d_lighting_test -
Fixed the matplotlib-sourced colormap presets carrying hand approximations:
inferno/magma/turbohad their stops compressed into the first ~70% of the reference curve placed over the whole range andviridis/cividisdeviated by up to 17 dE00. The stops are now sampled from the official matplotlib 256-entry tables at the preset positions (generatordocs/assets/algorithms/colormap_stops_gen.py): stop deviation 0.000, whole-band deviation 0.445-1.380 dE00,inferno/magmagrade A -
Fixed
QwtScaleDiv::setTicks()storing duplicated tick values (the date engine'sqRound(i*minStep)collapse) andQwtAbstractScaleDraw::draw()painting coinciding ticks twice: the tick lists are sorted and deduplicated, and ticks sitting on a longer tick type are skipped, so every position is painted once with the longest length. Newtests/scale_draw_test -
Fixed two comments contradicting their implementations:
QwtColorMapPreset::presetFromName()documents the fallback to Viridis (it never returned -1) andQwt3DSurface::setResolution()documents the index stepping plus the full rebuild/re-upload it actually performs -
Performance: moved the AVX2 argmin/argmax kernel into its own translation unit compiled with
/arch:AVX2(MSVC) /-mavx2(GCC/Clang) via CMake (qwt_simd_argminmax_avx2.cpp). Compiled for the x86-64 baseline it mixed legacy SSE into its 256-bit epilogue and returned with a dirty upper YMM state - measured 446 ns of fixed overhead per call (n=16) and a 16x slowdown of scalar code following it in the same thread; after the split the call drops to 13.5 ns, the streaming penalty disappears and the MinMax bucket criterion collapses from ~481 to 4-8 elements. The dispatcher still calls it only after its CPUID check; the amalgamated build inlines the file as before
Documentation
- New benchmark example
examples/bench/chartbenchand the four-way plotting library comparison report: the example drives Qwt, an in-tree QCustomPlot 2.1.0 copy and Qt Charts through one measurement protocol and pulls QIm in as a git submodule; eight suites (sample count, series count, canvas size, data handover vs. repaint, point reduction, frame-time distribution, process memory, startup cost) plus image export, one CSV pair per library and backend, and a driver script that runs the whole matrix. The protocol is part of the result -QOpenGLWidgetdefers a plainrepaint()to Qt's composition step, so the report documents drivingmakeCurrent()/paintGL()/glFinish()instead (the naive protocol reports 0.004 ms for a 100k point curve), and the QCustomPlot copy carries the minimal Qt 6Q_MOC_RUN/Q_NAMESPACEfix that upstream 2.1.1 has as well. 17 figures and 14 tables are regenerated bydocs/assets/bench/chartbench_experiment.pyfrom the raw CSVs; Qt Charts' OpenGL series path is reported as a measured negative result (no curve pixels in the framebuffer)