[vtkusers] use QVTKWidget

Massi Massinissa.Bandou at USherbrooke.ca
Tue May 15 16:11:59 EDT 2012


Hi
I'm new on Qt and I want to display a JPEG image on my Qt interface. I know
I have to use QVTKWidget but I have no idea how it works? Here is a basic
code for reading a jpeg: 

#include "CoregistrationForm.h"

int main(int argc, char *argv[]) 
{
      QApplication app(argc, argv);
      vtkJPEGReader *jpegReader = vtkJPEGReader::New();
     
jpegReader->SetFileName("/Users/Massi/Desktop/bin_myProject/Release/test.jpg");
      jpegReader->Update();

      vtkImageMapper *imageMapper =vtkImageMapper::New();
      imageMapper->SetInput(jpegReader->GetOutput());
      imageMapper->GetInput();
    
      vtkImageActor *mapActor= vtkImageActor::New();
      mapActor->SetInput(imageMapper->GetInput());
      vtkRenderer *ren=vtkRenderer::New();
      ren->AddActor(mapActor);
      ren->ResetCamera();
      ren->GetRenderWindow()->Render();

      QVTKWidget *vtkWidget;
      .....
      ....????
     
}

my CoregistrationForm.h contains

class CoregistrationForm : public QDialog {
    Q_OBJECT
public:
    CoregistrationForm();
    virtual ~CoregistrationForm();
public slots:
    
public:
    Ui::CoregistrationForm widget;
};

Massi


--
View this message in context: http://vtk.1045678.n5.nabble.com/use-QVTKWidget-tp5710369.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list