<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi,<br>
<br>
I'm starting to use IGSTK and try to simply display a cube in the QT's main windows. My code is very basic and compile, the window pop-up but nothing is displayed in the windows (it's only gray).<br>
Could anyone give me a clue? I'm puzzled with that from 3 days...<br>
<br>
Bellow are my codes, and the software versions I am using.<br>
<br>
Thanks a lot for your support,<br>
Cheers,<br>
Steve<br>
<br>
<br>
<br>
The main:<br>
<font size="2">int main(int argc, char *argv[])<br>
{<br>
QApplication app(argc,argv);<br>
<br>
MainWindow w;<br>
w.show();<br>
<br>
return app.exec();<br>
}</font><br>
<br>
<br>
<br>
The MainWindow.h:<br>
<br>
#ifndef MAINWINDOW_H<br>
#define MAINWINDOW_H<br>
#include <QtGui><br>
#include "igstkBoxObject.h"<br>
#include "igstkBoxObjectRepresentation.h"<br>
#include "igstkView3D.h"<br>
#include "igstkQTWidget.h"<br>
<br>
class MainWindow : public QMainWindow<br>
{<br>
public:<br>
MainWindow();<br>
<br>
};<br>
#endif<br>
<br>
<br>
<br>
<br>
The MainWindow.cpp<br>
<br>
#include "MainWindow.h"<br>
MainWindow::MainWindow()<br>
{<br>
//initialize the RealTimeClock.<br>
igstk::RealTimeClock::Initialize();<br>
<br>
// Create the box<br>
typedef igstk::BoxObject ObjectType;<br>
typedef igstk::BoxObjectRepresentation ObjectRepresentationType;<br>
ObjectType::Pointer cube = ObjectType::New();<br>
ObjectRepresentationType::Pointer cubeRepresentation = ObjectRepresentationType::New();<br>
cubeRepresentation->SetColor( 0.0, 0.0, 1.0 );<br>
cubeRepresentation->SetOpacity( 1.0 );<br>
cubeRepresentation->RequestSetBoxObject(cube);<br>
<br>
// View 3D<br>
typedef igstk::View3D View3DType;<br>
View3DType::Pointer view3D = View3DType::New();<br>
view3D->RequestResetCamera();<br>
view3D->RequestAddObject( cubeRepresentation );<br>
view3D->SetRefreshRate( 30 );<br>
view3D->RequestStart();<br>
<br>
//QT Widget<br>
igstk::QTWidget * myQTWidget = new igstk::QTWidget();<br>
myQTWidget->RequestSetView( view3D );<br>
setCentralWidget( myQTWidget );<br>
}<br>
<br>
<br>
The software versions:<br>
QT 4.8.5<br>
ITK 4.4.2<br>
VTK 5.10.1<br>
IGSTK 5.2<br>
<br>
During the installation of VTK, I checked<br>
VTK_USE_QT ON <br>
VTK_USE_QTCHARTS ON <br>
VTK_USE_RENDERING ON <br>
<br>
During installation of IGSTK, I checked<br>
IGSTK_USE_Qt ON <br>
DESIRED_QT_VERSION 4 <br>
QT_QMAKE_EXECUTABLE /usr/local/Trolltech/Qt-4.8.5/bin/qmake <br>
<br>
<br>
<br>
Thanks a lot for your help!<br>
Steve<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
</body>
</html>