FACT++  1.0
bool RawDataViewer::setCorrectSlice ( QMouseEvent *  event)
private

Definition at line 515 of file RawEventsViewer.cc.

References bboxMax, bboxMin, drawImpulse, height, nRoi, nRoiTM, BasicGlCamera::pixelSize, BasicGlCamera::shownSizex, BasicGlCamera::shownSizey, signalCurrentSlice(), and whichSlice.

Referenced by mouseMoveEvent(), and mousePressEvent().

516 {
517  if (!drawImpulse)
518  return false;
519  float cx = (float)cEvent->x() * pixelSize - shownSizex/2;
520  float cy = ((float)height()-(float)cEvent->y())*pixelSize - shownSizey/2;
521  if (cx < bboxMin[0] ||
522  cx > bboxMax[0] ||
523  cy < bboxMin[1] ||
524  cy > bboxMax[1])
525  return false;
526  whichSlice = (cx - bboxMin[0])*(nRoi+nRoiTM)/(bboxMax[0] - bboxMin[0]);
527  if (whichSlice >= nRoi)
528  whichSlice = nRoi-1;
530  return true;
531 }
void signalCurrentSlice(int slice)
float bboxMin[2]
float bboxMax[2]
float height
Definition: HeadersGPS.h:26

+ Here is the caller graph for this function: