TODO: design elegant, flexible and undo-aware API for changing scales
| 688 | |
| 689 | // TODO: design elegant, flexible and undo-aware API for changing scales |
| 690 | bool CartesianCoordinateSystem::setScales(const Dimension dim, const QVector<CartesianScale*>& scales) { |
| 691 | DEBUG(Q_FUNC_INFO) |
| 692 | switch (dim) { |
| 693 | case Dimension::X: { |
| 694 | while (!d->xScales.isEmpty()) |
| 695 | delete d->xScales.takeFirst(); |
| 696 | |
| 697 | d->xScales = scales; |
| 698 | return true; // TODO: check scales validity |
| 699 | } |
| 700 | case Dimension::Y: { |
| 701 | while (!d->yScales.isEmpty()) |
| 702 | delete d->yScales.takeFirst(); |
| 703 | |
| 704 | d->yScales = scales; |
| 705 | return true; // TODO: check scales validity |
| 706 | } |
| 707 | } |
| 708 | return 1; |
| 709 | } |
| 710 | |
| 711 | QVector<CartesianScale*> CartesianCoordinateSystem::scales(const Dimension dim) const { |
| 712 | DEBUG(Q_FUNC_INFO) |
no test coverage detected