[vtkusers] problem changing values in vtkPoints

C. Aaron Cois cacst11+ at pitt.edu
Thu Jul 18 14:06:27 EDT 2002


I am basicaly creating a vtkUnstructuredGrid, populated with cells of vtkLines and a vtkPoints

pGrid->InsertNextCell( lineA->GetCellType(), lineA->GetPointIds() );
    pGrid->InsertNextCell( lineB->GetCellType(), lineB->GetPointIds() );
    pGrid->InsertNextCell( lineC->GetCellType(), lineC->GetPointIds() );
    pGrid->InsertNextCell( lineD->GetCellType(), lineD->GetPointIds() );
    pGrid->InsertNextCell( lineE->GetCellType(), lineE->GetPointIds() );
    pGrid->InsertNextCell( lineF->GetCellType(), lineF->GetPointIds() );
    pGrid->SetPoints(Points);

The points are set by using InsertPoint()

I need to be able to later change the values in the individual points, to shorten and lengthen the lines.  Recreating the actor, grid, mapper, etc, gets very time consuming, so i figured i could just go back through the actor, mapper, grid, and vtkPoints to get each point by using:

float * point_locs;

for(int j = 0;j < points->GetNumberOfPoints();j++)
          {
          point_locs = points->GetPoint(j);

          point_locs[0] *= <adjustment factor>
          point_locs[1] *= <adjustment factor>
          point_locs[2] *= <adjustment factor>

          points->SetPoint(j,point_locs[0],point_locs[1],point_locs[2]);
          }

I am able to retrieve the points find with GetPoint(), but SetPoint does not appear to be changing the values.  Is there any other way to do this without recreating the actor and all of its components?


                                                                                                                                            Aaron Cois
                                                                                                                                   University of Pittsburgh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020718/986b8399/attachment.htm>


More information about the vtkusers mailing list