[vtkusers] Why does changing poly data not influence the displayed data ?

Oliver Kania ptw.freiburg at googlemail.com
Fri Jul 25 07:16:50 EDT 2008


Hello !
I have a VTK question that has cost me time
and a lot of hair ;)

I am defining poly data, a mapper and an actor.
Now, when I change the underlying poly-Data, the graphical representation
does not change :

vtkPoints* l_pts = vtkPoints::New();

    l_pts->InsertPoint(0,0.0,0.0,-1.0);
    l_pts->InsertPoint(1,0.0,0.0,-1.0);
    l_pts->InsertPoint(2,0.0,0.0,-1.0);
    l_pts->InsertPoint(3,0.0,0.0,-1.0);

    vtkCellArray* l_cells = vtkCellArray::New();

    l_cells->InsertNextCell(4);
    l_cells->InsertCellPoint(0);
    l_cells->InsertCellPoint(1);
    l_cells->InsertCellPoint(2);
    l_cells->InsertCellPoint(3);

    m_polydata->SetPoints(l_pts);
    m_polydata->SetPolys(l_cells);

    CDataSpace* l_space       = l_prop->GetBox().get();
    m_polydata->GetPoints()->SetPoint(0,l_space->x_min,l_space->y_min,-1.0);
    m_polydata->GetPoints()->SetPoint(1,l_space->x_min,l_space->y_max,-1.0);
    m_polydata->GetPoints()->SetPoint(2,l_space->x_max,l_space->y_max,-1.0);
    m_polydata->GetPoints()->SetPoint(3,l_space->x_max,l_space->y_min,-1.0);
    m_polydata->Update();
    m_mapper->Update();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080725/eb0c67c7/attachment.htm>


More information about the vtkusers mailing list