[vtkusers] use QVTKWidget
Jothybasu Selvaraj
jothybasu at gmail.com
Wed May 16 04:35:05 EDT 2012
QVTKWidget provides you a vtkRenderWindow. You add your renderers by
qvtkWidget->GetRenderWindow()-~>AddRenderer(your renderer).
Have a look here
http://www.vtk.org/Wiki/VTK/Examples/Cxx#Qt
Jothy
On Tue, May 15, 2012 at 9:11 PM, Massi <Massinissa.Bandou at usherbrooke.ca>wrote:
> 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.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
--
Jothy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120516/9c78e9a1/attachment.htm>
More information about the vtkusers
mailing list