| 106 | } |
| 107 | |
| 108 | qreal UBZLayerController::generateZLevel(itemLayerType::Enum key) |
| 109 | { |
| 110 | |
| 111 | if (!scopeMap.contains(key)) { |
| 112 | qDebug() << "Number is out of layer scope"; |
| 113 | return errorNumber; |
| 114 | } |
| 115 | |
| 116 | qreal result = scopeMap.value(key).curValue; |
| 117 | qreal top = scopeMap.value(key).topLimit; |
| 118 | qreal incrementalStep = scopeMap.value(key).incStep; |
| 119 | |
| 120 | result += incrementalStep; |
| 121 | if (result >= top) { |
| 122 | // If not only one variable presents in the scope, notify that values for scope are over |
| 123 | if (scopeMap.value(key).topLimit != scopeMap.value(key).bottomLimit) { |
| 124 | qDebug() << "new values are over for the scope" << key; |
| 125 | } |
| 126 | result = top - incrementalStep; |
| 127 | } |
| 128 | |
| 129 | scopeMap[key].curValue = result; |
| 130 | |
| 131 | return result; |
| 132 | } |
| 133 | qreal UBZLayerController::generateZLevel(QGraphicsItem *item) |
| 134 | { |
| 135 | qreal result = errorNumber; |
no test coverage detected