\brief Populate the linear segment returned by GetApprox() with point-data from one voxel-like * intervals of this cell. * * Ensure that you have called GetOrder() before calling this method * so that this->Order is up to date. This method does no checking * before using it to map connectivity-array offsets. */
| 33 | * before using it to map connectivity-array offsets. |
| 34 | */ |
| 35 | vtkLine* vtkLagrangeCurve::GetApproximateLine( |
| 36 | int subId, vtkDataArray* scalarsIn, vtkDataArray* scalarsOut) |
| 37 | { |
| 38 | vtkLine* approx = this->GetApprox(); |
| 39 | bool doScalars = (scalarsIn && scalarsOut); |
| 40 | if (doScalars) |
| 41 | { |
| 42 | scalarsOut->SetNumberOfTuples(2); |
| 43 | } |
| 44 | int i; |
| 45 | if (!this->SubCellCoordinatesFromId(i, subId)) |
| 46 | { |
| 47 | vtkErrorMacro("Invalid subId " << subId); |
| 48 | return nullptr; |
| 49 | } |
| 50 | // Get the point ids (and optionally scalars) for each of the 2 corners |
| 51 | // in the approximating line spanned by (i, i+1): |
| 52 | for (vtkIdType ic = 0; ic < 2; ++ic) |
| 53 | { |
| 54 | const vtkIdType corner = this->PointIndexFromIJK(i + ic, 0, 0); |
| 55 | vtkVector3d cp; |
| 56 | this->Points->GetPoint(corner, cp.GetData()); |
| 57 | approx->Points->SetPoint(ic, cp.GetData()); |
| 58 | approx->PointIds->SetId(ic, doScalars ? corner : this->PointIds->GetId(corner)); |
| 59 | if (doScalars) |
| 60 | { |
| 61 | scalarsOut->SetTuple(ic, scalarsIn->GetTuple(corner)); |
| 62 | } |
| 63 | } |
| 64 | return approx; |
| 65 | } |
| 66 | |
| 67 | void vtkLagrangeCurve::InterpolateFunctions(const double pcoords[3], double* weights) |
| 68 | { |
nothing calls this directly
no test coverage detected