mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
*ScatterDraw: Fixed bug in VectorVectorY
git-svn-id: svn://ultimatepp.org/upp/trunk@13576 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
685d2ab9b7
commit
2bb6c597f8
3 changed files with 19 additions and 19 deletions
|
|
@ -697,21 +697,21 @@ bool DataSource::SameX(DataSource &data) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void ExplicitData::Init(Function<double (double x, double y)> funz, double minX, double maxX, double minY, double maxY) {
|
||||
void ExplicitData::Init(Function<double (double x, double y)> _funz, double _minX, double _maxX, double _minY, double _maxY) {
|
||||
ASSERT(maxX >= minX && maxY >= minY);
|
||||
this->funz = funz;
|
||||
this->minX = minX;
|
||||
this->maxX = maxX;
|
||||
this->minY = minY;
|
||||
this->maxY = maxY;
|
||||
this->funz = _funz;
|
||||
this->minX = _minX;
|
||||
this->maxX = _maxX;
|
||||
this->minY = _minY;
|
||||
this->maxY = _maxY;
|
||||
|
||||
minZ = -DOUBLE_NULL_LIM;
|
||||
maxZ = DOUBLE_NULL_LIM;
|
||||
double deltax = (maxX - minX)/100.;
|
||||
double deltay = (maxY - minY)/100.;
|
||||
for (double x = minX; x <= maxX; x += deltax) {
|
||||
for (double y = minY; y <= maxY; y += deltay) {
|
||||
double z = funz(x, y);
|
||||
double deltax = (_maxX - _minX)/100.;
|
||||
double deltay = (_maxY - _minY)/100.;
|
||||
for (double x = _minX; x <= _maxX; x += deltax) {
|
||||
for (double y = _minY; y <= _maxY; y += deltay) {
|
||||
double z = _funz(x, y);
|
||||
if (!IsNull(z)) {
|
||||
minZ = min(minZ, z);
|
||||
maxZ = max(maxZ, z);
|
||||
|
|
|
|||
|
|
@ -409,14 +409,14 @@ public:
|
|||
this->idsFixed = clone(_idsFixed);
|
||||
this->beginData = _beginData;
|
||||
this->numData = _numData;
|
||||
if (IsNull(numData)) {
|
||||
if (!useRows) {
|
||||
if (IsNull(_numData)) {
|
||||
if (!_useRows) {
|
||||
if (_data.IsEmpty())
|
||||
this->numData = 0;
|
||||
else
|
||||
this->numData = data[0].GetCount() - beginData;
|
||||
this->numData = _data[0].GetCount() - _beginData;
|
||||
} else
|
||||
this->numData = _data.GetCount() - beginData;
|
||||
this->numData = _data.GetCount() - _beginData;
|
||||
}
|
||||
}
|
||||
void Init(Vector<Vector<Y> > &_data, int _idx, int _idy, bool _useRows = true, int _beginData = 0, int _numData = Null) {
|
||||
|
|
|
|||
|
|
@ -338,9 +338,9 @@ public:
|
|||
ScatterDraw& Responsive(bool _responsive = true, double factor = 1) {
|
||||
this->responsive = _responsive;
|
||||
responsivenessFactor = factor;
|
||||
plotScaleX = responsive ? responsivenessFactor*size.cx/600. : 1;
|
||||
plotScaleY = responsive ? responsivenessFactor*size.cy/400. : 1;
|
||||
plotScaleAvg = responsive ? (plotScaleX + plotScaleY)/2. : 1;
|
||||
plotScaleX = _responsive ? responsivenessFactor*size.cx/600. : 1;
|
||||
plotScaleY = _responsive ? responsivenessFactor*size.cy/400. : 1;
|
||||
plotScaleAvg = _responsive ? (plotScaleX + plotScaleY)/2. : 1;
|
||||
return *this;
|
||||
}
|
||||
bool IsResponsive() {return responsive;}
|
||||
|
|
@ -421,7 +421,7 @@ public:
|
|||
Color& GetLegendFillColor() {return legendFillColor;}
|
||||
Color& GetLegendBorderColor() {return legendBorderColor;}
|
||||
|
||||
ScatterDraw& SetMode(int _mode = MD_ANTIALIASED) {this->mode = _mode; Refresh(); return *this;};
|
||||
ScatterDraw& SetMode(int _mode = MD_ANTIALIASED) {this->mode = _mode; Refresh(); return *this;};
|
||||
int GetMode() {return mode;};
|
||||
|
||||
void ZoomToFit(bool horizontal = true, bool vertical = false, double factor = 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue