[vtkusers] multiple vtkScalars in one dataset?

christopher moore aeolus at ocean.washington.edu
Tue Sep 19 15:09:47 EDT 2000


Trying to create a dataset (vtkRectilinearGrid) with several vtkScalar
attributes (one for each variable).  Can there be more than one?  Isn't
there a SetScalarsName method somewhere?

I have vtkScalars "tm" (temperature) and "sl" (salinity) ... this code
simply over-writes tm with sl.... ??

  rg->SetDimensions(xAxisDim->size(),yAxisDim->size(),zAxisDim->size());
  rg->GetPointData()->SetScalars(tm);
  rg->GetPointData()->SetScalars(sl);
  rg->SetXCoordinates(xCoords);
  rg->SetYCoordinates(yCoords);
  rg->SetZCoordinates(zCoords);

  vtkRectilinearGridWriter *rw = vtkRectilinearGridWriter::New();
  rw->SetInput(rg);
  rw->SetFileName("sitka.vtk");
  rw->SetFileTypeToASCII();
  rw->Write();

Thanks in advance,

______________________________________________________________
Christopher Moore                             tel 206.526.6779
Research Scientist, Oceanography              fax 206.526.6744
University of Washington/JISAO/NOAA-PMEL
--------------------------------------------------------------






More information about the vtkusers mailing list