From 8409bd03063f0e210380afe824aaea280a90c5da Mon Sep 17 00:00:00 2001 From: koldo Date: Sat, 14 Mar 2020 09:43:36 +0000 Subject: [PATCH] Added RemoveSurf() git-svn-id: svn://ultimatepp.org/upp/trunk@14163 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- examples/ScatterCtrl_Demo/ScatterCtrl_Demo.h | 6 ++--- .../ScatterCtrl_Demo/ScatterCtrl_Demo.lay | 26 +++++++++---------- examples/ScatterCtrl_Demo/main.cpp | 4 +-- examples/ScatterCtrl_Demo/tab10_User.cpp | 10 +++---- examples/ScatterCtrl_Demo/tab19_Surf.cpp | 13 ++++++---- examples/ScatterCtrl_Demo/tab2_Functions.cpp | 4 +-- .../ScatterCtrl_Demo/tab6_Logarithmic.cpp | 4 +-- 7 files changed, 35 insertions(+), 32 deletions(-) diff --git a/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.h b/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.h index 04b3b8bfa..bfbdf8dab 100644 --- a/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.h +++ b/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.h @@ -124,7 +124,7 @@ public: virtual ScatterCtrl &Scatter() {return scatter;}; private: - Array > series; + Upp::Array > series; }; class Tab8_Secondary : public WithTab8Secondary { @@ -132,13 +132,13 @@ public: typedef Tab8_Secondary CLASSNAME; void Init(); - void MyFormat(String& s, int i, double d) + void MyFormat(String& s, int , double d) { s = Format("%Mon", fround(d)); if (!s.IsEmpty()) s << "\n2011"; } - void MyFormatDelta(String& s, int i, double d) + void MyFormatDelta(String& s, int , double d) { s = FormatDouble(d, 1) + " " + t_("months"); } diff --git a/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.lay b/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.lay index a88d0468f..f3a95d851 100644 --- a/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.lay +++ b/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.lay @@ -19,7 +19,7 @@ LAYOUT(Tab2Functions, 380, 292) END_LAYOUT LAYOUT(Tab3ParametricFunctions, 384, 284) - ITEM(ScatterCtrl, scatter, SetTitle(t_("Parametric functions demo")).SetTitleColor(White).SetPlotAreaTopMargin(20).SetPlotAreaColor(Color(229, 229, 229)).SetLabelsColor(White).SetAxisColor(Color(28, 212, 0)).SetAxisWidth(12).SetGridColor(Color(28, 127, 0)).SetTitleFont(SansSerifZ(14).Bold()).SetLegendAnchor(2).SetColor(Color(198, 212, 255)).HSizePosZ(16, 16).VSizePosZ(16, 16)) + ITEM(ScatterCtrl, scatter, SetTitle(t_("Parametric functions demo")).SetTitleColor(White).SetPlotAreaTopMargin(20).SetPlotAreaColor(Color(229, 229, 229)).SetLabelsColor(White).SetAxisColor(Color(28, 212, 0)).SetGridColor(Color(28, 127, 0)).SetTitleFont(SansSerifZ(14).Bold()).SetLegendAnchor(2).SetColor(Color(198, 212, 255)).HSizePosZ(16, 16).VSizePosZ(16, 16)) END_LAYOUT LAYOUT(Tab4Formatting, 400, 316) @@ -80,7 +80,7 @@ LAYOUT(TabUserEquation, 672, 276) END_LAYOUT LAYOUT(Tab11Trend, 504, 468) - ITEM(ScatterCtrl, scatter, SetTitle(t_("Trend Line demo")).SetPlotAreaLeftMargin(50).SetPlotAreaTopMargin(20).SetPlotAreaColor(Color(229, 229, 229)).SetAxisWidth(12).SetTitleFont(SansSerifZ(14).Bold()).SetLegendAnchor(4).HSizePosZ(8, 8).VSizePosZ(8, 108)) + ITEM(ScatterCtrl, scatter, SetTitle(t_("Trend Line demo")).SetPlotAreaLeftMargin(50).SetPlotAreaTopMargin(20).SetPlotAreaColor(Color(229, 229, 229)).SetTitleFont(SansSerifZ(14).Bold()).SetLegendAnchor(4).HSizePosZ(8, 8).VSizePosZ(8, 108)) ITEM(ArrayCtrl, grid, HSizePosZ(112, 8).BottomPosZ(4, 100)) ITEM(Label, dv___2, SetLabel(t_("Data series:")).LeftPosZ(8, 64).BottomPosZ(55, 21)) ITEM(Label, dv___3, SetLabel(t_("Trend Lines Details:")).LeftPosZ(8, 100).BottomPosZ(83, 21)) @@ -98,18 +98,18 @@ LAYOUT(TabRangePlot, 420, 236) ITEM(ScatterCtrl, scatter, SetTitle(t_("Range Plot")).SetPlotAreaLeftMargin(40).SetPlotAreaTopMargin(20).SetPlotAreaBottomMargin(40).SetLabelsFont(StdFontZ(11)).SetTitleFont(SansSerifZ(14).Bold()).HSizePosZ(4, 4).VSizePosZ(4, 4)) END_LAYOUT -LAYOUT(TabSurf, 468, 236) +LAYOUT(TabSurf, 468, 292) ITEM(ScatterCtrl, scatter, SetTitle(t_("2D Surface")).SetPlotAreaLeftMargin(40).SetPlotAreaRightMargin(20).SetPlotAreaTopMargin(20).SetPlotAreaBottomMargin(40).SetLabelsFont(StdFontZ(11)).SetTitleFont(SansSerifZ(14).Bold()).HSizePosZ(132, 4).VSizePosZ(4, 4)) - ITEM(LabelBox, dv___1, SetLabel(t_("Data source")).LeftPosZ(4, 124).TopPosZ(0, 64)) - ITEM(Switch, dataType, SetLabel(t_("Data set simple\nData set\nExplicit equation")).LeftPosZ(12, 108).TopPosZ(16, 48)) - ITEM(EditIntSpin, numColor, Min(0).NotNull(true).LeftPosZ(72, 56).TopPosZ(112, 19)) - ITEM(Label, labelInterpolation, SetLabel(t_("Data set interpolation")).LeftPosZ(4, 120).TopPosZ(68, 19)) - ITEM(Label, dv___5, SetLabel(t_("Num. color:")).LeftPosZ(4, 68).TopPosZ(112, 19)) - ITEM(DropList, interpolation, LeftPosZ(4, 124).TopPosZ(88, 19)) - ITEM(Label, dv___7, SetLabel(t_("Rainbow style")).LeftPosZ(4, 100).TopPosZ(156, 19)) - ITEM(DropList, rainbow, LeftPosZ(4, 124).TopPosZ(176, 19)) - ITEM(Option, zoom, SetLabel(t_("Zoom to fit")).LeftPosZ(4, 104).TopPosZ(200, 16)) - ITEM(Option, opContinuous, SetLabel(t_("Continuous")).LeftPosZ(4, 88).TopPosZ(136, 16)) + ITEM(LabelBox, dv___1, SetLabel(t_("Data source")).LeftPosZ(4, 124).TopPosZ(0, 76)) + ITEM(Switch, dataType, SetLabel(t_("Data set simple\nData set\nExplicit equation\nNo surface")).LeftPosZ(12, 108).TopPosZ(16, 60)) + ITEM(EditIntSpin, numColor, Min(0).NotNull(true).LeftPosZ(72, 56).TopPosZ(124, 19)) + ITEM(Label, labelInterpolation, SetLabel(t_("Data set interpolation")).LeftPosZ(4, 120).TopPosZ(80, 19)) + ITEM(Label, dv___5, SetLabel(t_("Num. color:")).LeftPosZ(4, 68).TopPosZ(124, 19)) + ITEM(DropList, interpolation, LeftPosZ(4, 124).TopPosZ(100, 19)) + ITEM(Label, dv___7, SetLabel(t_("Rainbow style")).LeftPosZ(4, 100).TopPosZ(168, 19)) + ITEM(DropList, rainbow, LeftPosZ(4, 124).TopPosZ(188, 19)) + ITEM(Option, zoom, SetLabel(t_("Zoom to fit")).LeftPosZ(4, 104).TopPosZ(212, 16)) + ITEM(Option, opContinuous, SetLabel(t_("Continuous")).LeftPosZ(4, 88).TopPosZ(148, 16)) END_LAYOUT LAYOUT(TabStackedPlot, 420, 244) diff --git a/examples/ScatterCtrl_Demo/main.cpp b/examples/ScatterCtrl_Demo/main.cpp index b9844dc14..4fc051ea2 100644 --- a/examples/ScatterCtrl_Demo/main.cpp +++ b/examples/ScatterCtrl_Demo/main.cpp @@ -14,9 +14,9 @@ struct Example { int index; }; -Array& Examples() +Upp::Array& Examples() { - static Array x; + static Upp::Array x; return x; } diff --git a/examples/ScatterCtrl_Demo/tab10_User.cpp b/examples/ScatterCtrl_Demo/tab10_User.cpp index 981995359..ee1a2e677 100644 --- a/examples/ScatterCtrl_Demo/tab10_User.cpp +++ b/examples/ScatterCtrl_Demo/tab10_User.cpp @@ -27,14 +27,14 @@ private: public: void Paint(Draw& w, Vector &p, const double &scale, const double opacity, double thick, const Color &color, String pattern, const Color &background, - const Color &fillColor, double fx, double fy, double y0, double width, - bool isClosed) const { + const Color &fillColor, double , double , double y0, double , + bool ) const { DoPaint(w, scale, p, opacity, fround(thick), color, pattern, background, fillColor, y0); } void Paint(Painter& w, Vector &p, const double &scale, const double opacity, double thick, const Color &color, String pattern, const Color &background, - const Color &fillColor, double fx, double fy, double y0, double width, - bool isClosed) const { + const Color &fillColor, double , double , double y0, double , + bool ) const { DoPaint(w, scale, p, opacity, fround(thick), color, pattern, background, fillColor, y0); } }; @@ -42,7 +42,7 @@ public: class MyMark : public MarkPlot { private: template - void DoPaint(T& w, const double& scale, const Point& cp, const double& size, const Color& markColor) const { + void DoPaint(T& w, const double& scale, const Point& cp, const double& , const Color& ) const { Size bugSize = Symbol::bug().GetSize()*scale; w.DrawImage(cp.x - bugSize.cx/2, cp.y - bugSize.cy/2, bugSize.cx, bugSize.cy, Symbol::bug()); } diff --git a/examples/ScatterCtrl_Demo/tab19_Surf.cpp b/examples/ScatterCtrl_Demo/tab19_Surf.cpp index dbcf62d71..7093e843a 100644 --- a/examples/ScatterCtrl_Demo/tab19_Surf.cpp +++ b/examples/ScatterCtrl_Demo/tab19_Surf.cpp @@ -10,8 +10,8 @@ void Tab19_Surf::Init() numColor <<= THISBACK(OnChange); opContinuous <<= true; opContinuous <<= THISBACK(OnChange); - dataType = 0;//2; - dataType << THISBACK(OnChange); + dataType = 0;; + dataType <<= THISBACK(OnChange); rainbow.Add(BLUE_YELLOW_RED, "BLUE_YELLOW_RED").Add(RED_YELLOW_BLUE, "RED_YELLOW_BLUE") .Add(GREEN_YELLOW_RED, "GREEN_YELLOW_RED").Add(RED_YELLOW_GREEN, "RED_YELLOW_GREEN") .Add(WHITE_BLACK, "WHITE_BLACK").Add(BLACK_WHITE, "BLACK_WHITE"); @@ -83,16 +83,19 @@ void Tab19_Surf::Init() } void Tab19_Surf::OnChange() { - labelInterpolation.Enable(dataType != 2); - interpolation.Enable(dataType != 2); + labelInterpolation.Enable(dataType < 2); + interpolation.Enable(dataType < 2); scatter.SurfNumColor(~numColor, ~opContinuous).SurfRainbow((RAINBOW)int(rainbow.GetKey(rainbow.GetIndex()))); if (dataType == 0) Init_DatasetSimple(); else if (dataType == 1) Init_Dataset(); - else + else if (dataType == 2) Init_DataExplicit(); + else + scatter.RemoveSurf(); + if (zoom) scatter.ZoomToFit(true, true); diff --git a/examples/ScatterCtrl_Demo/tab2_Functions.cpp b/examples/ScatterCtrl_Demo/tab2_Functions.cpp index df6449311..71c8d6401 100644 --- a/examples/ScatterCtrl_Demo/tab2_Functions.cpp +++ b/examples/ScatterCtrl_Demo/tab2_Functions.cpp @@ -1,11 +1,11 @@ #include "ScatterCtrl_Demo.h" -double funct1(double x) {return 3;} +double funct1(double ) {return 3;} double funct2(double x) {return (x*x-5);} double funct3(double x) {return (-x*x-5);} -void vfunct1(double& y, double x) {y = 0;} +void vfunct1(double& y, double ) {y = 0;} void vfunct2(double& y, double x) {y = x*x;} void vfunct3(double& y, double x) {y = -x*x;} diff --git a/examples/ScatterCtrl_Demo/tab6_Logarithmic.cpp b/examples/ScatterCtrl_Demo/tab6_Logarithmic.cpp index 4516783ed..6afd96deb 100644 --- a/examples/ScatterCtrl_Demo/tab6_Logarithmic.cpp +++ b/examples/ScatterCtrl_Demo/tab6_Logarithmic.cpp @@ -18,14 +18,14 @@ void Tab6_Logarithmic::Init() scatter.SetGridLinesX = THISBACK(SetGridLinesX); } -void Tab6_Logarithmic::FormatX(String& s, int i, double d) +void Tab6_Logarithmic::FormatX(String& s, int , double d) { double val = pow(10, d); if (val >= 1 && val <= 1e5) s = FormatDoubleExp(val, 0); } -void Tab6_Logarithmic::FormatXGridUnits(String& s, int i, double d) +void Tab6_Logarithmic::FormatXGridUnits(String& s, int , double d) { double val = pow(10, d); int valint = fround(val);