MCPcopy Create free account
hub / github.com/Kitware/VTK / InitializeGrid

Method InitializeGrid

Common/DataModel/vtkAMRBox.cxx:730–753  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

728
729//------------------------------------------------------------------------------
730int 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//------------------------------------------------------------------------------
756int vtkAMRBox::InitializeGrid(vtkUniformGrid* grid, double* origin, double* spacing, int nGhostsI,

Callers 1

InitializeFunction · 0.80

Calls 15

ComputeDimensionMethod · 0.95
GetNumberOfNodesMethod · 0.95
GetNumberOfCellsMethod · 0.95
GhostArrayNameFunction · 0.85
FillRegionFunction · 0.85
EmptyMethod · 0.45
InitializeMethod · 0.45
SetDimensionsMethod · 0.45
SetSpacingMethod · 0.45
SetOriginMethod · 0.45
AddArrayMethod · 0.45
GetCellDataMethod · 0.45

Tested by

no test coverage detected