[vtkusers] building structed grid data sets

Jesse Neri neri at hobbes.nrl.navy.mil
Fri May 24 16:53:31 EDT 2002


Working in Win 2K and MSDEV 6

I am contructing a StructuredGrid data object. The points for the
geometry seem to set OK, but getting the data at the points is
now not working. This used to work on 3.2, and I tried to follow the example
in
finance.cxx example:

   vtkStructuredGrid *dataset2 = vtkStructuredGrid::New();
   vtkPoints *newPts2 = vtkPoints::New();
   vtkFloatArray *newScalars2 = vtkFloatArray::New();
   newScalars2->SetNumberOfComponents(1);

...  set dimensions of dataset2, fill in values for newPts2 and newScalars2
...  then

   dataset2->SetPoints(newPts2);
   dataset2->GetPointData()->SetScalars(newScalars2);

last line fails with

error C2664: 'SetScalars' : cannot convert parameter 1 from 'class
vtkFloatArray *' to 'class tkScalars *'
        Types pointed to are unrelated; conversion requires
reinterpret_cast, C-style cast or function-style cast



--
Jess Neri   neri at hobbes.nrl.navy.mil   (202) 404-4365
Pulsed Power Physics Branch, Plasma Physics Division
Naval Research Laboratory, Washington DC   20375





More information about the vtkusers mailing list