[vtkusers] How to automatically update render when the input data is changed?
weifeng0715
weifeng0715 at gmail.com
Mon Oct 27 10:51:21 EDT 2014
Dear All,
I have the following program
.h header file:
class SimpleView : public QMainWindow
{
SimpleView();
~SimpleView();
virtual void slotExecute();
vtkSmartPointer<vtkRenderer> m_renderer;
}
.cpp source file:
SimpleView::SimpleView()
{
m_renderer = vtkSmartPointer<vtkRenderer>::New();
this->ui->qvtkWidget->GetRenderWindow()->AddRenderer(m_renderer);
connect(this->ui->actionExecute, SIGNAL(triggered()), this,
SLOT(slotExecute()));
}
void SimpleView::slotExecute()
{
VTK_CREATE(vtkAssembly,stlAssembly);
m_renderer->AddActor(stlAssembly);
m_renderer->AddActor2D(scalarBar);
}
So, slotExecute is triggered whenever I click the actionExecute button.
What I want to do is to update the m_renderer whenever the content of
stlAssembly is changed.
The problem is that m_renderer would add many vtkAssembly files and
scalarbar many times.
--
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-automatically-update-render-when-the-input-data-is-changed-tp5729250.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list