------------------------------------------------------------------------------
| 728 | |
| 729 | //------------------------------------------------------------------------------ |
| 730 | int vtkAMRBox::InitializeGrid(vtkUniformGrid* grid, double* origin, double* spacing) const |
| 731 | { |
| 732 | if (this->Empty()) |
| 733 | { |
| 734 | vtkWarningWithObjectMacro(grid, "Can't construct a data set from an empty box."); |
| 735 | return 0; |
| 736 | } |
| 737 | if (this->ComputeDimension() == 2) |
| 738 | { |
| 739 | // NOTE: define it 3D, with the third dim 0. eg. (X,X,0)(X,X,0) |
| 740 | vtkWarningWithObjectMacro(grid, "Can't construct a 3D data set from a 2D box."); |
| 741 | return 0; |
| 742 | } |
| 743 | |
| 744 | grid->Initialize(); |
| 745 | int nPoints[3]; |
| 746 | this->GetNumberOfNodes(nPoints); |
| 747 | |
| 748 | grid->SetDimensions(nPoints); |
| 749 | grid->SetSpacing(spacing); |
| 750 | grid->SetOrigin(origin); |
| 751 | |
| 752 | return 1; |
| 753 | } |
| 754 | |
| 755 | //------------------------------------------------------------------------------ |
| 756 | int vtkAMRBox::InitializeGrid(vtkUniformGrid* grid, double* origin, double* spacing, int nGhostsI, |
no test coverage detected