void Image::internalUpdate() { Q_ASSERT(myLockStatus() == KstRWLock::WRITELOCKED); writeLockInputsAndOutputs(); if (_inputMatrices.contains(THEMATRIX)) { MatrixPtr mp = _inputMatrices[THEMATRIX]; // stats NS = mp->sampleCount(); MinX = mp->minX(); int xNumSteps = mp->xNumSteps(); double xStepSize = mp->xStepSize(); MaxX = xNumSteps*xStepSize + MinX; MinY = mp->minY(); int yNumSteps = mp->yNumSteps(); double yStepSize = mp->yStepSize(); MaxY = yNumSteps*yStepSize + MinY; _ns_maxx = MaxX; _ns_minx = MinX; _ns_maxy = MaxY; _ns_miny = MinY; MinPosY = MinY > 0 ? MinY : yStepSize*0.5; MinPosX = MinX > 0 ? MinX : xStepSize*0.5; //recalculate the thresholds if necessary if (_autoThreshold) { _zLower = mp->minValue(); _zUpper = mp->maxValue(); } //update the contour lines if (hasContourMap()) { double min = mp->minValue(), max = mp->maxValue(); double contourStep = (max - min) / (double)(_numContourLines + 1); if (contourStep > 0) { _contourLines.clear(); for (int i = 0; i < _numContourLines; i++) { _contourLines.append(min + (i+1) * contourStep); } } } _redrawRequired = true; } unlockInputsAndOutputs(); return; }
void Image::matrixDimensions(double &x, double &y, double &width, double &height) { if (_inputMatrices.contains(THEMATRIX)) { MatrixPtr mp = _inputMatrices[THEMATRIX]; if (_inputMatrices.contains(THEMATRIX)) { x = mp->minX(); y = mp->minY(); width = mp->xNumSteps() * mp->xStepSize(); height = mp->yNumSteps() * mp->yStepSize(); } else { x = y = width = height = 0; } } else { x = y = width = height = 0; } }