<p dir="ltr">Hi Steve,</p>
<p dir="ltr">you have to build also the scene graph, which describes the spatial relationship between the objects in your scene. In your case it contains just a cube and the view.</p>
<p dir="ltr">//identity transform<br>
igstk::Transform transform;<br>
transform.SetToIdentity( igstk::TimeStamp::GetLongestPossibleTime() ); </p>
<p dir="ltr">// scene graph<br>
// view3D->cube<br>
cube->RequestSetTransformAndParent( transform, view3D );</p>
<p dir="ltr">Best,<br>
Ozgur</p>
<p dir="ltr">On Fri, Dec 13, 2013 at 10:51 AM, <<a href="mailto:steve.berger@istb.unibe.ch">steve.berger@istb.unibe.ch</a>> wrote:<br>
> Hi,<br>
><br>
> I'm starting to use IGSTK and try to simply display a cube in the QT's main<br>
> windows. My code is very basic and compile, the window pop-up but nothing is<br>
> 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>
> 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>
> }<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 =<br>
> 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>
><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users">http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users</a><br><br></p>
<p dir="ltr">-- <br>
*********************************************************************<br>
Dr. Dipl.-Ing. Özgür Güler, Bakk. techn. PhD<br>
Research Assistant<br>
4D-Visualization Laboratory<br>
Univ. ENT Clinic<br>
Innsbruck Medical University<br>
Anichstr. 35, A-6020 Innsbruck, Austria</p>
<p dir="ltr">tel.: +43 512 504 23428, fax.: +43 512 504 25231</p>
<p dir="ltr"><a href="http://voxelmaster.eu">voxelmaster.eu</a><br>
<a href="http://www.gueler.at">www.gueler.at</a><br>
*********************************************************************<br>
</p>