"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "uppsrc/ScatterDraw/ScatterDraw.cpp" between
upp-x11-src-13648.tar.gz and upp-x11-src-13659.tar.gz

About: Ultimate++ is a C++ cross-platform rapid application development framework. Stable release.

ScatterDraw.cpp  (upp-x11-src-13648):ScatterDraw.cpp  (upp-x11-src-13659)
skipping to change at line 386 skipping to change at line 386
} }
ScatterDraw &ScatterDraw::DoFitToData(bool horizontal, bool vertical, double fac tor) { ScatterDraw &ScatterDraw::DoFitToData(bool horizontal, bool vertical, double fac tor) {
double minx, maxx, miny, miny2, maxy, maxy2; double minx, maxx, miny, miny2, maxy, maxy2;
minx = miny = miny2 = -DOUBLE_NULL; minx = miny = miny2 = -DOUBLE_NULL;
maxx = maxy = maxy2 = DOUBLE_NULL; maxx = maxy = maxy2 = DOUBLE_NULL;
try { try {
if (horizontal) { if (horizontal) {
for (int j = 0; j < series.GetCount(); j++) { for (int j = 0; j < series.GetCount(); j++) {
if (series[j].opacity == 0 || series[j].PointsDat ScatterSeries &serie = series[j];
a()->IsExplicit()) if (serie.IsDeleted() || serie.opacity == 0 || se
rie.Data().IsExplicit())
continue; continue;
double mn = series[j].PointsData()->MinX(); double mn = serie.Data().MinX();
if (!IsNull(mn)) if (!IsNull(mn))
minx = min(minx, mn); minx = min(minx, mn);
double mx = series[j].PointsData()->MaxX(); double mx = serie.Data().MaxX();
if (!IsNull(mx)) if (!IsNull(mx))
maxx = max(maxx, mx); maxx = max(maxx, mx);
} }
if (minx != -DOUBLE_NULL) { if (minx != -DOUBLE_NULL) {
double deltaX = (maxx - minx)*factor; double deltaX = (maxx - minx)*factor;
minx -= deltaX; minx -= deltaX;
maxx += deltaX; maxx += deltaX;
} }
if (surf) { if (surf) {
minx = min(minx, surf->MinX()); minx = min(minx, surf->MinX());
maxx = max(maxx, surf->MaxX()); maxx = max(maxx, surf->MaxX());
} }
} }
if (vertical) { if (vertical) {
for (int j = 0; j < series.GetCount(); j++) { for (int j = 0; j < series.GetCount(); j++) {
if (series[j].opacity == 0 || series[j].PointsDat ScatterSeries &serie = series[j];
a()->IsExplicit()) if (serie.IsDeleted() || serie.opacity == 0 || se
rie.Data().IsExplicit())
continue; continue;
for (int64 i = 0; i < series[j].PointsData()->Get for (int64 i = 0; i < serie.Data().GetCount(); i+
Count(); i++) { +) {
double py = series[j].PointsData()->y(i); double py = serie.Data().y(i);
if (IsNull(py)) if (IsNull(py))
continue; continue;
if (series[j].primaryY) { if (serie.primaryY) {
if (py < miny) if (py < miny)
miny = py; miny = py;
if (py > maxy) if (py > maxy)
maxy = py; maxy = py;
} else { } else {
if (py < miny2) if (py < miny2)
miny2 = py; miny2 = py;
if (py > maxy2) if (py > maxy2)
maxy2 = py; maxy2 = py;
} }
skipping to change at line 643 skipping to change at line 645
ScatterDraw &ScatterDraw::AddSeries(DataSource &data) { ScatterDraw &ScatterDraw::AddSeries(DataSource &data) {
ScatterSeries &s = series.Add(); ScatterSeries &s = series.Add();
s.Init(series.GetCount()-1); s.Init(series.GetCount()-1);
s.SetDataSource(&data, false); s.SetDataSource(&data, false);
if (sequentialXAll) if (sequentialXAll)
s.sequential = true; s.sequential = true;
Refresh(); Refresh();
return *this; return *this;
} }
DataSource &ScatterDraw::GetSeries(int index) {
return series[index].GetDataSource();
}
ScatterDraw &ScatterDraw::_AddSeries(DataSource *data) { ScatterDraw &ScatterDraw::_AddSeries(DataSource *data) {
ScatterSeries &s = series.Add(); ScatterSeries &s = series.Add();
s.Init(series.GetCount()-1); s.Init(series.GetCount()-1);
s.SetDataSource(data); s.SetDataSource(data);
Refresh(); Refresh();
return *this; return *this;
} }
ScatterDraw &ScatterDraw::InsertSeries(int index, double *yData, int numData, do uble x0, double deltaX) { ScatterDraw &ScatterDraw::InsertSeries(int index, double *yData, int numData, do uble x0, double deltaX) {
return InsertSeries<CArray>(index, yData, numData, x0, deltaX); return InsertSeries<CArray>(index, yData, numData, x0, deltaX);
skipping to change at line 697 skipping to change at line 695
ScatterDraw &ScatterDraw::InsertSeries(int index, PlotExplicFunc &function) { ScatterDraw &ScatterDraw::InsertSeries(int index, PlotExplicFunc &function) {
return InsertSeries<PlotExplicFuncSource>(index, function); return InsertSeries<PlotExplicFuncSource>(index, function);
} }
ScatterDraw &ScatterDraw::InsertSeries(int index, PlotParamFunc function, int np , double from, double to) { ScatterDraw &ScatterDraw::InsertSeries(int index, PlotParamFunc function, int np , double from, double to) {
return InsertSeries<PlotParamFuncSource>(index, function, np, from, to); return InsertSeries<PlotParamFuncSource>(index, function, np, from, to);
} }
ScatterDraw &ScatterDraw::_InsertSeries(int index, DataSource *data) { ScatterDraw &ScatterDraw::_InsertSeries(int index, DataSource *data) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ScatterSeries &s = series.Insert(index); ScatterSeries &s = series.Insert(index);
s.Init(index); s.Init(index);
s.SetDataSource(data); s.SetDataSource(data);
Refresh(); Refresh();
return *this; return *this;
} }
int64 ScatterDraw::GetCount(int index) { int64 ScatterDraw::GetCount(int index) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
return series[index].PointsData()->GetCount(); ASSERT(!series[index].IsDeleted());
return series[index].Data().GetCount();
} }
void ScatterDraw::GetValues(int index, int64 idata, double &x, double &y) { void ScatterDraw::GetValues(int index, int64 idata, double &x, double &y) {
ASSERT(IsValid(index) && !IsNull(GetCount(index))); ASSERT(IsValid(index) && !IsNull(GetCount(index)));
ASSERT(idata >= 0 && idata < series[index].PointsData()->GetCount()); ASSERT(!series[index].IsDeleted());
ASSERT(idata >= 0 && idata < series[index].Data().GetCount());
try { try {
x = series[index].PointsData()->x(idata); x = series[index].Data().x(idata);
y = series[index].PointsData()->y(idata); y = series[index].Data().y(idata);
} catch(ValueTypeError error) { } catch(ValueTypeError error) {
ASSERT_(true, error); ASSERT_(true, error);
x = y = Null; x = y = Null;
} }
} }
double ScatterDraw::GetValueX(int index, int64 idata) { double ScatterDraw::GetValueX(int index, int64 idata) {
ASSERT(IsValid(index) && !IsNull(GetCount(index))); ASSERT(IsValid(index) && !IsNull(GetCount(index)));
ASSERT(idata >= 0 && idata < series[index].PointsData()->GetCount()); ASSERT(!series[index].IsDeleted());
ASSERT(idata >= 0 && idata < series[index].Data().GetCount());
try { try {
return series[index].PointsData()->x(idata); return series[index].Data().x(idata);
} catch(ValueTypeError error) { } catch(ValueTypeError error) {
ASSERT_(true, error); ASSERT_(true, error);
return Null; return Null;
} }
} }
Value ScatterDraw::GetStringX(int index, int64 idata) { Value ScatterDraw::GetStringX(int index, int64 idata) {
double ret = GetValueX(index, idata); double ret = GetValueX(index, idata);
if (IsNull(ret)) if (IsNull(ret))
return Null; return Null;
if (cbModifFormatX) { if (cbModifFormatX) {
String sret; String sret;
cbModifFormatX(sret, int(idata), ret); cbModifFormatX(sret, int(idata), ret);
return sret; return sret;
} else } else
return ret; return ret;
} }
double ScatterDraw::GetValueY(int index, int64 idata) { double ScatterDraw::GetValueY(int index, int64 idata) {
ASSERT(IsValid(index) && !IsNull(GetCount(index))); ASSERT(IsValid(index) && !IsNull(GetCount(index)));
ASSERT(idata >= 0 && idata < series[index].PointsData()->GetCount()); ASSERT(!series[index].IsDeleted());
ASSERT(idata >= 0 && idata < series[index].Data().GetCount());
try { try {
return series[index].PointsData()->y(idata); return series[index].Data().y(idata);
} catch(ValueTypeError error) { } catch(ValueTypeError error) {
ASSERT_(true, error); ASSERT_(true, error);
return Null; return Null;
} }
} }
Value ScatterDraw::GetStringY(int index, int64 idata) { Value ScatterDraw::GetStringY(int index, int64 idata) {
double ret = GetValueY(index, idata); double ret = GetValueY(index, idata);
if (IsNull(ret)) if (IsNull(ret))
return Null; return Null;
if (cbModifFormatY) { if (cbModifFormatY) {
String sret; String sret;
cbModifFormatY(sret, int(idata), ret); cbModifFormatY(sret, int(idata), ret);
return sret; return sret;
} else } else
return ret; return ret;
} }
ScatterDraw &ScatterDraw::SetNoPlot(int index) { ScatterDraw &ScatterDraw::SetNoPlot(int index) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series[index].seriesPlot = NULL; series[index].seriesPlot = NULL;
return *this; return *this;
} }
ScatterDraw &ScatterDraw::PlotStyle(int index, SeriesPlot *data) { ScatterDraw &ScatterDraw::PlotStyle(int index, SeriesPlot *data) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series[index].seriesPlot = data; series[index].seriesPlot = data;
return *this; return *this;
} }
ScatterDraw &ScatterDraw::MarkStyle(int index, MarkPlot *data) { ScatterDraw &ScatterDraw::MarkStyle(int index, MarkPlot *data) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series[index].markPlot = data; series[index].markPlot = data;
return *this; return *this;
} }
ScatterDraw &ScatterDraw::MarkStyle(int index, const String name) { ScatterDraw &ScatterDraw::MarkStyle(int index, const String name) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
int typeidx = MarkPlot::TypeIndex(name); int typeidx = MarkPlot::TypeIndex(name);
if (typeidx >= 0) if (typeidx >= 0)
series[index].markPlot = MarkPlot::Create(typeidx); series[index].markPlot = MarkPlot::Create(typeidx);
else else
series[index].markPlot = 0; series[index].markPlot = 0;
return *this; return *this;
} }
const String ScatterDraw::GetMarkStyleName(int index) { const String ScatterDraw::GetMarkStyleName(int index) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
if (series[index].markPlot) if (series[index].markPlot)
return MarkPlot::TypeName(series[index].markPlot->GetType()); return MarkPlot::TypeName(series[index].markPlot->GetType());
else else
return t_("No mark"); return t_("No mark");
} }
int ScatterDraw::GetMarkStyleType(int index) { int ScatterDraw::GetMarkStyleType(int index) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
if (series[index].markPlot) if (series[index].markPlot)
return series[index].markPlot->GetTypeType(); return series[index].markPlot->GetTypeType();
else else
return -1; return -1;
} }
ScatterDraw &ScatterDraw::SetMarkStyleType(int index, int type) { ScatterDraw &ScatterDraw::SetMarkStyleType(int index, int type) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
if (series[index].markPlot) if (series[index].markPlot)
series[index].markPlot->SetTypeType(type); series[index].markPlot->SetTypeType(type);
return *this; return *this;
} }
ScatterDraw &ScatterDraw::Stroke(int index, double thickness, Color color) { ScatterDraw &ScatterDraw::Stroke(int index, double thickness, Color color) {
ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
if (IsNull(color)) if (IsNull(color))
color = GetNewColor(index); color = GetNewColor(index);
series[index].color = color; series[index].color = color;
series[index].thickness = thickness; series[index].thickness = thickness;
//series[index].dash = GetNewDash(index); //series[index].dash = GetNewDash(index);
Refresh(); Refresh();
return *this; return *this;
} }
void ScatterDraw::GetStroke(int index, double &thickness, Color &color) { void ScatterDraw::GetStroke(int index, double &thickness, Color &color) {
ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
color = series[index].color; color = series[index].color;
thickness = series[index].thickness; thickness = series[index].thickness;
} }
ScatterDraw &ScatterDraw::Fill(Color color) { ScatterDraw &ScatterDraw::Fill(Color color) {
int index = series.GetCount() - 1; int index = series.GetCount() - 1;
if (IsNull(color)) { if (IsNull(color)) {
color = GetNewColor(index); color = GetNewColor(index);
color = Color(min(color.GetR()+30, 255), min(color.GetG()+30, 255 ), min(color.GetB()+30, 255)); color = Color(min(color.GetR()+30, 255), min(color.GetG()+30, 255 ), min(color.GetB()+30, 255));
skipping to change at line 901 skipping to change at line 921
ScatterDraw &ScatterDraw::MarkBorderWidth(double markWidth) { ScatterDraw &ScatterDraw::MarkBorderWidth(double markWidth) {
int index = series.GetCount() - 1; int index = series.GetCount() - 1;
series[index].markBorderWidth = markWidth; series[index].markBorderWidth = markWidth;
Refresh(); Refresh();
return *this; return *this;
} }
ScatterDraw &ScatterDraw::ShowSeriesLegend(int index, bool show) { ScatterDraw &ScatterDraw::ShowSeriesLegend(int index, bool show) {
ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series[index].showLegend = show; series[index].showLegend = show;
Refresh(); Refresh();
return *this; return *this;
} }
ScatterDraw &ScatterDraw::Closed(int index, bool closed) { ScatterDraw &ScatterDraw::Closed(int index, bool closed) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series[index].isClosed = closed; series[index].isClosed = closed;
Refresh(); Refresh();
return *this; return *this;
} }
bool ScatterDraw::IsClosed(int index) { bool ScatterDraw::IsClosed(int index) {
ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
return series[index].isClosed; return series[index].isClosed;
} }
ScatterDraw &ScatterDraw::BarWidth(int index, double width) { ScatterDraw &ScatterDraw::BarWidth(int index, double width) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series[index].barWidth = width; series[index].barWidth = width;
Refresh(); Refresh();
return *this; return *this;
} }
ScatterDraw &ScatterDraw::Dash(const char *dash) { ScatterDraw &ScatterDraw::Dash(const char *dash) {
int index = series.GetCount() - 1; int index = series.GetCount() - 1;
return Dash(index, dash); return Dash(index, dash);
} }
ScatterDraw &ScatterDraw::Dash(int index, const char *dash) { ScatterDraw &ScatterDraw::Dash(int index, const char *dash) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series[index].dash = dash; series[index].dash = dash;
Refresh(); Refresh();
return *this; return *this;
} }
ScatterDraw &ScatterDraw::NoDash() { ScatterDraw &ScatterDraw::NoDash() {
int index = series.GetCount() - 1; int index = series.GetCount() - 1;
return NoDash(index); return NoDash(index);
} }
ScatterDraw &ScatterDraw::NoDash(int index) { ScatterDraw &ScatterDraw::NoDash(int index) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series[index].dash = LINE_SOLID; series[index].dash = LINE_SOLID;
Refresh(); Refresh();
return *this; return *this;
} }
const String ScatterDraw::GetDash(int index) { const String ScatterDraw::GetDash(int index) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
return series[index].dash; return series[index].dash;
} }
ScatterDraw &ScatterDraw::Legend(const String legend) { ScatterDraw &ScatterDraw::Legend(const String legend) {
int index = series.GetCount() - 1; int index = series.GetCount() - 1;
return Legend(index, legend); return Legend(index, legend);
} }
ScatterDraw& ScatterDraw::Legend(int index, const String legend) { ScatterDraw& ScatterDraw::Legend(int index, const String legend) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series[index].legend = legend; series[index].legend = legend;
return *this; return *this;
} }
const String& ScatterDraw::GetLegend(int index) { const String& ScatterDraw::GetLegend(int index) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
return series[index].legend; return series[index].legend;
} }
ScatterDraw &ScatterDraw::Units(const String unitsY, const String unitsX) { ScatterDraw &ScatterDraw::Units(const String unitsY, const String unitsX) {
int index = series.GetCount() - 1; int index = series.GetCount() - 1;
return Units(index, unitsY, unitsX); return Units(index, unitsY, unitsX);
} }
ScatterDraw& ScatterDraw::Units(int index, const String unitsY, const String uni tsX) { ScatterDraw& ScatterDraw::Units(int index, const String unitsY, const String uni tsX) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series[index].unitsX = unitsX; series[index].unitsX = unitsX;
series[index].unitsY = unitsY; series[index].unitsY = unitsY;
labelsChanged = true; labelsChanged = true;
return *this; return *this;
} }
const String ScatterDraw::GetUnitsX(int index) { const String ScatterDraw::GetUnitsX(int index) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
return series[index].unitsX; return series[index].unitsX;
} }
const String ScatterDraw::GetUnitsY(int index) { const String ScatterDraw::GetUnitsY(int index) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
return series[index].unitsY; return series[index].unitsY;
} }
ScatterDraw& ScatterDraw::SetFillColor(int index, const Color& color) { ScatterDraw& ScatterDraw::SetFillColor(int index, const Color& color) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series[index].fillColor = color; series[index].fillColor = color;
Refresh(); Refresh();
return *this; return *this;
} }
Color ScatterDraw::GetFillColor(int index) const { Color ScatterDraw::GetFillColor(int index) const {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
return series[index].fillColor; return series[index].fillColor;
} }
ScatterDraw &ScatterDraw::SetMarkBorderWidth(int index, double width) { ScatterDraw &ScatterDraw::SetMarkBorderWidth(int index, double width) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series[index].markBorderWidth = width; series[index].markBorderWidth = width;
Refresh(); Refresh();
return *this; return *this;
} }
double ScatterDraw::GetMarkBorderWidth(int index) { double ScatterDraw::GetMarkBorderWidth(int index) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
return series[index].markBorderWidth; return series[index].markBorderWidth;
} }
ScatterDraw &ScatterDraw::SetMarkWidth(int index, double markWidth) { ScatterDraw &ScatterDraw::SetMarkWidth(int index, double markWidth) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series[index].markWidth = markWidth; series[index].markWidth = markWidth;
Refresh(); Refresh();
return *this; return *this;
} }
double ScatterDraw::GetMarkWidth(int index) { double ScatterDraw::GetMarkWidth(int index) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
return series[index].markWidth; return series[index].markWidth;
} }
ScatterDraw &ScatterDraw::SetMarkColor(int index, const Color& color) { ScatterDraw &ScatterDraw::SetMarkColor(int index, const Color& color) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series[index].markColor = color; series[index].markColor = color;
Refresh(); Refresh();
return *this; return *this;
} }
Color ScatterDraw::GetMarkColor(int index) const { Color ScatterDraw::GetMarkColor(int index) const {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
return series[index].markColor; return series[index].markColor;
} }
ScatterDraw &ScatterDraw::SetMarkBorderColor(int index, const Color& color) { ScatterDraw &ScatterDraw::SetMarkBorderColor(int index, const Color& color) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series[index].markBorderColor = color; series[index].markBorderColor = color;
Refresh(); Refresh();
return *this; return *this;
} }
Color ScatterDraw::GetMarkBorderColor(int index) const { Color ScatterDraw::GetMarkBorderColor(int index) const {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
return series[index].markBorderColor; return series[index].markBorderColor;
} }
void ScatterDraw::NoMark(int index) { void ScatterDraw::NoMark(int index) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series[index].markWidth = 0; series[index].markWidth = 0;
} }
/*
bool ScatterDraw::IsShowMark(int index) const throw (Exc) {
ASSERT(IsValid(index));
return series[index].markWidth > 0;
}*/
void ScatterDraw::SetDataPrimaryY(int index, bool primary) { void ScatterDraw::SetDataPrimaryY(int index, bool primary) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series[index].primaryY = primary; series[index].primaryY = primary;
if (!primary) if (!primary)
SetDrawY2Reticle(true); SetDrawY2Reticle(true);
Refresh(); Refresh();
} }
ScatterDraw &ScatterDraw::SetDataPrimaryY(bool primary) { ScatterDraw &ScatterDraw::SetDataPrimaryY(bool primary) {
SetDataPrimaryY(series.GetCount()-1, primary); SetDataPrimaryY(series.GetCount()-1, primary);
return *this; return *this;
} }
void ScatterDraw::SetDataSecondaryY(int index, bool secondary) { void ScatterDraw::SetDataSecondaryY(int index, bool secondary) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series[index].primaryY = !secondary; series[index].primaryY = !secondary;
if (secondary) if (secondary)
SetDrawY2Reticle(true); SetDrawY2Reticle(true);
Refresh(); Refresh();
} }
ScatterDraw &ScatterDraw::SetDataSecondaryY(bool secondary) { ScatterDraw &ScatterDraw::SetDataSecondaryY(bool secondary) {
SetDataSecondaryY(series.GetCount()-1, secondary); SetDataSecondaryY(series.GetCount()-1, secondary);
return *this; return *this;
} }
bool ScatterDraw::IsDataPrimaryY(int index) { bool ScatterDraw::IsDataPrimaryY(int index) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
return series[index].primaryY; return series[index].primaryY;
} }
void ScatterDraw::SetSequentialX(int index, bool sequential) { void ScatterDraw::SetSequentialX(int index, bool sequential) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series[index].sequential = sequential; series[index].sequential = sequential;
Refresh(); Refresh();
} }
ScatterDraw &ScatterDraw::SetSequentialX(bool sequential) { ScatterDraw &ScatterDraw::SetSequentialX(bool sequential) {
SetSequentialX(series.GetCount()-1, sequential); SetSequentialX(series.GetCount()-1, sequential);
return *this; return *this;
} }
bool ScatterDraw::GetSequentialX(int index) { bool ScatterDraw::GetSequentialX(int index) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
return series[index].sequential; return series[index].sequential;
} }
bool ScatterDraw::GetSequentialX() { bool ScatterDraw::GetSequentialX() {
return GetSequentialX(series.GetCount()-1); return GetSequentialX(series.GetCount()-1);
} }
ScatterDraw &ScatterDraw::SetSequentialXAll(bool sequential) { ScatterDraw &ScatterDraw::SetSequentialXAll(bool sequential) {
for (int i = 0; i < series.GetCount(); ++i) for (int i = 0; i < series.GetCount(); ++i) {
const ScatterSeries &serie = series[i];
if (serie.IsDeleted())
continue;
SetSequentialX(i, sequential); SetSequentialX(i, sequential);
}
sequentialXAll = sequential; sequentialXAll = sequential;
return *this; return *this;
} }
void ScatterDraw::Show(int index, bool show) { void ScatterDraw::Show(int index, bool show) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series[index].opacity = show ? 1 : 0; series[index].opacity = show ? 1 : 0;
Refresh(); Refresh();
} }
bool ScatterDraw::IsVisible(int index) { bool ScatterDraw::IsVisible(int index) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
return series[index].opacity > 0; return series[index].opacity > 0;
} }
ScatterDraw &ScatterDraw::ShowAll(bool ) { ScatterDraw &ScatterDraw::ShowAll(bool ) {
for (int i = 0; i < series.GetCount(); ++i) for (int i = 0; i < series.GetCount(); ++i) {
series[i].opacity = 1; ScatterSeries &serie = series[i];
if (serie.IsDeleted())
continue;
serie.opacity = 1;
}
return *this; return *this;
} }
ScatterDraw& ScatterDraw::Id(int id) { ScatterDraw& ScatterDraw::Id(int id) {
return Id(series.GetCount()-1, id); return Id(series.GetCount()-1, id);
} }
ScatterDraw& ScatterDraw::Id(int index, int id) { ScatterDraw& ScatterDraw::Id(int index, int id) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series[index].id = id; series[index].id = id;
return *this; return *this;
} }
int ScatterDraw::GetId(int index) { int ScatterDraw::GetId(int index) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
return series[index].id; return series[index].id;
} }
void ScatterDraw::RemoveSeries(int index) { void ScatterDraw::RemoveSeries(int index) {
ASSERT(IsValid(index)); ASSERT(IsValid(index));
ASSERT(!series[index].IsDeleted());
series.Remove(index); series.Remove(index);
Refresh(); Refresh();
} }
void ScatterDraw::RemoveAllSeries() { void ScatterDraw::RemoveAllSeries() {
series.Clear(); series.Clear();
Refresh(); Refresh();
} }
Drawing ScatterDraw::GetDrawing() { Drawing ScatterDraw::GetDrawing() {
 End of changes. 61 change blocks. 
30 lines changed or deleted 114 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)