From f05ceb77dbae16fecc14e9380fafdc02fa1b4eb9 Mon Sep 17 00:00:00 2001 From: koldo Date: Tue, 23 Jul 2019 07:20:38 +0000 Subject: [PATCH] ScatterDraw. Removed warnings thanks to coolman git-svn-id: svn://ultimatepp.org/upp/trunk@13506 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/ScatterDraw/DataSource.h | 9 +++++---- uppsrc/ScatterDraw/Equation.h | 1 + uppsrc/ScatterDraw/ScatterDraw.cpp | 30 ------------------------------ uppsrc/ScatterDraw/ScatterDraw.h | 2 +- uppsrc/ScatterDraw/ScatterDraw.upp | 1 + 5 files changed, 8 insertions(+), 35 deletions(-) diff --git a/uppsrc/ScatterDraw/DataSource.h b/uppsrc/ScatterDraw/DataSource.h index b8d2309c5..9e544a8b5 100644 --- a/uppsrc/ScatterDraw/DataSource.h +++ b/uppsrc/ScatterDraw/DataSource.h @@ -391,7 +391,7 @@ private: int64 numData; public: - VectorVectorY() : data(0), useRows(true), beginData(0), numData(Null), idx(0), idy(1) {} + VectorVectorY() : data(0), useRows(true), idx(0), idy(1), beginData(0), numData(Null) {} VectorVectorY(Vector > &data, int idx, int idy, Vector &idsx, Vector &idsy, Vector &idsFixed, bool useRows = true, int beginData = 0, int numData = Null) { @@ -656,7 +656,8 @@ private: template inline T LinearInterpolate(T x, T x0, T x1, T v0, T v1) { - ASSERT(x1 != x0); + if (x0 == x1) + return (v0 + v1)/T(2); return ((x1 - x)/(x1 - x0))*v0 + ((x - x0)/(x1 - x0))*v1; } @@ -674,8 +675,8 @@ inline T TrilinearInterpolate(T x, T y, T z, T x0, T x1, T y0, T y1, T z0, T z1, T x10 = LinearInterpolate(x, x0, x1, v010, v110); T x01 = LinearInterpolate(x, x0, x1, v001, v101); T x11 = LinearInterpolate(x, x0, x1, v011, v111); - T r0 = LinearInterpolate(y, y0, y1, x00, x01); - T r1 = LinearInterpolate(y, y0, y1, x10, x11); + T r0 = LinearInterpolate(y, y0, y1, x00, x01); + T r1 = LinearInterpolate(y, y0, y1, x10, x11); return LinearInterpolate(z, z0, z1, r0, r1); } diff --git a/uppsrc/ScatterDraw/Equation.h b/uppsrc/ScatterDraw/Equation.h index 84edcec4a..23a93a512 100644 --- a/uppsrc/ScatterDraw/Equation.h +++ b/uppsrc/ScatterDraw/Equation.h @@ -38,6 +38,7 @@ public: friend struct Equation_functor; const Vector &GetCoeff() {return coeff;} + double GetCoeff(int i) {return coeff[i];} template static void Register(const String& name) { diff --git a/uppsrc/ScatterDraw/ScatterDraw.cpp b/uppsrc/ScatterDraw/ScatterDraw.cpp index 9bd685d63..0b7a406a3 100644 --- a/uppsrc/ScatterDraw/ScatterDraw.cpp +++ b/uppsrc/ScatterDraw/ScatterDraw.cpp @@ -18,23 +18,17 @@ ScatterDraw::ScatterDraw() { gridColor = SColorDkShadow(); gridWidth = 0.5; gridDash = LINE_DOTTED_FINE; - //gridColor2 = SColorDkShadow(); - //gridWidth2 = 0.5; - //gridDash2 = LINE_DOTTED_FINER; drawXReticle = drawYReticle = true; drawY2Reticle = false; reticleFont = GetStdFont(); reticleColor = Black; drawVGrid = drawHGrid = showLegend = true; - //drawVGrid2 = drawHGrid2 = true; - //freqGrid2 = 5; minXRange = maxXRange = minYRange = maxYRange = -1; minXmin = minYmin = maxXmax = maxYmax = Null; fastViewX = false; sequentialXAll = false; zoomStyleX = zoomStyleY = TO_CENTER; SetMajorUnitsNum(5, 10); - Color(graphColor); isPolar = false; lastxRange = xRange; lastyRange = yRange; @@ -1005,31 +999,7 @@ const String ScatterDraw::GetUnitsY(int index) { ASSERT(IsValid(index)); return series[index].unitsY; } -/* -ScatterDraw& ScatterDraw::SetDataColor(int index, const Color& color) { - ASSERT(IsValid(index)); - series[index].color = color; - Refresh(); - return *this; -} -Color ScatterDraw::GetDataColor(int index) const { - ASSERT(IsValid(index)); - return series[index].color; -} - -ScatterDraw& ScatterDraw::SetDataThickness(int index, double thickness) { - ASSERT(IsValid(index)); - series[index].thickness = thickness; - Refresh(); - return *this; -} - -double ScatterDraw::GetDataThickness(int index) const { - ASSERT(IsValid(index)); - return series[index].thickness; -} -*/ ScatterDraw& ScatterDraw::SetFillColor(int index, const Color& color) { ASSERT(IsValid(index)); series[index].fillColor = color; diff --git a/uppsrc/ScatterDraw/ScatterDraw.h b/uppsrc/ScatterDraw/ScatterDraw.h index ac94d7ff1..f9f34e424 100644 --- a/uppsrc/ScatterDraw/ScatterDraw.h +++ b/uppsrc/ScatterDraw/ScatterDraw.h @@ -79,7 +79,7 @@ public: #define LINE_DOTTED "4 10" #define LINE_DOTTED_SEP "4 20" #define LINE_DASHED "12 12" - #define LINE_DASH_DOT "20 10 5 10" + #define LINE_DASH_DOT "12 8 3 8" // Reduced. Previous was too long protected: class ScatterBasicSeries { diff --git a/uppsrc/ScatterDraw/ScatterDraw.upp b/uppsrc/ScatterDraw/ScatterDraw.upp index 6ae2fa4f9..1ef7e381f 100644 --- a/uppsrc/ScatterDraw/ScatterDraw.upp +++ b/uppsrc/ScatterDraw/ScatterDraw.upp @@ -26,3 +26,4 @@ file src.tpp, Copying; + spellcheck_comments "EN-GB" \ No newline at end of file