[vtkusers] CountourFilter + RectilinearGrid

John Biddiscombe jbiddiscombe at skippingmouse.co.uk
Thu Apr 4 16:28:38 EST 2002


I don't see a 
vol->SetDimensions(26,26,26) in there anywhere. 

(I don't use Rectiliear grids much, so it's probably not the answer).

JB


----- Original Message ----- 
From: "Frank Koster" <koster at iam.uni-bonn.de>
To: <vtkusers at public.kitware.com>
Sent: Thursday, April 04, 2002 6:43 PM
Subject: [vtkusers] CountourFilter + RectilinearGrid


> 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
> 
> 
> 




More information about the vtkusers mailing list