Public Slots | Signals | Public Member Functions | Protected Slots | Protected Attributes

QmitkMovieMaker Class Reference
[Functionalities]

Functionality for creating movies (AVIs) More...

#include <QmitkMovieMaker.h>

Inheritance diagram for QmitkMovieMaker:
Inheritance graph
[legend]
Collaboration diagram for QmitkMovieMaker:
Collaboration graph
[legend]

List of all members.

Public Slots

void StartPlaying ()
 Start playing the animation by restarting the timer.
void PausePlaying ()
 Pauses playing the animation by stopping the timer.
void StopPlaying ()
 Stops playing the animation and resets the stepper.
void SetLooping (bool looping)
 Sets animation looping ON/OFF.
void SetDirection (int direction)
 Sets the direction: 0 = forward, 1 = backward, 2 = pingpong.
void SetAspect (int aspect)
 Sets the animation aspect: 0 = spatial, 1 = temporal, 2 = combined.
void SetStepperWindow (int window)
 Sets a specified stepper window, which is moving.
void SetRecordingWindow (int window)
 Sets a specified recording window, from which the movie is generated.
void AdvanceAnimation ()
 Advances the animation by one frame. Exactly how much the stepper advances depends on the time elapsed since the last call to this function.

Signals

void StartBlockControls ()
void EndBlockControls ()
void EndBlockControlsMovieDeactive ()
void SwitchDirection (int)
void SwitchAspect (int)
void SwitchSelectedStepperWindow (int)
void SwitchSelectedRecordingWindow (int)

Public Member Functions

 QmitkMovieMaker (QObject *parent=0, const char *name=0)
 Constructor.
virtual ~QmitkMovieMaker ()
 Destructor.
void CreateQtPartControl (QWidget *parent)
 Method for creating the widget containing the application controls, like sliders, buttons etc.
virtual void CreateConnections ()
 Method for creating the connections of main and control widget.
virtual void Activated ()
 Method for creating an QAction object, i.e. button & menu entry.
virtual void Deactivated ()
void FocusChange ()
 Called when another window receives the focus.
virtual void DataStorageChanged ()
virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget)
virtual void StdMultiWidgetNotAvailable ()

Protected Slots

void RenderSlot ()
void GenerateMovie ()
void GenerateScreenshot ()
void GenerateHR3DScreenshot ()
void RBTNForward ()
void RBTNBackward ()
void RBTNPingPong ()
void RBTNSpatial ()
void RBTNTemporal ()
void RBTNCombined ()
void BlockControls ()
void UnBlockControls ()
void UnBlockControlsMovieDeactive ()
void BlockControls (bool blocked)
void DeleteMStepper ()

Protected Attributes

QObject * parentWidget
QVTKWidget * widget
QmitkStdMultiWidgetm_MultiWidget
vtkEventQtSlotConnect * connections
vtkRenderWindow * renderWindow
mitk::VtkPropRenderer::Pointer m_PropRenderer
Ui::QmitkMovieMakerControlsm_Controls

Detailed Description

Functionality for creating movies (AVIs)

Overview

The MovieMaker functionality extends existing modes of data visualization with animation capabilities. The animation aspect determines which aspect of a visualization gets animated. This aspect can be spatial (i.e. the camera position and orientation in a 3D view, or the selected slice in a 2D view), temporal (the time step in a time-based dataset), or something more sophisticated (for example, volume rendering transfer functions might be changed dynamically as part of an animation to produce interesting effects). Currently, the following animation modes are supported:

As can be seen in the screenshot below, the functionality provides cine controls to start, pause and stop the animation. The direction of the animation can be selected (forward, backward or ping-pong). The animation can be set to either the spatial or the temporal aspect, or to both aspects combined. The cycle time determines the duration of one animation loop.

In a multi-view scenario, the animation is applied to the currently focussed view. Other views which display the same data may be affected as well.

Animations can be written on disk; the corresponding button creates an animation consisting of one single loop and writes every animation frame into an AVI file.

QmitkMovieMakerGUI.png

Implementation

The following diagram provides an overview over the classes collaborating with QmitkMovieMaker.

QmitkMovieMakerClasses.png

The respective roles of these classes are:

Future plans

The basic animation capabilities of this functionality could be extended to allow the creation of more sophisticated animations. Potentially useful features include:

Definition at line 138 of file QmitkMovieMaker.h.


Constructor & Destructor Documentation

QmitkMovieMaker::QmitkMovieMaker ( QObject *  parent = 0,
const char *  name = 0 
)

Constructor.

Definition at line 79 of file QmitkMovieMaker.cpp.

References FocusChange(), MITK_ERROR, mitk::MovieGenerator::New(), and parentWidget.

:
  QmitkFunctionality(), m_Controls(NULL),
  m_StepperAdapter(NULL),
  m_FocusManagerCallback(0), m_Looping(true), m_Direction(0), m_Aspect(0)
{

  parentWidget = parent;

  m_Timer = new QTimer(this);
  m_Time = new QTime();

  m_FocusManagerCallback = MemberCommand::New();
  m_FocusManagerCallback->SetCallbackFunction(this, &QmitkMovieMaker::FocusChange);

  m_movieGenerator = mitk::MovieGenerator::New();

  if (m_movieGenerator.IsNull())
  {
    MITK_ERROR << "Either mitk::MovieGenerator is not implemented for your";
    MITK_ERROR << " platform or an error occurred during";
    MITK_ERROR << " mitk::MovieGenerator::New()" ;
  }

}
QmitkMovieMaker::~QmitkMovieMaker (  ) [virtual]

Destructor.

Definition at line 106 of file QmitkMovieMaker.cpp.

{
  delete m_StepperAdapter;
  delete m_Timer;
  delete m_Time;
  //delete m_RecordingRenderer;

}

Member Function Documentation

void QmitkMovieMaker::Activated (  ) [virtual]

Method for creating an QAction object, i.e. button & menu entry.

Parameters:
parentthe parent QWidget

Reimplemented from QmitkFunctionality.

Definition at line 204 of file QmitkMovieMaker.cpp.

References FocusChange(), mitk::GlobalInteraction::GetInstance(), mitk::BaseController::GetTime(), and MITK_INFO.

{
  QmitkFunctionality::Activated();

  // create a member command that will be executed from the observer
  itk::SimpleMemberCommand<QmitkMovieMaker>::Pointer stepperChangedCommand;
  stepperChangedCommand = itk::SimpleMemberCommand<QmitkMovieMaker>::New();
  // set the callback function of the member command
  stepperChangedCommand->SetCallbackFunction(this, &QmitkMovieMaker::UpdateGUI);
  // add an observer to the data tree node pointer connected to the above member command
  MITK_INFO << "Add observer on insertion point node in NavigationPathController::AddObservers";
  m_StepperObserverTag = this->GetTemporalController()->GetTime()->AddObserver(
      itk::ModifiedEvent(), stepperChangedCommand);

  m_FocusManagerObserverTag
      = mitk::GlobalInteraction::GetInstance()->GetFocusManager()->AddObserver(mitk::FocusEvent(),
          m_FocusManagerCallback);
  this->UpdateGUI();
  // Initialize steppers etc.
  this->FocusChange();
}
void QmitkMovieMaker::AdvanceAnimation (  ) [slot]

Advances the animation by one frame. Exactly how much the stepper advances depends on the time elapsed since the last call to this function.

Definition at line 270 of file QmitkMovieMaker.cpp.

References mitk::Stepper::GetSteps(), m_Controls, mitk::Stepper::Next(), QmitkStepperAdapter::SetStepper(), and Ui_QmitkMovieMakerControls::spnDuration.

Referenced by CreateConnections().

{
  // This method is called when a timer timeout occurs. It increases the
  // stepper value according to the elapsed time and the stepper interval.
  // Note that a screen refresh is not forced, but merely requested, and may
  // occur only after more calls to AdvanceAnimation().

  mitk::Stepper* stepper = this->GetAspectStepper();

  m_StepperAdapter->SetStepper(stepper);

  int elapsedTime = m_Time->elapsed();
  m_Time->restart();

  static double increment = 0.0;
  increment = increment - static_cast<int> (increment);
  increment += elapsedTime * stepper->GetSteps() / (m_Controls->spnDuration->value() * 1000.0);

  int i, n = static_cast<int> (increment);
  for (i = 0; i < n; ++i)
  {
    stepper->Next();
  }
}
void QmitkMovieMaker::BlockControls ( bool  blocked ) [protected, slot]
void QmitkMovieMaker::BlockControls (  ) [protected, slot]
void QmitkMovieMaker::CreateConnections (  ) [virtual]

Method for creating the connections of main and control widget.

Definition at line 148 of file QmitkMovieMaker.cpp.

References AdvanceAnimation(), BlockControls(), Ui_QmitkMovieMakerControls::btnMovie, Ui_QmitkMovieMakerControls::btnPause, Ui_QmitkMovieMakerControls::btnPlay, Ui_QmitkMovieMakerControls::btnScreenshot, Ui_QmitkMovieMakerControls::btnStop, Ui_QmitkMovieMakerControls::cmbSelectedRecordingWindow, Ui_QmitkMovieMakerControls::cmbSelectedStepperWindow, DeleteMStepper(), EndBlockControls(), EndBlockControlsMovieDeactive(), GenerateHR3DScreenshot(), GenerateMovie(), GenerateScreenshot(), m_Controls, Ui_QmitkMovieMakerControls::m_HRScreenshot, PausePlaying(), RBTNBackward(), Ui_QmitkMovieMakerControls::rbtnBackward, RBTNCombined(), Ui_QmitkMovieMakerControls::rbtnCombined, RBTNForward(), Ui_QmitkMovieMakerControls::rbtnForward, RBTNPingPong(), Ui_QmitkMovieMakerControls::rbtnPingPong, RBTNSpatial(), Ui_QmitkMovieMakerControls::rbtnSpatial, RBTNTemporal(), Ui_QmitkMovieMakerControls::rbtnTemporal, SetAspect(), SetDirection(), SetRecordingWindow(), SetStepperWindow(), Ui_QmitkMovieMakerControls::spatialTimeRelation, StartBlockControls(), StartPlaying(), StopPlaying(), SwitchAspect(), SwitchDirection(), UnBlockControls(), and UnBlockControlsMovieDeactive().

Referenced by CreateQtPartControl().

{
  if (m_Controls)
  {
    // start / pause / stop playing
    connect((QObject*) m_Controls->btnPlay, SIGNAL(clicked()), (QObject*) this,
        SLOT(StartPlaying()));
    connect((QObject*) m_Controls->btnPause, SIGNAL(clicked()), this, SLOT(PausePlaying()));
    connect((QObject*) m_Controls->btnStop, SIGNAL(clicked()), this, SLOT(StopPlaying()));

    connect((QObject*) m_Controls->rbtnForward, SIGNAL(clicked()), this, SLOT(RBTNForward()));
    connect((QObject*) m_Controls->rbtnBackward, SIGNAL(clicked()), this, SLOT(RBTNBackward()));
    connect((QObject*) m_Controls->rbtnPingPong, SIGNAL(clicked()), this, SLOT(RBTNPingPong()));

    // radio button group: forward, backward, ping-pong
    connect( this, SIGNAL(SwitchDirection(int)), this, SLOT(SetDirection(int)) );

    // radio button group: spatial, temporal
    connect((QObject*) m_Controls->rbtnSpatial, SIGNAL(clicked()), this, SLOT(RBTNSpatial()));
    connect((QObject*) m_Controls->rbtnTemporal, SIGNAL(clicked()), this, SLOT(RBTNTemporal()));
    connect((QObject*) m_Controls->rbtnCombined, SIGNAL(clicked()), this, SLOT(RBTNCombined()));
    connect( this, SIGNAL(SwitchAspect(int)), this, SLOT(SetAspect(int)) );

    // stepper window selection
    connect((QObject*) (m_Controls->cmbSelectedStepperWindow), SIGNAL ( activated ( int) ), (QObject*) this, SLOT ( SetStepperWindow (int) ) );

    // recording window selection
    connect((QObject*) (m_Controls->cmbSelectedRecordingWindow), SIGNAL ( activated ( int) ), (QObject*) this, SLOT ( SetRecordingWindow (int) ) );

    // advance the animation
    // every timer tick
    connect((QObject*) m_Timer, SIGNAL(timeout()), this, SLOT(AdvanceAnimation()));

    // movie generation
    // when the movie button is clicked
    connect((QObject*) m_Controls->btnMovie, SIGNAL(clicked()), this, SLOT(GenerateMovie()));

    connect((QObject*) m_Controls->btnScreenshot, SIGNAL(clicked()), this, SLOT(
        GenerateScreenshot()));
    connect((QObject*) m_Controls->m_HRScreenshot, SIGNAL(clicked()), this, SLOT(
        GenerateHR3DScreenshot()));

    // blocking of ui elements during movie generation
    connect((QObject*) this, SIGNAL(StartBlockControls()), (QObject*) this, SLOT(BlockControls()));

    connect((QObject*) this, SIGNAL(EndBlockControls()), (QObject*) this, SLOT(UnBlockControls()));

    connect((QObject*) this, SIGNAL(EndBlockControlsMovieDeactive()), (QObject*) this, SLOT(
        UnBlockControlsMovieDeactive()));

    // allow for change of spatialtime relation
    connect((QObject*) m_Controls->spatialTimeRelation, SIGNAL(valueChanged ( int ) ), this, SLOT( DeleteMStepper() ) );
    
  }
}
void QmitkMovieMaker::CreateQtPartControl ( QWidget *  parent ) [virtual]

Method for creating the widget containing the application controls, like sliders, buttons etc.

Implements berry::QtViewPart.

Definition at line 576 of file QmitkMovieMaker.cpp.

References Ui_QmitkMovieMakerControls::btnMovie, Ui_QmitkMovieMakerControls::btnPause, Ui_QmitkMovieMakerControls::cmbSelectedRecordingWindow, Ui_QmitkMovieMakerControls::cmbSelectedStepperWindow, CreateConnections(), mitk::BaseRenderer::GetInstance(), mitk::RenderingManager::GetInstance(), m_Controls, Ui_QmitkMovieMakerControls::setupUi(), and Ui_QmitkMovieMakerControls::slidAngle.

{
  if (!m_Controls)
  {
    m_Controls = new Ui::QmitkMovieMakerControls;
    m_Controls->setupUi(parent);

    m_StepperAdapter = new QmitkStepperAdapter((QObject*) m_Controls->slidAngle,
        this->GetSpatialController()->GetSlice(), "AngleStepperToMovieMakerFunctionality");

    // Initialize "Selected Window" combo box
    const mitk::RenderingManager::RenderWindowVector rwv =
        mitk::RenderingManager::GetInstance()->GetAllRegisteredRenderWindows();

    mitk::RenderingManager::RenderWindowVector::const_iterator iter;
    unsigned int i = 0;
    for (iter = rwv.begin(); iter != rwv.end(); ++iter)
    {
      m_Controls->cmbSelectedStepperWindow->insertItem(i,
          mitk::BaseRenderer::GetInstance((*iter))->GetName());
      m_Controls->cmbSelectedRecordingWindow->insertItem(i++, mitk::BaseRenderer::GetInstance(
          (*iter))->GetName());
    }

    m_Controls->btnPause->setHidden(true);
    if (m_movieGenerator.IsNull())
      m_Controls->btnMovie->setEnabled(false);
  }

  this->CreateConnections();

}
void QmitkMovieMaker::DataStorageChanged (  ) [virtual]

Called when a DataStorage add *or* remove *or* change event was thrown. May be reimplemented by deriving classes.

Reimplemented from QmitkFunctionality.

Definition at line 571 of file QmitkMovieMaker.cpp.

{
  //  UpdateGUI();
}
void QmitkMovieMaker::Deactivated (  ) [virtual]

Only called when IsExclusiveFunctionality() returns true.

See also:
IsExclusiveFunctionality()

Reimplemented from QmitkFunctionality.

Definition at line 226 of file QmitkMovieMaker.cpp.

References mitk::GlobalInteraction::GetInstance(), and mitk::BaseController::GetTime().

{
  QmitkFunctionality::Deactivated();
  this->GetTemporalController()->GetTime()->RemoveObserver(m_StepperObserverTag);
  mitk::GlobalInteraction::GetInstance()->GetFocusManager()->RemoveObserver(
      m_FocusManagerObserverTag); // remove (if tag is invalid, nothing is removed)
}
void QmitkMovieMaker::DeleteMStepper (  ) [protected, slot]

Definition at line 749 of file QmitkMovieMaker.cpp.

Referenced by CreateConnections(), SetRecordingWindow(), and SetStepperWindow().

{
  m_Stepper = NULL;
  UpdateLooping();
}
void QmitkMovieMaker::EndBlockControls (  ) [signal]
void QmitkMovieMaker::EndBlockControlsMovieDeactive (  ) [signal]
void QmitkMovieMaker::FocusChange (  )

Called when another window receives the focus.

Definition at line 234 of file QmitkMovieMaker.cpp.

References Ui_QmitkMovieMakerControls::cmbSelectedRecordingWindow, Ui_QmitkMovieMakerControls::cmbSelectedStepperWindow, mitk::BaseRenderer::GetInstance(), mitk::GlobalInteraction::GetInstance(), mitk::RenderingManager::GetInstance(), mitk::Stepper::InverseDirectionOff(), m_Controls, SetRecordingWindow(), QmitkStepperAdapter::SetStepper(), and SetStepperWindow().

Referenced by Activated(), and QmitkMovieMaker().

{
  mitk::Stepper *stepper = this->GetAspectStepper();
  m_StepperAdapter->SetStepper(stepper);

  // Make the stepper movement non-inverted
  stepper->InverseDirectionOff();

  // Set stepping direction and aspect (spatial / temporal) for new stepper
  this->UpdateLooping();
  this->UpdateDirection();

  // Set newly focused window as active in "Selected Window" combo box
  const mitk::RenderingManager::RenderWindowVector rwv =
      mitk::RenderingManager::GetInstance()->GetAllRegisteredRenderWindows();

  int i;
  mitk::RenderingManager::RenderWindowVector::const_iterator iter;
  for (iter = rwv.begin(), i = 0; iter != rwv.end(); ++iter, ++i)
  {
    mitk::BaseRenderer* focusedRenderer =
        mitk::GlobalInteraction::GetInstance()->GetFocusManager()->GetFocused();

    if (focusedRenderer == mitk::BaseRenderer::GetInstance((*iter)))
    {
      m_Controls->cmbSelectedStepperWindow->setCurrentIndex(i);
      //      this->cmbSelectedStepperWindow_activated(i);
      this->SetStepperWindow(i);
      m_Controls->cmbSelectedRecordingWindow->setCurrentIndex(i);
      //      this->cmbSelectedRecordWindow_activated(i);
      this->SetRecordingWindow(i);
      break;
    }
  }
}
void QmitkMovieMaker::GenerateHR3DScreenshot (  ) [protected, slot]

Definition at line 535 of file QmitkMovieMaker.cpp.

References EndBlockControls(), EndBlockControlsMovieDeactive(), mitk::RenderWindowBase::GetRenderer(), mitk::BaseRenderer::GetVtkRenderer(), m_MultiWidget, QmitkStdMultiWidget::mitkWidget4, and StartBlockControls().

Referenced by CreateConnections().

{
  emit StartBlockControls();

  QString fileName = QFileDialog::getSaveFileName(NULL, "Save screenshot to...", QDir::currentPath(), "JPEG file (*.jpg);;PNG file (*.png)");
  
  // only works correctly for 3D RenderWindow
  vtkRenderer* renderer = m_MultiWidget->mitkWidget4->GetRenderer()->GetVtkRenderer();
  if (renderer == NULL)
    return;
  this->TakeScreenshot(renderer, 4, fileName);

  if (m_movieGenerator.IsNotNull())
    emit EndBlockControls();
  else
    emit EndBlockControlsMovieDeactive();
}
void QmitkMovieMaker::GenerateMovie (  ) [protected, slot]

Definition at line 482 of file QmitkMovieMaker.cpp.

References EndBlockControls(), EndBlockControlsMovieDeactive(), mitk::RenderingManager::GetInstance(), m_Controls, MITK_ERROR, Ui_QmitkMovieMakerControls::spnDuration, and StartBlockControls().

Referenced by CreateConnections().

{
  emit StartBlockControls();

  // provide the movie generator with the stepper and rotate the camera each step
  if (m_movieGenerator.IsNotNull())
  {
    m_movieGenerator->SetStepper(this->GetAspectStepper());
    m_movieGenerator->SetRenderer(m_RecordingRenderer);
    m_movieGenerator->SetFrameRate(static_cast<unsigned int> (360
        / (m_Controls->spnDuration->value())));

    //    QString movieFileName = QFileDialog::getSaveFileName( QString::null, "Movie (*.avi)", 0, "movie file dialog", "Choose a file name" );

    QString movieFileName = QFileDialog::getSaveFileName(0, "Choose a file name", QString::null,
        "Movie (*.avi)", 0, 0);

    if (movieFileName.isEmpty() == false)
    {
      mitk::RenderingManager::GetInstance()->RequestUpdateAll();
      m_movieGenerator->SetFileName(movieFileName.toAscii());
      m_movieGenerator->WriteMovie();
    }

    emit EndBlockControls();
  }
  else
  {
    MITK_ERROR << "Either mitk::MovieGenerator is not implemented for your";
    MITK_ERROR << " platform or an error occurred during";
    MITK_ERROR << " mitk::MovieGenerator::New()";

    emit EndBlockControlsMovieDeactive();
  }
}
void QmitkMovieMaker::GenerateScreenshot (  ) [protected, slot]

Definition at line 518 of file QmitkMovieMaker.cpp.

References EndBlockControls(), EndBlockControlsMovieDeactive(), mitk::GlobalInteraction::GetInstance(), and StartBlockControls().

Referenced by CreateConnections().

{
  emit StartBlockControls();

  QString fileName = QFileDialog::getSaveFileName(NULL, "Save screenshot to...", QDir::currentPath(), "JPEG file (*.jpg);;PNG file (*.png)");
  
  vtkRenderer* renderer = mitk::GlobalInteraction::GetInstance()->GetFocus()->GetVtkRenderer();
  if (renderer == NULL)
    return;
  this->TakeScreenshot(renderer, 1, fileName);

  if (m_movieGenerator.IsNotNull())
    emit EndBlockControls();
  else
    emit EndBlockControlsMovieDeactive();
}
void QmitkMovieMaker::PausePlaying (  ) [slot]

Pauses playing the animation by stopping the timer.

Definition at line 303 of file QmitkMovieMaker.cpp.

References Ui_QmitkMovieMakerControls::btnMovie, Ui_QmitkMovieMakerControls::btnPause, Ui_QmitkMovieMakerControls::btnPlay, Ui_QmitkMovieMakerControls::btnScreenshot, m_Controls, and Ui_QmitkMovieMakerControls::slidAngle.

Referenced by CreateConnections().

{

  m_Controls->slidAngle->setDisabled(false);
  m_Controls->btnMovie->setEnabled(true);
  m_Controls->btnPlay->setEnabled(true);
  m_Controls->btnScreenshot->setEnabled(true);

  m_Timer->stop();

  m_Controls->btnPlay->setHidden(false);
  m_Controls->btnPause->setHidden(true);
  if (m_movieGenerator.IsNull())
    m_Controls->btnMovie->setEnabled(false);
}
void QmitkMovieMaker::RBTNBackward (  ) [protected, slot]

Definition at line 634 of file QmitkMovieMaker.cpp.

References SwitchDirection().

Referenced by CreateConnections().

{
  emit SwitchDirection(1);
}
void QmitkMovieMaker::RBTNCombined (  ) [protected, slot]

Definition at line 654 of file QmitkMovieMaker.cpp.

References SwitchAspect().

Referenced by CreateConnections().

{
  emit SwitchAspect(2);
}
void QmitkMovieMaker::RBTNForward (  ) [protected, slot]

Definition at line 629 of file QmitkMovieMaker.cpp.

References SwitchDirection().

Referenced by CreateConnections().

{
  emit SwitchDirection(0);
}
void QmitkMovieMaker::RBTNPingPong (  ) [protected, slot]

Definition at line 639 of file QmitkMovieMaker.cpp.

References SwitchDirection().

Referenced by CreateConnections().

{
  emit SwitchDirection(2);
}
void QmitkMovieMaker::RBTNSpatial (  ) [protected, slot]

Definition at line 644 of file QmitkMovieMaker.cpp.

References SwitchAspect().

Referenced by CreateConnections().

{
  emit SwitchAspect(0);
}
void QmitkMovieMaker::RBTNTemporal (  ) [protected, slot]

Definition at line 649 of file QmitkMovieMaker.cpp.

References SwitchAspect().

Referenced by CreateConnections().

{
  emit SwitchAspect(1);
}
void QmitkMovieMaker::RenderSlot (  ) [protected, slot]

Definition at line 295 of file QmitkMovieMaker.cpp.

References m_PropRenderer, and widget.

{
  int *i = widget->GetRenderWindow()->GetSize();
  m_PropRenderer->Resize(i[0], i[1]);

  widget->GetRenderWindow()->Render();
}
void QmitkMovieMaker::SetAspect ( int  aspect ) [slot]

Sets the animation aspect: 0 = spatial, 1 = temporal, 2 = combined.

Definition at line 362 of file QmitkMovieMaker.cpp.

References QmitkStepperAdapter::SetStepper().

Referenced by CreateConnections().

{
  m_Aspect = aspect;

  m_StepperAdapter->SetStepper(this->GetAspectStepper());
  this->UpdateLooping();
  this->UpdateDirection();
}
void QmitkMovieMaker::SetDirection ( int  direction ) [slot]

Sets the direction: 0 = forward, 1 = backward, 2 = pingpong.

Definition at line 356 of file QmitkMovieMaker.cpp.

Referenced by CreateConnections().

{
  m_Direction = direction;
  this->UpdateDirection();
}
void QmitkMovieMaker::SetLooping ( bool  looping ) [slot]

Sets animation looping ON/OFF.

Definition at line 350 of file QmitkMovieMaker.cpp.

{
  m_Looping = looping;
  this->UpdateLooping();
}
void QmitkMovieMaker::SetRecordingWindow ( int  window ) [slot]

Sets a specified recording window, from which the movie is generated.

Definition at line 393 of file QmitkMovieMaker.cpp.

References DeleteMStepper(), mitk::BaseRenderer::GetInstance(), and mitk::RenderingManager::GetInstance().

Referenced by CreateConnections(), and FocusChange().

{
  // Set newly selected window for recording
  const mitk::RenderingManager::RenderWindowVector rwv =
      mitk::RenderingManager::GetInstance()->GetAllRegisteredRenderWindows();

  //Delete MultiStepper
  DeleteMStepper();

  int i;
  mitk::RenderingManager::RenderWindowVector::const_iterator iter;
  for (iter = rwv.begin(), i = 0; iter != rwv.end(); ++iter, ++i)
  {
    if (i == window)
    {
      m_RecordingRenderer = mitk::BaseRenderer::GetInstance((*iter));
      break;
    }
  }
}
void QmitkMovieMaker::SetStepperWindow ( int  window ) [slot]

Sets a specified stepper window, which is moving.

Definition at line 371 of file QmitkMovieMaker.cpp.

References DeleteMStepper(), mitk::BaseRenderer::GetInstance(), mitk::GlobalInteraction::GetInstance(), and mitk::RenderingManager::GetInstance().

Referenced by CreateConnections(), and FocusChange().

{
  // Set newly selected window / renderer as focused
  const mitk::RenderingManager::RenderWindowVector rwv =
      mitk::RenderingManager::GetInstance()->GetAllRegisteredRenderWindows();

  //Delete MultiStepper
  DeleteMStepper();

  int i;
  mitk::RenderingManager::RenderWindowVector::const_iterator iter;
  for (iter = rwv.begin(), i = 0; iter != rwv.end(); ++iter, ++i)
  {
    if (i == window)
    {
      mitk::GlobalInteraction::GetInstance()->GetFocusManager() ->SetFocused(
          mitk::BaseRenderer::GetInstance((*iter)));
      break;
    }
  }
}
void QmitkMovieMaker::StartBlockControls (  ) [signal]
void QmitkMovieMaker::StartPlaying (  ) [slot]

Start playing the animation by restarting the timer.

Definition at line 609 of file QmitkMovieMaker.cpp.

References Ui_QmitkMovieMakerControls::btnMovie, Ui_QmitkMovieMakerControls::btnPause, Ui_QmitkMovieMakerControls::btnPlay, Ui_QmitkMovieMakerControls::btnScreenshot, m_Controls, and Ui_QmitkMovieMakerControls::slidAngle.

Referenced by CreateConnections().

{
  m_Controls->slidAngle->setDisabled(true);
  m_Controls->btnMovie->setEnabled(false);
  m_Controls->btnPlay->setEnabled(false);
  m_Controls->btnScreenshot->setEnabled(false);

  // Restart timer with 5 msec interval - this should be fine-grained enough
  // even for high display refresh frequencies
  m_Timer->start(5);

  m_Time->restart();

  m_Controls->btnPlay->setHidden(true);
  m_Controls->btnPause->setHidden(false);
  if (m_movieGenerator.IsNull())
    m_Controls->btnMovie->setEnabled(false);

}
void QmitkMovieMaker::StdMultiWidgetAvailable ( QmitkStdMultiWidget stdMultiWidget ) [virtual]

Called when a StdMultiWidget is available.

Reimplemented from QmitkFunctionality.

Definition at line 685 of file QmitkMovieMaker.cpp.

References m_MultiWidget, and QmitkFunctionality::m_Parent.

{
  m_MultiWidget = &stdMultiWidget;
  m_Parent->setEnabled(true);
}
void QmitkMovieMaker::StdMultiWidgetNotAvailable (  ) [virtual]

Called when no StdMultiWidget is available.

Reimplemented from QmitkFunctionality.

Definition at line 691 of file QmitkMovieMaker.cpp.

References m_MultiWidget, and QmitkFunctionality::m_Parent.

{
  m_MultiWidget = NULL;
  m_Parent->setEnabled(false);
}
void QmitkMovieMaker::StopPlaying (  ) [slot]

Stops playing the animation and resets the stepper.

Definition at line 319 of file QmitkMovieMaker.cpp.

References Ui_QmitkMovieMakerControls::btnMovie, Ui_QmitkMovieMakerControls::btnPause, Ui_QmitkMovieMakerControls::btnPlay, Ui_QmitkMovieMakerControls::btnScreenshot, mitk::Stepper::First(), mitk::Stepper::Last(), m_Controls, QmitkStepperAdapter::SetStepper(), and Ui_QmitkMovieMakerControls::slidAngle.

Referenced by CreateConnections().

{
  m_Controls->slidAngle->setDisabled(false);
  m_Controls->btnMovie->setEnabled(true);
  m_Controls->btnPlay->setEnabled(true);
  m_Controls->btnScreenshot->setEnabled(true);

  m_Controls->btnPlay->setHidden(false);
  m_Controls->btnPause->setHidden(true);

  m_Timer->stop();
  switch (m_Direction)
  {
  case 0:
  case 2:
    this->GetAspectStepper()->First();
    break;

  case 1:
    this->GetAspectStepper()->Last();
    break;
  }

  // Reposition slider GUI element
  m_StepperAdapter->SetStepper(this->GetAspectStepper());

  if (m_movieGenerator.IsNull())
    m_Controls->btnMovie->setEnabled(false);

}
void QmitkMovieMaker::SwitchAspect ( int   ) [signal]
void QmitkMovieMaker::SwitchDirection ( int   ) [signal]
void QmitkMovieMaker::SwitchSelectedRecordingWindow ( int   ) [signal]
void QmitkMovieMaker::SwitchSelectedStepperWindow ( int   ) [signal]
void QmitkMovieMaker::UnBlockControls (  ) [protected, slot]

Definition at line 664 of file QmitkMovieMaker.cpp.

References BlockControls().

Referenced by CreateConnections().

{
  BlockControls(false);
}
void QmitkMovieMaker::UnBlockControlsMovieDeactive (  ) [protected, slot]

Definition at line 669 of file QmitkMovieMaker.cpp.

References BlockControls(), Ui_QmitkMovieMakerControls::btnMovie, and m_Controls.

Referenced by CreateConnections().

{
  BlockControls(false);

  m_Controls->btnMovie->setEnabled(false);
}

Member Data Documentation

vtkEventQtSlotConnect* QmitkMovieMaker::connections [protected]

Definition at line 253 of file QmitkMovieMaker.h.

Definition at line 255 of file QmitkMovieMaker.h.

Referenced by RenderSlot().

QObject* QmitkMovieMaker::parentWidget [protected]

Definition at line 250 of file QmitkMovieMaker.h.

Referenced by QmitkMovieMaker().

vtkRenderWindow* QmitkMovieMaker::renderWindow [protected]

Definition at line 254 of file QmitkMovieMaker.h.

QVTKWidget* QmitkMovieMaker::widget [protected]

Definition at line 251 of file QmitkMovieMaker.h.

Referenced by RenderSlot().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines