\brief Prepare point data for use by linear approximating-elements. * * This copies the point data for the current cell into a new point-data * object so that the point ids and scalar ids can match. */
| 316 | * object so that the point ids and scalar ids can match. |
| 317 | */ |
| 318 | void vtkHigherOrderCurve::PrepareApproxData( |
| 319 | vtkPointData* pd, vtkCellData* cd, vtkIdType cellId, vtkDataArray* cellScalars) |
| 320 | { |
| 321 | this->GetApprox(); // Ensure this->Approx{PD,CD} are non-NULL. |
| 322 | this->GetOrder(); // Ensure the order has been updated to match this element. |
| 323 | vtkIdType npts = this->Order[1]; |
| 324 | vtkIdType nele = this->Order[0]; |
| 325 | this->ApproxPD->Initialize(); |
| 326 | this->ApproxCD->Initialize(); |
| 327 | this->ApproxPD->CopyAllOn(); |
| 328 | this->ApproxCD->CopyAllOn(); |
| 329 | this->ApproxPD->CopyAllocate(pd, npts); |
| 330 | this->ApproxCD->CopyAllocate(cd, nele); |
| 331 | for (int pp = 0; pp < npts; ++pp) |
| 332 | { |
| 333 | this->ApproxPD->CopyData(pd, this->PointIds->GetId(pp), pp); |
| 334 | this->CellScalars->SetValue(pp, cellScalars->GetTuple1(pp)); |
| 335 | } |
| 336 | for (int ee = 0; ee < nele; ++ee) |
| 337 | { |
| 338 | this->ApproxCD->CopyData(cd, cellId, ee); |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | /// A convenience method; see the overloaded variant for more information. |
| 343 | bool vtkHigherOrderCurve::SubCellCoordinatesFromId(vtkVector3i& ijk, int subId) |