[vtkusers] StruturedGrid and CellData

Didier Roissé didier.roisse at gmail.com
Tue Nov 24 08:17:01 EST 2009


Hello,
I have a structured grid , and I want to put data on the different cells
inside the structured grid. I know how to do for unstructured grid, but for
structured grid I don't know.

For example i define my structured grid like this:
    vtkStructuredGrid *sgrid = vtkStructuredGrid::New();
    sgrid->SetDimensions(x.nbnodes,y.nbnodes,z.nbnodes);
    vtkPoints *points = vtkPoints::New();
    for(int k=0;k<z.nbnodes;k++)
        for(int j=0;j<y.nbnodes;j++)
            for(int i=0;i<x.nbnodes;i++)
                points->InsertNextPoint(x.nodes[i],y.nodes[j],z.nodes[k]);

    sgrid->SetPoints(points);

    vtkCell *cell3D = sgrid->GetCell(10);

cell3D is a vtkHexaedron cell. So my problem is : How can I put a data value
only on one of the quad cell which define cell3D ?

Thanks in advance for your help

Regards,
Didier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091124/af804d3e/attachment.htm>


More information about the vtkusers mailing list