Skip to content
Snippets Groups Projects
Commit a0b6a5a9 authored by Otmane Lahlou's avatar Otmane Lahlou
Browse files

ENH: work for linking QGLImageWidget with the Qt MainWindow

parent 81ec28ec
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,7 @@
#include "mvdMainWindow.h"
#include "ui_mvdMainWindow.h"
//
// System includes (sorted by alphabetic order)
......@@ -55,6 +56,14 @@ MainWindow
addDockWidget( Qt::LeftDockWidgetArea, dock_widget );
*/
// TODO : uncomment to use the otbQGLImageWiget
// glWidget = new otb::QGLImageWidget();
// QHBoxLayout *mainLayout = new QHBoxLayout;
// mainLayout->addWidget(m_QGLWidget);
// setLayout(mainLayout);
// setWindowTitle(tr("OTB QGL Window"));
QObject::connect(
m_UI->action_Quit, SIGNAL( activated() ),
qApp, SLOT( quit() )
......
......@@ -28,6 +28,7 @@
//
// OTB includes (sorted by alphabetic order)
//#include "otbQGLImageWidget.h"
//
// Monteverdi includes (sorted by alphabetic order)
......@@ -39,6 +40,13 @@ namespace Ui
class MainWindow;
}
// namespace otb
// {
// class QGLImageWidget;
// };
namespace mvd
{
/** \class MainWindow
......@@ -59,6 +67,12 @@ public:
/** Destructor */
virtual ~MainWindow();
// /** Method to get the instance*/
// otb::QGLImageWidget* GetGLImageWidget()
// {
// return m_QGLWidget;
// }
//
//
protected:
......@@ -68,6 +82,8 @@ protected:
private:
Ui::MainWindow* m_UI;
//otb::QGLImageWidget * m_QGLWidget;
//
// SLOTS
private slots:
......
/*=========================================================================
Program: Monteverdi2
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "mvdMainWindow.h"
#include "otbQGLImageWidget.h"
#include "otbImageFileReader.h"
int
main( int argc, char* argv[] )
{
mvd::Application application( argc, argv );
// image reader
typedef otb::ImageFileReader<ImageType> ReaderType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(argv[1]);
reader->Update();
ImageType::Pointer image = reader->GetOutput();
RegionType region = image->GetLargestPossibleRegion();
mvd::MainWindow * main_window = new mvd::MainWindow;
main_window->GetGLImageWidget()->SetIsotropicZoom(1);
main_window->GetGLImageWidget()->ReadBuffer(image, region);
main_window->resize( region.GetSize()[0], region.GetSize()[1] );
main_window->show();
return application.exec();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment