qvtkwidget

QVTKWidget not displaying objects wall's

一曲冷凌霜 提交于 2020-06-26 07:05:12
问题 I'm using the integration Qt-VTK widget (QVTKWidget) and the VTK objects i want to visualize do not display the way they supposed to. I have modified the code of the CylinderRenderingPropertiesExample located on VTKExamples site. The code #include "mainwindow.h" #include "ui_mainwindow.h" #include <vtkCylinderSource.h> #include <vtkPolyDataMapper.h> #include <vtkActor.h> #include <vtkRenderer.h> #include <vtkRenderWindow.h> #include <vtkRenderWindowInteractor.h> #include <vtkProperty.h>

How to subclass vtkActor

不羁岁月 提交于 2019-12-12 14:46:10
问题 I wanted to be able to access my underlaying data structure when I pick a vtkActor . A class derived from vtkActor holding a ptr to my data structure seemed the easiest approach. I get the subclass to compile just fine but the actor does not seem to be added to the renderer. So, here's my class: //.h #include <vtkActor.h> #include <vtkObjectFactory.h> class Node; struct Actor : public vtkActor { static Actor* New(); vtkTypeMacro(Actor, vtkActor) Node* holding_node; }; //.cpp #include "actor.h