Skip to content

Commit

Permalink
Starts filling QGoTabImageView3D
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://orchestra.med.harvard.edu/svn/megason/Code/GoFigure2@1560 ef826fda-c0ae-4237-af8e-f8dcbcf7929c
  • Loading branch information
Arnaud Gelas committed Oct 2, 2009
1 parent 5a505e7 commit 156e3e3
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 20 deletions.
16 changes: 0 additions & 16 deletions branches/GoFigure2Beta/Code/GUI/src/QGoTabImageView2D.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
QGoTabImageView2D::QGoTabImageView2D( QWidget* parent )
{
m_Image = 0;
m_BackgroundColor = QColor( Qt::black );

setupUi( this );

QAction* LookupTableAction = new QAction( tr( "Lookup Table" ), this );
Expand Down Expand Up @@ -128,20 +126,6 @@ void QGoTabImageView2D::GetBackgroundColorFromImageViewer( )
}
//--------------------------------------------------------------------------

// //--------------------------------------------------------------------------
// void QGoTabImageView2D::ChangeBackgroundColor()
// {
// double r, g, b;
// m_ImageView->GetBackgroundColor( r, g, b );
// this->m_BackgroundColor.setRgbF( r, g, b );
//
// this->m_BackgroundColor = QColorDialog::getColor( this->m_BackgroundColor,
// this, tr( "Choose Background Color" ) );
//
// m_ImageView->SetBackgroundColor( this->m_BackgroundColor );
// }
// //--------------------------------------------------------------------------

//--------------------------------------------------------------------------
void QGoTabImageView2D::ChangeLookupTable()
{
Expand Down
77 changes: 75 additions & 2 deletions branches/GoFigure2Beta/Code/GUI/src/QGoTabImageView3D.cxx
Original file line number Diff line number Diff line change
@@ -1,15 +1,88 @@
#include "QGoTabImageView3D.h"

#include "QGoImageView3D.h"

QGoTabImageView3D::QGoTabImageView3D( QWidget* parent )
{
// m_ImageView = new QGoImageView3D( this );
m_Image = 0;

setupUi( this );

QAction* QuadViewAction = new QAction( tr("QuadView"), this );
m_ViewActions.push_back( QuadViewAction );

QAction* FullScreenXYAction = new QAction( tr( "Full-Screen XY" ), this );
m_ViewActions.push_back( FullScreenXYAction );

QAction* LookupTableAction = new QAction( tr( "Lookup Table" ), this );
LookupTableAction->setStatusTip( tr(" Change the associated lookup table" ) );

// Here write the connection
QObject::connect( LookupTableAction, SIGNAL( triggered() ),
this, SLOT( ChangeLookupTable() ) );

m_ViewActions.push_back( LookupTableAction );

QAction* ScalarBarAction = new QAction( tr( "Display Scalar Bar" ), this );
ScalarBarAction->setCheckable( true );
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 );

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

ReadSettings();
}

QGoTabImageView3D::~QGoTabImageView3D( )
{
}

//--------------------------------------------------------------------------
void QGoTabImageView3D::setupUi( QWidget* parent )
{
if(parent->objectName().isEmpty())
{
parent->resize(800, 800);
}

m_ImageView = new QGoImageView3D( this );
m_ImageView->SetBackgroundColor( m_BackgroundColor );

m_LayOut = new QHBoxLayout( parent );
m_LayOut->addWidget( m_ImageView );

retranslateUi(parent);

QMetaObject::connectSlotsByName(parent);
} // setupUi
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
void QGoTabImageView3D::retranslateUi(QWidget *parent)
{
parent->setWindowTitle( tr( "QGoTabImageView2D" ) );
Q_UNUSED(parent);
}
//--------------------------------------------------------------------------

GoFigure::TabDimensionType QGoTabImageView3D::GetTabDimensionType( ) const
{
return GoFigure::THREE_D;
}
}

void QGoTabImageView3D::SetImage( vtkImageData* iImage )
{
m_ImageView->SetImage( iImage );
m_Image = iImage;
}

void QGoTabImageView3D::Update()
{
m_ImageView->Update();
}
23 changes: 21 additions & 2 deletions branches/GoFigure2Beta/Code/GUI/src/QGoTabImageView3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@

#include "QGoTabImageViewElementBase.h"

#include <QHBoxLayout>
class vtkImageData;

class QAction;
class QToolBar;
class QDockWidget;

class QGoImageView3D;

class QGoTabImageView3D : public QGoTabImageViewElementBase
{
public:
Expand All @@ -11,8 +20,11 @@ class QGoTabImageView3D : public QGoTabImageViewElementBase

GoFigure::TabDimensionType GetTabDimensionType( ) const;

virtual void SetImage( vtkImageData* iImage ) {}
virtual void Update() {}
virtual void SetImage( vtkImageData* iImage );
virtual void Update();

void setupUi( QWidget* parent );
void retranslateUi( QWidget *parent );

virtual std::vector< QAction* > ViewActions()
{return std::vector< QAction* >(); }
Expand All @@ -25,8 +37,15 @@ class QGoTabImageView3D : public QGoTabImageViewElementBase
virtual void ReadSettings() {}

protected:
QHBoxLayout* m_LayOut;
QGoImageView3D* m_ImageView;
vtkImageData* m_Image;

std::vector< QAction* > m_ViewActions;

void GetBackgroundColorFromImageViewer( ) {}
void SetBackgroundColorToImageViewer( ) {}

private:
};
#endif

0 comments on commit 156e3e3

Please sign in to comment.