Hi VTK users,<br><br>I'm trying to represent a contour plot from a plane in a Rectilinear grid but i can't. I'm wondering if some of you can help me with this. I'm doing this:<br><br><br> rgrid = new vtkRectilinearGrid();<br>
vtkFloatArray xcoords = new vtkFloatArray();<br> vtkFloatArray ycoords = new vtkFloatArray();<br> vtkFloatArray zcoords = new vtkFloatArray();<br> vtkFloatArray field_data = new vtkFloatArray();<br>
<br><br> read_file(r_file, xcoords); // This function reads from a file and put its content in the xcoords variable<br> read_file(t_file, ycoords);<br> read_file(z_file, zcoords);<br> read_file(field_file, field_data);<br>
<br><br> Nx = xcoords.GetNumberOfTuples();<br> Ny = ycoords.GetNumberOfTuples();<br> Nz = zcoords.GetNumberOfTuples();<br> rgrid.SetDimensions(Nx, Ny, Nz);<br> rgrid.SetXCoordinates(xcoords);<br>
rgrid.SetYCoordinates(ycoords);<br> rgrid.SetZCoordinates(zcoords);<br> rgrid.GetCellData().SetScalars(field_data);<br><br><br><br> vtkRectilinearGridGeometryFilter plane = new vtkRectilinearGridGeometryFilter();<br>
plane.SetInput(rgrid);<br> plane.SetExtent(0, Nx-1, Ny-1, Ny-1, 0, Nz-1);<br> <br><br> vtkRectilinearGridGeometryFilter top = new vtkRectilinearGridGeometryFilter();<br> top.SetInput(rgrid);<br>
top.SetExtent(0, Nx-1, 0, Ny-1, 0, 0); <br><br>//// CONTOUR PLOT ////////////////<br> vtkContourFilter contour = new vtkContourFilter();<br> contour.SetInputConnection(top.GetOutputPort());<br>
contour.ComputeNormalsOn();<br> contour.GenerateValues(32, 0.2, 0.9);<br><br> vtkPolyDataMapper contourMapper = new vtkPolyDataMapper();<br> contourMapper.SetInput(contour.GetOutput());<br>
<br> vtkActor contourActor = new vtkActor();<br> contourActor.SetMapper(contourMapper);<br> //////////////////////////////////<br> ren.AddActor(contourActor);<br><br><br>After that i got nothing but a black screen. <br>
<br>Thank you in advance for your help<br><br>Michel Cancelliere<br><br>