[vtkusers] Object not rendered using qvtk on powerpc

clinton at elemtech.com clinton at elemtech.com
Fri Nov 30 12:36:52 EST 2007


Do the examples in VTK/Examples/GUI/Qt not work either?
You can turn the BUILD_EXAMPLES cmake option on to try them.

Clint

>
> Hi everyone,
>
> here i'm trying to build an example on a powerpc using the QVTKWidget
> class. It compiles but when executed nothing can be seen in the
> window. The code is the following:
>
> #include <QApplication>
> #include "QVTKWidget.h"
> //#include <QEvent.h>
>
> #include <vtkConeSource.h>
> #include <vtkPolyDataMapper.h>
> #include <vtkActor.h>
> #include <vtkRenderer.h>
> #include <vtkRenderWindow.h>
>
> int main(int argc, char* argv[]) {
>
>    vtkConeSource *cone = vtkConeSource::New();
>    cone->SetResolution(100);
>    cone->SetRadius(10);
>    cone->SetHeight(7);
>    cone->SetCenter(0,0,0);
>
>    vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New();
>    coneMapper->SetInputConnection(cone->GetOutputPort());
>
>    vtkActor *coneActor = vtkActor::New();
>    coneActor->SetMapper(coneMapper);
>
>    vtkRenderer *coneRen = vtkRenderer::New();
>    coneRen->AddActor(coneActor);
>
>    vtkRenderWindow *coneRenWin = vtkRenderWindow::New();
>    coneRenWin->AddRenderer(coneRen);
>
>    QApplication app(argc, argv);
>    QVTKWidget wdgt;
>
>    wdgt.SetRenderWindow(coneRenWin);
>
> #if QT_VERSION < 0x040000
>    app.setMainWidget(&wdgt);
> #endif
>    wdgt.show();
>
>
>    return app.exec();
> }
>



More information about the vtkusers mailing list