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

Method FoundDonor

Filters/AMR/vtkAMRResampleFilter.cxx:195–216  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

193
194//------------------------------------------------------------------------------
195bool vtkAMRResampleFilter::FoundDonor(double q[3], vtkUniformGrid*& donorGrid, int& cellIdx)
196{
197 assert("pre: donor grid is nullptr" && (donorGrid != nullptr));
198 double gbounds[6];
199 // Lets do a trivial spatial check
200 this->NumberOfBlocksTested++;
201 donorGrid->GetBounds(gbounds);
202 if ((q[0] < gbounds[0]) || (q[0] > gbounds[1]) || (q[1] < gbounds[2]) || (q[1] > gbounds[3]) ||
203 (q[2] < gbounds[4]) || (q[2] > gbounds[5]))
204 {
205 return false;
206 }
207 int ijk[3];
208 double pcoords[3];
209 int status = donorGrid->ComputeStructuredCoordinates(q, ijk, pcoords);
210 if (status == 1)
211 {
212 cellIdx = vtkStructuredData::ComputeCellId(donorGrid->GetDimensions(), ijk);
213 return true;
214 }
215 return false;
216}
217
218//------------------------------------------------------------------------------
219void vtkAMRResampleFilter::InitializeFields(vtkFieldData* f, vtkIdType size, vtkCellData* src)

Callers 1

TransferToCellCentersMethod · 0.95

Calls 4

assertFunction · 0.50
GetBoundsMethod · 0.45
GetDimensionsMethod · 0.45

Tested by

no test coverage detected