| 49 | } |
| 50 | |
| 51 | void mitk::TimeNavigationController::Update() |
| 52 | { |
| 53 | if (m_BlockUpdate) |
| 54 | { |
| 55 | return; |
| 56 | } |
| 57 | |
| 58 | if (m_InputWorldTimeGeometry.IsNull()) |
| 59 | { |
| 60 | return; |
| 61 | } |
| 62 | |
| 63 | if (0 == m_InputWorldTimeGeometry->CountTimeSteps()) |
| 64 | { |
| 65 | return; |
| 66 | } |
| 67 | |
| 68 | m_BlockUpdate = true; |
| 69 | |
| 70 | if (m_LastUpdateTime < m_InputWorldTimeGeometry->GetMTime()) |
| 71 | { |
| 72 | Modified(); |
| 73 | } |
| 74 | |
| 75 | if (m_LastUpdateTime < GetMTime()) |
| 76 | { |
| 77 | m_LastUpdateTime = GetMTime(); |
| 78 | |
| 79 | TimeStepType inputTimeSteps = m_InputWorldTimeGeometry->CountTimeSteps(); |
| 80 | const TimeBounds &timeBounds = m_InputWorldTimeGeometry->GetTimeBounds(); |
| 81 | m_Stepper->SetSteps(inputTimeSteps); |
| 82 | m_Stepper->SetPos(0); |
| 83 | m_Stepper->SetRange(timeBounds[0], timeBounds[1]); |
| 84 | } |
| 85 | |
| 86 | // unblock update; we may do this now, because if m_BlockUpdate was already |
| 87 | // true before this method was entered, then we will never come here. |
| 88 | m_BlockUpdate = false; |
| 89 | |
| 90 | // Send the time. Do this even if nothing was changed, because maybe |
| 91 | // Update() was only called to re-send the old time data. |
| 92 | this->SendTime(); |
| 93 | } |
| 94 | |
| 95 | void mitk::TimeNavigationController::SendTime() |
| 96 | { |
no test coverage detected