Rgrid and sgrid in VTK

Source: Internet
Author: User
Start to learn VTK. structuredgrid and rectilineargrid in VTK are different!

Rectilineargrid is set as follows:

Vtkrectilineargrid * rgrid = vtkrectilineargrid: New ();
Rgrid-> setdimensions (47,33, 44 );
Rgrid-> setxcoordinates (xcoords );
Rgrid-> setycoordinates (ycoords );
Rgrid-> setzcoordinates (zcoords );

// Extract a plane from the grid to see what we 've got.
Vtkrectilineargridgeometryfilter * plane = vtkrectilineargridgeometryfilter: New ();
Plane-> setinput (rgrid );
Plane-> setextent (, 16, 16 );

Vtkpolydatamapper * rgridmapper = vtkpolydatamapper: New ();
Rgridmapper-> setinputconnection (plane-> getoutputport ());

In rgrid, coordinates are a matrix. The data is set to transmit the X, Y, and zcoordinates to rgid respectively.

The structuredgrid setting method is as follows:
Sgrid-> setpoints (points );
Points-> Delete ();
Sgrid-> getpointdata ()-> setvectors (vectors );
Vectors-> Delete ();

Vtkpolydatamapper * sgridmapper = vtkpolydatamapper: New ();
Sgridmapper-> setinputconnection (Hedgehog-> getoutputport ());
Vtkactor * sgridactor = vtkactor: New ();
Sgridactor-> setmapper (sgridmapper );

Sgrid is different. Although coordinates need to be stored, they are saved one by one.
The difference is like this.

The specific problem is not clear yet.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.