[vtkusers] CountourFilter + RectilinearGrid

Frank Koster koster at iam.uni-bonn.de
Thu Apr 4 12:43:02 EST 2002


Hi,

to learn a little bit about vtk, I modified  the very simple Vol.cxx
example which  initializes
a vtkStructuredPoints   data set   by  setting the origin, the spacings
and  the scalars like

  vtkStructuredPoints *vol = vtkStructuredPoints::New();
      vol->SetDimensions(26,26,26);
      vol->SetOrigin(-0.5,-0.5,-0.5);
      sp = 1.0/25.0;
      vol->SetSpacing(sp, sp, sp);
      vtkScalars *scalars = vtkScalars::New();
           :
      vol->GetPointData()->SetScalars(scalars);
      scalars->Delete();

  Then a contour is extracted and a nice isosurface is drawn on the
screen.

  Now, i just  switched from StructuredPoints to RectilinearGrid, and
left everything else as it was:

  vtkRectilinearGrid *vol = vtkRectilinearGrid::New();
  vtkScalars *xx=vtkScalars::New() ;
  for (i=0; i<26; i++) xx->InsertScalar(i, ((float)i)/25 );
  vol->SetXCoordinates(xx);
  vol->SetYCoordinates(xx);
  vol->SetZCoordinates(xx);
  vtkScalars *scalars = vtkScalars::New();
           :
   vol->GetPointData()->SetScalars(scalars);
    scalars->Delete();

  In this case,  NO ISOSURFACE  was  drawn on the screen.
  Has anybody an idea what went wrong ?

  I suppose i missed something in the initialization of a
RectilinearGrid.

regards
Frank


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020404/7d1f697e/attachment.htm>


More information about the vtkusers mailing list