Skip to content

Commit cb8966e

Browse files
committed
Merge remote-tracking branch 'origin/main' into bugfixes
2 parents e43f729 + d93b679 commit cb8966e

35 files changed

+284
-301
lines changed

src/apps/qutils/qtscheduler.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44

55
using namespace std::chrono;
66

7-
void QtScheduler::schedule(const GUI::Scheduler::Task &task,
7+
void QtScheduler::schedule(
8+
[[maybe_unused]] const GUI::Scheduler::Task &task,
89
steady_clock::time_point time)
910
{
1011
auto actTime = steady_clock::now();
1112
auto duration = time - actTime;
12-
int msecs = 0;
13+
[[maybe_unused]] int msecs = 0;
1314
if (time > actTime)
1415
msecs = duration_cast<milliseconds>(duration).count();
15-
16+
#ifndef __clang_analyzer__
1617
return QTimer::singleShot(msecs, task);
18+
#endif
1719
}

src/apps/weblib/interface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
#include <span>
44

5-
#include "base/io/log.h"
65
#include "base/conv/auto_json.h"
6+
#include "base/io/log.h"
77

88
#include "interfacejs.h"
99
#include "jscriptcanvas.h"

src/base/conv/auto_json.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ concept Optional =
2929
*val;
3030
};
3131

32-
template <class T> concept Tuple = sizeof(std::tuple_size<T>) > 0;
32+
template <class T> concept Tuple = sizeof(std::tuple_size<T>) != 0;
3333

3434
template <class T>
3535
concept Pair = Tuple<T> && std::tuple_size_v<T> == 2;
@@ -244,7 +244,7 @@ struct JSONObj : JSON
244244

245245
template <class T> inline void JSON::dynamicObj(const T &val) const
246246
{
247-
JSONObj j{json};
247+
JSONObj j{json}; // NOLINT
248248
for (const auto &[k, v] : val) { j(toString(k), v); }
249249
}
250250

src/base/refl/auto_struct.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -826,24 +826,28 @@ struct GetterVisitor<Visitor,
826826

827827
template <class T, class Visitor>
828828
constexpr inline __attribute__((always_inline)) auto visit(
829-
Visitor &&visitor)
830-
-> decltype(Functors::Applier<T, Visitor>{}(visitor))
829+
[[maybe_unused]] Visitor &&visitor)
831830
{
831+
#ifndef __clang_analyzer__
832832
return Functors::Applier<T, Visitor>{}(visitor);
833+
#endif
833834
}
834835

835836
template <class Visitor, class T, class... Ts>
836-
constexpr inline auto
837-
visit(Visitor &&visitor, T &visitable, Ts &&...ts)
837+
constexpr inline auto visit([[maybe_unused]] Visitor &&visitor,
838+
[[maybe_unused]] T &visitable,
839+
[[maybe_unused]] Ts &&...ts)
838840
-> std::enable_if_t<(std::is_same_v<std::remove_cvref_t<T>,
839841
std::remove_cvref_t<Ts>>
840842
&& ...)>
841843
{
844+
#ifndef __clang_analyzer__
842845
using TT = std::remove_cvref_t<T>;
843846
visit<TT>(
844847
Functors::GetterVisitor<Visitor, std::tuple<T &, Ts &...>>{
845848
std::forward<Visitor>(visitor),
846849
{visitable, ts...}});
850+
#endif
847851
}
848852

849853
}

src/chart/animator/animation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ void Animation::addKeyframe(const Gen::PlotPtr &next,
8383
!target->getOptions()->getChannels().anyAxisSet()
8484
&& next->getOptions()->getChannels().anyAxisSet();
8585

86-
auto geometryChanges = target->getOptions()->shapeType
87-
!= next->getOptions()->shapeType;
86+
auto geometryChanges = target->getOptions()->geometry
87+
!= next->getOptions()->geometry;
8888

8989
auto basedOnSource =
9090
loosingCoordsys || (!gainingCoordsys && geometryChanges);

src/chart/animator/morph.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ void CoordinateSystem::transform(const Gen::Options &source,
6868
Gen::Options &actual,
6969
double factor) const
7070
{
71-
actual.polar =
72-
interpolate(source.polar, target.polar, factor);
71+
actual.coordSystem =
72+
interpolate(source.coordSystem, target.coordSystem, factor);
7373
actual.angle =
7474
interpolate(source.angle, target.angle, factor);
7575
}
@@ -99,8 +99,8 @@ void Shape::transform(const Gen::Options &source,
9999
Gen::Options &actual,
100100
double factor) const
101101
{
102-
actual.shapeType = interpolate(source.shapeType,
103-
target.shapeType,
102+
actual.geometry = interpolate(source.geometry,
103+
target.geometry,
104104
factor);
105105
}
106106

@@ -148,9 +148,9 @@ void Connection::transform(const Gen::Options &source,
148148
double factor) const
149149
{
150150
auto sourceIsConnecting =
151-
Vizzu::Gen::isConnecting(source.shapeType.get());
151+
Vizzu::Gen::isConnecting(source.geometry.get());
152152
auto targetIsConnecting =
153-
Vizzu::Gen::isConnecting(target.shapeType.get());
153+
Vizzu::Gen::isConnecting(target.geometry.get());
154154

155155
if (sourceIsConnecting && !targetIsConnecting) {
156156
actual.horizontal = source.horizontal;

src/chart/animator/planner.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ void Planner::createPlan(const Gen::Plot &source,
101101
addMorph(SectionId::coordSystem, std::max(step, posDuration));
102102

103103
const auto &geomEasing =
104-
srcOpt->shapeType == Gen::ShapeType::circle ? in3
105-
: trgOpt->shapeType == Gen::ShapeType::circle ? out3
106-
: srcOpt->shapeType == Gen::ShapeType::line ? in3
107-
: trgOpt->shapeType == Gen::ShapeType::line ? out3
108-
: inOut5;
104+
srcOpt->geometry == Gen::ShapeType::circle ? in3
105+
: trgOpt->geometry == Gen::ShapeType::circle ? out3
106+
: srcOpt->geometry == Gen::ShapeType::line ? in3
107+
: trgOpt->geometry == Gen::ShapeType::line ? out3
108+
: inOut5;
109109

110110
addMorph(SectionId::geometry,
111111
std::max(step, posDuration),
@@ -245,11 +245,11 @@ void Planner::calcNeeded()
245245
animNeeded[SectionId::color] = needColor();
246246

247247
animNeeded[SectionId::coordSystem] =
248-
srcOpt->polar != trgOpt->polar
248+
srcOpt->coordSystem != trgOpt->coordSystem
249249
|| srcOpt->angle != trgOpt->angle;
250250

251251
animNeeded[SectionId::geometry] =
252-
srcOpt->shapeType != trgOpt->shapeType;
252+
srcOpt->geometry != trgOpt->geometry;
253253

254254
animNeeded[SectionId::y] = needVertical();
255255
animNeeded[SectionId::x] = needHorizontal();
@@ -282,8 +282,8 @@ bool Planner::positionMorphNeeded() const
282282
{
283283
typedef Gen::ShapeType ST;
284284

285-
auto &srcShape = source->getOptions()->shapeType;
286-
auto &trgShape = target->getOptions()->shapeType;
285+
auto &srcShape = source->getOptions()->geometry;
286+
auto &trgShape = target->getOptions()->geometry;
287287

288288
auto anyCircle = srcShape == ST::circle || trgShape == ST::circle;
289289

src/chart/generator/guides.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ bool GuidesByAxis::operator==(const GuidesByAxis &other) const
3131
void Guides::init(const Axises &axises, const Options &options)
3232
{
3333
auto isCircle =
34-
options.shapeType.get() == ShapeType::circle;
35-
auto isLine = options.shapeType.get() == ShapeType::line;
34+
options.geometry.get() == ShapeType::circle;
35+
auto isLine = options.geometry.get() == ShapeType::line;
3636
auto isHorizontal = static_cast<bool>(options.horizontal);
3737
auto yIsMeasure = static_cast<bool>(
3838
axises.at(ChannelId::y).enabled.calculate<Math::FuzzyBool>());
3939
auto xIsMeasure = static_cast<bool>(
4040
axises.at(ChannelId::x).enabled.calculate<Math::FuzzyBool>());
41-
auto isPolar = static_cast<bool>(options.polar);
41+
auto isPolar = options.coordSystem.get() == CoordSystem::polar;
4242

4343
const auto &xOpt = options.getChannels().at(ChannelId::x);
4444
const auto &yOpt = options.getChannels().at(ChannelId::y);
@@ -79,7 +79,7 @@ void Guides::init(const Axises &axises, const Options &options)
7979

8080
auto stretchedPolar =
8181
isPolar && !yIsMeasure
82-
&& (options.alignType == Base::Align::Type::stretch);
82+
&& (options.align == Base::Align::Type::stretch);
8383

8484
y.labels = yOpt.axisLabels.getValue(
8585
!stretchedPolar

src/chart/generator/marker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Marker::Marker(const Options &options,
6767

6868
mainId = Id(data, options.mainAxis().dimensionIds, index);
6969

70-
auto stackInhibitingShape = options.shapeType == ShapeType::area;
70+
auto stackInhibitingShape = options.geometry == ShapeType::area;
7171
if (stackInhibitingShape) {
7272
Data::SeriesList subIds(options.subAxis().dimensionIds);
7373
subIds.remove(options.mainAxis().dimensionIds);

src/chart/generator/plot.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Plot::Plot(const Data::DataTable &dataTable,
113113
if (gotSpecLayout) {
114114
calcDimensionAxises(dataTable);
115115
normalizeColors();
116-
if (options->shapeType != ShapeType::circle)
116+
if (options->geometry != ShapeType::circle)
117117
normalizeSizes();
118118
calcAxises(dataTable);
119119
}
@@ -201,7 +201,7 @@ Plot::sortedBuckets(const Buckets &buckets, bool main)
201201
}
202202
}
203203

204-
if (main && options->sorted) {
204+
if (main && options->sort == Sort::byValue) {
205205
std::sort(sorted.begin(),
206206
sorted.end(),
207207
[=](const std::pair<uint64_t, double> &a,
@@ -315,7 +315,7 @@ Axis Plot::calcAxis(ChannelId type, const Data::DataTable &dataTable)
315315
: scale.title;
316316

317317
if (type == options->subAxisType()
318-
&& options->alignType == Base::Align::Type::stretch) {
318+
&& options->align == Base::Align::Type::stretch) {
319319
return {Math::Range<double>(0, 100),
320320
title,
321321
"%",
@@ -397,12 +397,12 @@ void Plot::calcDimensionAxis(ChannelId type,
397397

398398
void Plot::addAlignment()
399399
{
400-
if (static_cast<bool>(options->splitted)) return;
400+
if (static_cast<bool>(options->split)) return;
401401

402402
auto &axis = axises.at(options->subAxisType());
403403
if (axis.range.getMin() < 0) return;
404404

405-
if (options->alignType == Base::Align::Type::none) return;
405+
if (options->align == Base::Align::Type::none) return;
406406

407407
for (auto &bucketIt : subBuckets) {
408408
Math::Range<double> range;
@@ -414,7 +414,7 @@ void Plot::addAlignment()
414414
range.include(size);
415415
}
416416

417-
Base::Align aligner(options->alignType,
417+
Base::Align aligner(options->align,
418418
Math::Range(0.0, 1.0));
419419
auto transform = aligner.getAligned(range) / range;
420420

@@ -431,10 +431,10 @@ void Plot::addAlignment()
431431

432432
void Plot::addSeparation()
433433
{
434-
if (static_cast<bool>(options->splitted)) {
435-
auto align = options->alignType == Base::Align::Type::none
434+
if (static_cast<bool>(options->split)) {
435+
auto align = options->align == Base::Align::Type::none
436436
? Base::Align::Type::min
437-
: options->alignType;
437+
: options->align;
438438

439439
std::vector<Math::Range<double>> ranges(mainBuckets.size(),
440440
Math::Range(0.0, 0.0));
@@ -481,8 +481,8 @@ void Plot::addSeparation()
481481

482482
void Plot::normalizeSizes()
483483
{
484-
if (options->shapeType == ShapeType::circle
485-
|| options->shapeType == ShapeType::line) {
484+
if (options->geometry == ShapeType::circle
485+
|| options->geometry == ShapeType::line) {
486486
Math::Range<double> size;
487487

488488
for (auto &marker : markers)

0 commit comments

Comments
 (0)