[vtkusers] vtkVector_vtkScalar?

Berk Geveci berk.geveci at kitware.com
Tue Feb 19 13:52:53 EST 2002


Take a look at
http://public.kitware.com/cgi-bin/vtkfaq?req=show&file=faq06.007.htp
and
http://public.kitware.com/cgi-bin/vtkfaq?req=show&file=faq06.009.htp

-Berk

On Tue, 2002-02-19 at 13:04, Karshi wrote:
> Hi all,
> 
>  I get errors when I run the following code in VTK4.0:
> -----------------------------------------------------------------------
> xspace=0.004
> yspace=0.004
> zspace=0.004
> 
> data = vtkStructuredPoints()
> data.SetDimensions(Nx,Ny,Nz)
> data.SetSpacing(xspace, yspace, zspace)
> vectors =vtkVectors()
> 
> for z in range(Nz):
>     for y in range(Ny):
>         for x in range(Nx):
>             dum = vectors.InsertNextVector(Jx[x,y,z],Jy[x,y,z],Jz[x,y,z])
> data.GetPointData().SetVectors(vectors)
> 
> writer = vtkStructuredPointsWriter()
> writer.SetInput(data)
> 
> J_mag = sqrt(pow(Jx,2)+pow(Jy,2)+pow(Jz,2))
> 
> scalars = vtkScalars()
> 
> for z in range(Nz):
>     for y in range(Ny):
>         for x in range(Nx):
>             dum = scalars.InsertNextScalar(J_mag[x,y,z])
> data.GetPointData().SetScalars(scalars)
> 
> 
> writer = vtkStructuredPointsWriter()
> writer.SetInput(data)
> writer.SetFileName("Anisotropic_Case_Jmag_Jvec.vtk")
> writer.Write()
> ----------------------------------------------------------------------------
> It was working fine in vtk3.2.
> What need to be replaced? 
> Thanks
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers





More information about the vtkusers mailing list