Skip to content

Commit

Permalink
VisualizationDockWidget.ui: add title. QGoTabManager is now a friend …
Browse files Browse the repository at this point in the history
…class of QGoMainWindow. Add manual segmentation toggled action linked to the visualization of the related dock widget

git-svn-id: svn+ssh://orchestra.med.harvard.edu/svn/megason/Code/GoFigure2@1641 ef826fda-c0ae-4237-af8e-f8dcbcf7929c
  • Loading branch information
Arnaud Gelas committed Oct 29, 2009
1 parent 9038a38 commit cb2843f
Show file tree
Hide file tree
Showing 12 changed files with 161 additions and 151 deletions.
9 changes: 8 additions & 1 deletion branches/GoFigure2Beta/Code/GUI/lib/QGoTabElementBase.cxx
Expand Up @@ -24,7 +24,14 @@ QGoTabElementBase::~QGoTabElementBase()
//--------------------------------------------------------------------------
std::vector< QAction* > QGoTabElementBase::ViewActions()
{
return std::vector< QAction* > ();
return m_ViewActions;
}
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
std::vector< QAction* > QGoTabElementBase::SegmentationActions()
{
return m_SegmentationActions;
}
//--------------------------------------------------------------------------

Expand Down
5 changes: 5 additions & 0 deletions branches/GoFigure2Beta/Code/GUI/lib/QGoTabElementBase.h
Expand Up @@ -63,6 +63,8 @@ class QGoTabElementBase : public QWidget
virtual GoFigure::TabDimensionType GetTabDimensionType( ) const = 0;

virtual std::vector< QAction* > ViewActions();
virtual std::vector< QAction* > SegmentationActions();

virtual std::list< QDockWidget* > DockWidget();
virtual std::list< QWidget* > AdditionalWidget();
// virtual QStatusBar* StatusBar();
Expand All @@ -76,6 +78,9 @@ class QGoTabElementBase : public QWidget
protected:
std::list< QAction* > m_PluginActionList;

std::vector< QAction* > m_ViewActions;
std::vector< QAction* > m_SegmentationActions;

private:
QGoTabElementBase( const QGoTabElementBase& );
void operator = ( const QGoTabElementBase& );
Expand Down
19 changes: 9 additions & 10 deletions branches/GoFigure2Beta/Code/GUI/lib/QGoTabImageView2D.cxx
Expand Up @@ -49,17 +49,17 @@ QGoTabImageView2D( QWidget* iParent )
QObject::connect( LookupTableAction, SIGNAL( triggered() ),
this, SLOT( ChangeLookupTable() ) );

m_ViewActions.push_back( LookupTableAction );
this->m_ViewActions.push_back( LookupTableAction );

QAction* ScalarBarAction = new QAction( tr( "Display Scalar Bar" ), this );
ScalarBarAction->setCheckable( true );
m_ViewActions.push_back( ScalarBarAction );
this->m_ViewActions.push_back( ScalarBarAction );

QObject::connect( ScalarBarAction, SIGNAL( toggled( bool ) ),
this, SLOT( ShowScalarBar( bool ) ) );

QAction* BackgroundColorAction = new QAction( tr("Background Color"), this );
m_ViewActions.push_back( BackgroundColorAction );
this->m_ViewActions.push_back( BackgroundColorAction );

QObject::connect( BackgroundColorAction, SIGNAL( triggered() ),
this, SLOT( ChangeBackgroundColor() ) );
Expand All @@ -70,6 +70,12 @@ QGoTabImageView2D( QWidget* iParent )
QObject::connect( m_VisuDockWidget, SIGNAL( ShowOneChannelChanged( int ) ),
this, SLOT( ShowOneChannel( int ) ) );

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

this->m_ViewActions.push_back( m_VisuDockWidget->toggleViewAction() );

ReadSettings();
}
//--------------------------------------------------------------------------
Expand Down Expand Up @@ -124,13 +130,6 @@ void QGoTabImageView2D::Update( )
}
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
std::vector< QAction* > QGoTabImageView2D::ViewActions()
{
return m_ViewActions;
}
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
void QGoTabImageView2D::SetBackgroundColorToImageViewer()
{
Expand Down
3 changes: 0 additions & 3 deletions branches/GoFigure2Beta/Code/GUI/lib/QGoTabImageView2D.h
Expand Up @@ -29,7 +29,6 @@ class QGoTabImageView2D : public QGoTabImageViewElementBase
void setupUi( QWidget* parent );
void retranslateUi( QWidget *parent );

virtual std::vector< QAction* > ViewActions();
virtual std::list< QWidget* > AdditionalWidget();

virtual void WriteSettings();
Expand All @@ -42,8 +41,6 @@ public slots:
protected:
QGoImageView2D* m_ImageView;

std::vector< QAction* > m_ViewActions;

void GetBackgroundColorFromImageViewer( );
void SetBackgroundColorToImageViewer( );

Expand Down
36 changes: 16 additions & 20 deletions branches/GoFigure2Beta/Code/GUI/lib/QGoTabImageView3D.cxx
Expand Up @@ -77,7 +77,7 @@ void QGoTabImageView3D::CreateAllViewActions()

group->addAction( QuadViewAction );

m_ViewActions.push_back( QuadViewAction );
this->m_ViewActions.push_back( QuadViewAction );

QObject::connect( QuadViewAction, SIGNAL( triggered() ),
this, SLOT( Quadview() ) );
Expand All @@ -87,7 +87,7 @@ void QGoTabImageView3D::CreateAllViewActions()

group->addAction( FullScreenXYAction );

m_ViewActions.push_back( FullScreenXYAction );
this->m_ViewActions.push_back( FullScreenXYAction );

QObject::connect( FullScreenXYAction, SIGNAL( triggered() ),
this, SLOT( FullScreenViewXY() ) );
Expand All @@ -97,7 +97,7 @@ void QGoTabImageView3D::CreateAllViewActions()

group->addAction( FullScreenXZAction );

m_ViewActions.push_back( FullScreenXZAction );
this->m_ViewActions.push_back( FullScreenXZAction );

QObject::connect( FullScreenXZAction, SIGNAL( triggered() ),
this, SLOT( FullScreenViewXZ() ) );
Expand All @@ -107,7 +107,7 @@ void QGoTabImageView3D::CreateAllViewActions()

group->addAction( FullScreenYZAction );

m_ViewActions.push_back( FullScreenYZAction );
this->m_ViewActions.push_back( FullScreenYZAction );

QObject::connect( FullScreenYZAction, SIGNAL( triggered() ),
this, SLOT( FullScreenViewYZ() ) );
Expand All @@ -117,19 +117,15 @@ void QGoTabImageView3D::CreateAllViewActions()

group->addAction( FullScreenXYZAction );

m_ViewActions.push_back( FullScreenXYZAction );
this->m_ViewActions.push_back( FullScreenXYZAction );

QObject::connect( FullScreenXYZAction, SIGNAL( triggered() ),
this, SLOT( FullScreenViewXYZ() ) );

QAction* separator = new QAction( this );
separator->setSeparator( true );

m_ViewActions.push_back( separator );

// QAction* toggleviewaction = m_DockWidget->toggleViewAction();
// toggleviewaction->setText( tr( "Slide Location" ) );
// m_ViewActions.push_back( toggleviewaction );
this->m_ViewActions.push_back( separator );

QAction* LookupTableAction = new QAction( tr( "Lookup Table" ), this );
LookupTableAction->setStatusTip( tr(" Change the associated lookup table" ) );
Expand All @@ -138,20 +134,27 @@ void QGoTabImageView3D::CreateAllViewActions()
QObject::connect( LookupTableAction, SIGNAL( triggered() ),
this, SLOT( ChangeLookupTable() ) );

m_ViewActions.push_back( LookupTableAction );
this->m_ViewActions.push_back( LookupTableAction );

QAction* ScalarBarAction = new QAction( tr( "Display Scalar Bar" ), this );
ScalarBarAction->setCheckable( true );
m_ViewActions.push_back( ScalarBarAction );
this->m_ViewActions.push_back( ScalarBarAction );

QObject::connect( ScalarBarAction, SIGNAL( toggled( bool ) ),
this, SLOT( ShowScalarBar( bool ) ) );

QAction* BackgroundColorAction = new QAction( tr("Background Color"), this );
m_ViewActions.push_back( BackgroundColorAction );
this->m_ViewActions.push_back( BackgroundColorAction );

QObject::connect( BackgroundColorAction, SIGNAL( triggered() ),
this, SLOT( ChangeBackgroundColor() ) );

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

this->m_ViewActions.push_back( m_VisuDockWidget->toggleViewAction() );

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

Expand Down Expand Up @@ -359,13 +362,6 @@ void QGoTabImageView3D::SetBackgroundColorToImageViewer( )
}
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
std::vector< QAction* > QGoTabImageView3D::ViewActions()
{
return m_ViewActions;
}
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
void QGoTabImageView3D::SetImageToImageViewer( vtkImageData* image )
{
Expand Down
4 changes: 0 additions & 4 deletions branches/GoFigure2Beta/Code/GUI/lib/QGoTabImageView3D.h
Expand Up @@ -29,8 +29,6 @@ class QGoTabImageView3D : public QGoTabImageViewElementBase
void setupUi( QWidget* parent );
void retranslateUi( QWidget *parent );

virtual std::vector< QAction* > ViewActions();

virtual std::list< QWidget* > AdditionalWidget()
{return std::list< QWidget* >(); }

Expand Down Expand Up @@ -71,8 +69,6 @@ class QGoTabImageView3D : public QGoTabImageViewElementBase
protected:
QGoImageView3D* m_ImageView;

std::vector< QAction* > m_ViewActions;

void GetBackgroundColorFromImageViewer( );
void SetBackgroundColorToImageViewer( );
void CreateAllViewActions();
Expand Down
Expand Up @@ -35,6 +35,9 @@ QGoTabImageViewElementBase( QWidget* iParent ) :
QObject::connect( m_ManualSegmentationDockWidget,
SIGNAL( ContourRepresentationPropertiesChanged() ),
this, SLOT( ChangeContourRepresentationProperty() ) );

this->m_SegmentationActions.push_back(
m_ManualSegmentationDockWidget->toggleViewAction() );
}
//--------------------------------------------------------------------------

Expand Down Expand Up @@ -335,3 +338,4 @@ DockWidget()
return oList;
}
//--------------------------------------------------------------------------

Expand Up @@ -11,10 +11,10 @@
</rect>
</property>
<property name="windowTitle">
<string>DockWidget</string>
<string>Visualization</string>
</property>
<widget class="QWidget" name="dockWidgetContents">
<widget class="QWidget" name="">
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>10</x>
Expand Down
20 changes: 0 additions & 20 deletions branches/GoFigure2Beta/Code/GUI/src/QGoMainWindow.cxx
Expand Up @@ -119,26 +119,6 @@ QGoMainWindow::~QGoMainWindow()
this->WriteSettings();
}
// *************************************************************************
void QGoMainWindow::ClearViewMenu()
{
this->menuView->clear();
}
// *************************************************************************

// *************************************************************************
void QGoMainWindow::AddActionToViewMenu( QAction* iAction )
{
this->menuView->addAction( iAction );
m_ViewToolBar->addAction( iAction );
}
// *************************************************************************

// *************************************************************************
void QGoMainWindow::ClearViewToolBar()
{
return m_ViewToolBar->clear();
}
// *************************************************************************

// *************************************************************************
void QGoMainWindow::CreateSignalSlotsConnection()
Expand Down
18 changes: 7 additions & 11 deletions branches/GoFigure2Beta/Code/GUI/src/QGoMainWindow.h
Expand Up @@ -74,6 +74,8 @@ class QGoMainWindow : public QMainWindow,
Q_OBJECT

public:
friend class QGoTabManager;

typedef itk::Image< unsigned char, 3 > ImageType;
typedef itk::ImageToVTKImageFilter< ImageType > VTKConvertImageType;
typedef VTKConvertImageType::Pointer VTKConvertImagePointer;
Expand All @@ -85,15 +87,7 @@ class QGoMainWindow : public QMainWindow,

void SetSingleFileName( const QString& iFileName );

void ClearViewMenu();
void AddActionToViewMenu( QAction* );

void ClearViewToolBar();

std::map< GoFigure::TabDimensionType, std::list< QAction* > > m_TabDimPluginActionMap;


protected slots:
private slots:
void on_actionOpen_Single_File_activated( );
void openRecentSingleFile();
void on_actionOpen_Multiple_Files_activated( );
Expand Down Expand Up @@ -122,7 +116,10 @@ protected slots:

void ApplyImageFilter();

protected:
private:

std::map< GoFigure::TabDimensionType, std::list< QAction* > >
m_TabDimPluginActionMap;

/** \brief */
void openRecentFile(const bool& IsSerie);
Expand Down Expand Up @@ -184,7 +181,6 @@ protected slots:
/** \brief Remove path from a given FileName*/
QString strippedName(const QString &fullFileName);


private:
QGoMainWindow( const QGoMainWindow& );
QGoMainWindow operator = ( const QGoMainWindow& );
Expand Down

0 comments on commit cb2843f

Please sign in to comment.