[vtkusers] Why does a change to underlying poly-data not effect thegraphical representation ? (ignore previous messge !)

Vidyadhar vidyadhar at lucidindia.com
Fri Jul 25 07:48:18 EDT 2008


Try m_mapper->Modified()
Vidyadhar
  ----- Original Message ----- 
  From: Oliver Kania 
  To: vtkusers at vtk.org 
  Sent: Friday, July 25, 2008 5:01 PM
  Subject: [vtkusers] Why does a change to underlying poly-data not effect thegraphical representation ? (ignore previous messge !)


  Hello !
  Sorry for posting one more time, please ignore the previous message:

  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();

  ----------------------------------------------------------------------

  The first time I am doing this works, but when i change the points using 
  getPoint()->setPoint(....)  again, nothing happens. 

  regards, Oliver



------------------------------------------------------------------------------


  _______________________________________________
  This is the private VTK discussion list.
  Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
  Follow this link to subscribe/unsubscribe:
  http://www.vtk.org/mailman/listinfo/vtkusers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080725/a00f81f3/attachment.htm>


More information about the vtkusers mailing list