! * helper function called in other zoom*() functions * and doing the actual change of the data ranges. * @param x if set to \true the x-range is modified, the y-range for \c false * @param in the "zoom in" is performed if set to \c \true, "zoom out" for \c false */
| 3140 | * @param in the "zoom in" is performed if set to \c \true, "zoom out" for \c false |
| 3141 | */ |
| 3142 | void CartesianPlot::zoom(int index, const Dimension dim, bool zoom_in, const double relPosSceneRange) { |
| 3143 | Q_D(CartesianPlot); |
| 3144 | |
| 3145 | Range<double> range; |
| 3146 | if (index == -1) { |
| 3147 | QVector<int> zoomedIndices; |
| 3148 | for (int i = 0; i < m_coordinateSystems.count(); i++) { |
| 3149 | int idx = coordinateSystem(i)->index(dim); |
| 3150 | if (zoomedIndices.contains(idx)) |
| 3151 | continue; |
| 3152 | zoom(idx, dim, zoom_in, relPosSceneRange); |
| 3153 | zoomedIndices.append(idx); |
| 3154 | } |
| 3155 | return; |
| 3156 | } |
| 3157 | range = d->range(dim, index); |
| 3158 | |
| 3159 | double factor = m_zoomFactor; |
| 3160 | if (zoom_in) |
| 3161 | factor = 1. / factor; |
| 3162 | range.zoom(factor, d->niceExtend, relPosSceneRange); |
| 3163 | |
| 3164 | if (range.finite()) |
| 3165 | d->setRange(dim, index, range); |
| 3166 | } |
| 3167 | |
| 3168 | /*! |
| 3169 | * helper function called in other shift*() functions |