/*! \fn void QGraphicsItemAnimation::setStep(qreal step) Sets the current \a step value for the animation, causing the transformations scheduled at this step to be performed. */ void QGraphicsItemAnimation::setStep(qreal x) { if (x < 0.0 || x > 1.0) { qWarning("QGraphicsItemAnimation::setStep: invalid step = %f", x); return; } beforeAnimationStep(x); d->step = x; if (d->item) { if (!d->xPosition.isEmpty() || !d->yPosition.isEmpty()) d->item->setPos(posAt(x)); if (!d->rotation.isEmpty() || !d->verticalScale.isEmpty() || !d->horizontalScale.isEmpty() || !d->verticalShear.isEmpty() || !d->horizontalShear.isEmpty() || !d->xTranslation.isEmpty() || !d->yTranslation.isEmpty()) { d->item->setMatrix(d->startMatrix * matrixAt(x)); } } afterAnimationStep(x); }
int calculateFenceMaterials(const int** m, const int n, const int i, const int j) { return 4 - matrixAt(m, n, i, j - 1) - matrixAt(m, n, i, j + 1) - matrixAt(m, n, i - 1, j) - matrixAt(m, n, i + 1, j); }