mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
Added RemoveSurf()
git-svn-id: svn://ultimatepp.org/upp/trunk@14163 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
1452209c9b
commit
8409bd0306
7 changed files with 35 additions and 32 deletions
|
|
@ -124,7 +124,7 @@ public:
|
|||
virtual ScatterCtrl &Scatter() {return scatter;};
|
||||
|
||||
private:
|
||||
Array<Vector<Pointf> > series;
|
||||
Upp::Array<Vector<Pointf> > series;
|
||||
};
|
||||
|
||||
class Tab8_Secondary : public WithTab8Secondary<ScatterDemo> {
|
||||
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ struct Example {
|
|||
int index;
|
||||
};
|
||||
|
||||
Array<Example>& Examples()
|
||||
Upp::Array<Example>& Examples()
|
||||
{
|
||||
static Array<Example> x;
|
||||
static Upp::Array<Example> x;
|
||||
return x;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,14 +27,14 @@ private:
|
|||
public:
|
||||
void Paint(Draw& w, Vector<Pointf> &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<Pointf> &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 <class T>
|
||||
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());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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;}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue