[vtkusers] why are points removed randomly?

Burlen burlen at apollo.sr.unh.edu
Thu Apr 20 17:05:10 EDT 2006


Hello,
I have a situation where I'm using the append filter to combine datasets. In  
its output(unstructured grid) the cell information isn't needed for my 
visualization, only the point data, so I attempt to create a new unstructured 
grid and copy only points and points data, using Set/GetPoints &  
Get/AddArray. I show the code below. In the result seemingly random points 
get left out. Please look at this image 
http://quaoar.sr.unh.edu/images/missing_data.png
glyphs correspond to the new copy, the wireframe and surface are from the 
output of append filter. Can anyone see what I'm doing wrong here?


  vtkUnstructuredGrid *appendOut = appendFilter->GetOutput();
  appendOut->Update();
  
  vtkUnstructuredGrid *flatData = vtkUnstructuredGrid::New();
  flatData->SetPoints( appendOut->GetPoints() );
  for ( int i=0; i<this->nComponents; ++i )
  {
    flatData->GetPointData()->AddArray( appendOut->GetPointData()->GetArray( i ) );
  }
  flatData->Update();
  
  vtkUnstructuredGridWriter *usgw = vtkUnstructuredGridWriter::New();
  usgw->SetFileTypeToASCII();
  usgw->SetInput( flatData );
  usgw->SetFileName( "flat_data.vtk" );
  usgw->Write();
  
  vtkUnstructuredGridWriter *usgw = vtkUnstructuredGridWriter::New();
  usgw->SetFileTypeToASCII();
  usgw->SetInput( appendOut );
  usgw->SetFileName( "append_out.vtk" );
  usgw->Write();

  appendFilter->Delete();

-- 

Burlen Loring
Space Science Center
Institute for the Study of Earth, Oceans, and Space
University of New Hampshire
39 College Road, Durham, NH 03824
Phone: 603-862-1140





More information about the vtkusers mailing list