------------------------------------------------------------------------------
| 283 | |
| 284 | //------------------------------------------------------------------------------ |
| 285 | void vtkAMRResampleFilter::ComputeCellCentroid(vtkUniformGrid* g, vtkIdType cellIdx, double c[3]) |
| 286 | { |
| 287 | assert("pre: uniform grid is nullptr" && (g != nullptr)); |
| 288 | assert("pre: centroid is nullptr" && (c != nullptr)); |
| 289 | assert("pre: cell index out-of-bounds" && (cellIdx >= 0) && (cellIdx < g->GetNumberOfCells())); |
| 290 | |
| 291 | vtkCell* myCell = g->GetCell(cellIdx); |
| 292 | assert("post: cell is nullptr!" && (myCell != nullptr)); |
| 293 | |
| 294 | double pc[3]; // the parametric center |
| 295 | double* weights = new double[myCell->GetNumberOfPoints()]; |
| 296 | assert("post: weights vector is nullptr" && (weights != nullptr)); |
| 297 | |
| 298 | int subId = myCell->GetParametricCenter(pc); |
| 299 | myCell->EvaluateLocation(subId, pc, c, weights); |
| 300 | delete[] weights; |
| 301 | } |
| 302 | |
| 303 | //------------------------------------------------------------------------------ |
| 304 | void vtkAMRResampleFilter::TransferToCellCenters(vtkUniformGrid* g, vtkOverlappingAMR* amrds) |
no test coverage detected