Skip to content

Commit

Permalink
BUG: bug fixed when video not enbled
Browse files Browse the repository at this point in the history
ENH:  useless variables removed
      render windows goes back to first slice of video at the end of recording


git-svn-id: svn+ssh://orchestra.med.harvard.edu/svn/megason/Code/GoFigure2@2037 ef826fda-c0ae-4237-af8e-f8dcbcf7929c
  • Loading branch information
NicolasRannou committed Jan 28, 2010
1 parent b43390e commit afe4226
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 105 deletions.
115 changes: 31 additions & 84 deletions trunk/GoFigure2Beta/Code/GUI/lib/QGoTabImageView3DwT.cxx
Expand Up @@ -285,9 +285,6 @@ CreateVideoRecorderWidget()
this, SLOT( SetSliceViewXY( int ) ) );
QObject::connect( m_VideoRecorderWidget, SIGNAL( TSliceChanged( int ) ),
this, SLOT( SetTimePoint( int ) ) );

QObject::connect( m_VideoRecorderWidget, SIGNAL( GetSlicePosition( int ) ),
this, SLOT( GetSlicePosition( int ) ) );
}

//-------------------------------------------------------------------------
Expand All @@ -306,16 +303,6 @@ SetRendererWindow(int iValue)
m_VideoRecorderWidget->SetRenderingWindow( NULL );
}
}

//-------------------------------------------------------------------------

//-------------------------------------------------------------------------
void
QGoTabImageView3DwT::
GetSlicePosition(int iValue)
{
//0 1 or 2
}
#endif /* ENABLEVIDEORECORD */
//-------------------------------------------------------------------------
/**
Expand Down Expand Up @@ -403,61 +390,39 @@ CreateAllViewActions()
QObject::connect( FullScreenXYZAction, SIGNAL( triggered() ),
this, SLOT( FullScreenViewXYZ() ) );

QAction* separator5 = new QAction( this );
separator5->setSeparator( true );
this->m_ViewActions.push_back( separator5 );

///// NEW ACTIONS
QAction* DisplayAnnotations = new QAction( tr( "Display annotations" ), this );
DisplayAnnotations->setCheckable( true );
DisplayAnnotations->setChecked( true );
DisplayAnnotations->setStatusTip( tr(" Display or not annotations in each 2d view" ) );

QAction* separator5 = new QAction( this );
separator5->setSeparator( true );
this->m_ViewActions.push_back( separator5 );

QAction* DisplayAnnotations = new QAction( tr( "Display annotations" ), this );
DisplayAnnotations->setCheckable( true );
DisplayAnnotations->setChecked( true );
DisplayAnnotations->setStatusTip( tr(" Display or not annotations in each 2d view" ) );
/*
QIcon luticon;
luticon.addPixmap( QPixmap(QString::fromUtf8(":/fig/LookupTable.png")),
QIcon::Normal, QIcon::Off );
LookupTableAction->setIcon( luticon );
*/
// Here write the connection
QObject::connect( DisplayAnnotations, SIGNAL( triggered() ),
this, SLOT( DisplayAnnotations() ) );

this->m_ViewActions.push_back( DisplayAnnotations );

QAction* DisplaySplinePlanes = new QAction( tr( "Display spline planes" ), this );
DisplaySplinePlanes->setCheckable( true );
DisplaySplinePlanes->setChecked( true );
DisplaySplinePlanes->setStatusTip( tr(" Display or not spline planes on each view" ) );
/*
QIcon luticon;
luticon.addPixmap( QPixmap(QString::fromUtf8(":/fig/LookupTable.png")),
QIcon::Normal, QIcon::Off );
LookupTableAction->setIcon( luticon );
*/
// Here write the connection
QObject::connect( DisplaySplinePlanes, SIGNAL( triggered() ),
this, SLOT( DisplaySplinePlanes() ) );

this->m_ViewActions.push_back( DisplaySplinePlanes );

QAction* DisplayCube3D = new QAction( tr( "Display 3D cube" ), this );
DisplayCube3D->setCheckable( true );
DisplayCube3D->setChecked( true );
DisplayCube3D->setStatusTip( tr(" Display or not cube in 3d" ) );

/*
QIcon luticon;
luticon.addPixmap( QPixmap(QString::fromUtf8(":/fig/LookupTable.png")),
QIcon::Normal, QIcon::Off );
LookupTableAction->setIcon( luticon );
*/
// Here write the connection
QObject::connect( DisplayCube3D, SIGNAL( triggered() ),
this, SLOT( DisplayCube() ) );

this->m_ViewActions.push_back( DisplayCube3D );
QObject::connect( DisplayAnnotations, SIGNAL( triggered() ),
this, SLOT( DisplayAnnotations() ) );

this->m_ViewActions.push_back( DisplayAnnotations );

QAction* DisplaySplinePlanes = new QAction( tr( "Display spline planes" ), this );
DisplaySplinePlanes->setCheckable( true );
DisplaySplinePlanes->setChecked( true );
DisplaySplinePlanes->setStatusTip( tr(" Display or not spline planes on each view" ) );

QObject::connect( DisplaySplinePlanes, SIGNAL( triggered() ),
this, SLOT( DisplaySplinePlanes() ) );

this->m_ViewActions.push_back( DisplaySplinePlanes );

QAction* DisplayCube3D = new QAction( tr( "Display 3D cube" ), this );
DisplayCube3D->setCheckable( true );
DisplayCube3D->setChecked( true );
DisplayCube3D->setStatusTip( tr(" Display or not cube in 3d" ) );

QObject::connect( DisplayCube3D, SIGNAL( triggered() ),
this, SLOT( DisplayCube() ) );

this->m_ViewActions.push_back( DisplayCube3D );

QAction* separator = new QAction( this );
separator->setSeparator( true );
Expand Down Expand Up @@ -519,25 +484,9 @@ CreateAllViewActions()
this, SLOT( LoadAllContoursForCurrentTimePoint() ) );

#ifdef ENABLEVIDEORECORD
/*
QAction* separator4 = new QAction( this );
separator4->setSeparator( true );
this->m_ToolsActions.push_back( separator4 );
*/

this->m_ToolsActions.push_back( m_VideoRecorderWidget->toggleViewAction() );

//NEW
QObject::connect( m_VideoRecorderWidget, SIGNAL( FullScreenViewXY() ),
FullScreenXYAction, SLOT( trigger() ));
QObject::connect( m_VideoRecorderWidget, SIGNAL( FullScreenViewYZ() ),
FullScreenYZAction, SLOT( trigger() ));
QObject::connect( m_VideoRecorderWidget, SIGNAL( FullScreenViewXZ() ),
FullScreenXZAction, SLOT( trigger() ));
#endif

////////////////////////////

m_TakeSnapshotAction = new QAction( tr( "Take Snapshot" ), this );
QIcon snapshoticon;
snapshoticon.addPixmap( QPixmap(QString::fromUtf8(":/fig/camera-photo.png")),
Expand All @@ -548,8 +497,6 @@ CreateAllViewActions()
this, SLOT( TakeSnapshot() ) );

this->m_ToolsActions.push_back( m_TakeSnapshotAction );

/////////////////////////////////////////////////
}
//-------------------------------------------------------------------------

Expand Down
1 change: 0 additions & 1 deletion trunk/GoFigure2Beta/Code/GUI/lib/QGoTabImageView3DwT.h
Expand Up @@ -154,7 +154,6 @@ public slots:
void DisplaySplinePlanes();
void DisplayCube();
void TakeSnapshot();
void GetSlicePosition( int );

#ifdef ENABLEVIDEORECORD
void SetRendererWindow( int );
Expand Down
23 changes: 8 additions & 15 deletions trunk/GoFigure2Beta/Code/GUI/lib/QGoVideoRecorder.cxx
Expand Up @@ -357,9 +357,6 @@ on_startVideo_clicked()
m_VideoRecorder->Setm_FrameRate( m_FrameRate2 );
m_VideoRecorder->Setm_VideoQuality( m_VideoQuality2 );

// Get actual position of Slices
emit GetSlicePosition( m_SliceFT );

if( m_SliceFT == 0 )
{
QString fileName = m_VideoName2;
Expand All @@ -376,13 +373,14 @@ on_startVideo_clicked()
for(unsigned int i = m_XMinForVideo; i < m_XMaxForVideo+1; i++)
{
//send signal to gofigure to change slice
std::cout << "emit X"<<std::endl;
emit XSliceChanged(i);
//capture screen
m_VideoRecorder->TakeSnapshot();
}

m_VideoRecorder->EndCapture();

emit XSliceChanged(m_XMinForVideo);
}

if( m_SliceFT == 1 )
Expand All @@ -402,12 +400,13 @@ on_startVideo_clicked()
for(unsigned int i = m_YMinForVideo; i < m_YMaxForVideo+1; i++)
{
//send signal to gofigure to change slice
std::cout << "emit Y"<<std::endl;
emit YSliceChanged(i);
//capture screen
m_VideoRecorder->TakeSnapshot();
}
m_VideoRecorder->EndCapture();

emit YSliceChanged(m_YMinForVideo);
}

if( m_SliceFT == 2 )
Expand All @@ -427,12 +426,13 @@ on_startVideo_clicked()
for(unsigned int i = m_ZMinForVideo; i < m_ZMaxForVideo+1; i++)
{
//send signal to gofigure to change slice
std::cout << "emit Z"<<std::endl;
emit ZSliceChanged(i);
//capture screen
m_VideoRecorder->TakeSnapshot();
}
m_VideoRecorder->EndCapture();

emit ZSliceChanged(m_ZMinForVideo);
}
}
else
Expand Down Expand Up @@ -461,6 +461,8 @@ on_startVideo_clicked()
}
m_VideoRecorder->EndCapture();

//emit TSliceChanged(m_InitialPosition);

}

}
Expand Down Expand Up @@ -674,12 +676,3 @@ SetRenderingWindow( vtkRenderWindow* iRenderingWindow )

// TODO Resize image with the first one if we want to change views during record
}

//----------------------------------------------------------------------------//

void
QGoVideoRecorder::
SetInitialPosition( int iInitialPosition )
{
m_InitialPosition = iInitialPosition;
}
5 changes: 0 additions & 5 deletions trunk/GoFigure2Beta/Code/GUI/lib/QGoVideoRecorder.h
Expand Up @@ -23,8 +23,6 @@ class QGoVideoRecorder : public QDockWidget, private Ui::NewDockWidgetVideoRecor
void SetZMinAndMax( int , int );
void SetTMinAndMax( int , int );

void SetInitialPosition( int );

private:

unsigned int m_XMin;
Expand All @@ -45,8 +43,6 @@ class QGoVideoRecorder : public QDockWidget, private Ui::NewDockWidgetVideoRecor
unsigned int m_TMinForVideo;
unsigned int m_TMaxForVideo;

unsigned int m_InitialPosition;

// in tab "record video"
unsigned int m_WindowSelected;

Expand Down Expand Up @@ -75,7 +71,6 @@ class QGoVideoRecorder : public QDockWidget, private Ui::NewDockWidgetVideoRecor
void YSliceChanged( int );
void ZSliceChanged( int );
void TSliceChanged( int );
void GetSlicePosition( int );

private slots:

Expand Down

0 comments on commit afe4226

Please sign in to comment.