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

Method GetApproximateLine

Common/DataModel/vtkLagrangeCurve.cxx:35–65  ·  view source on GitHub ↗

\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. */

Source from the content-addressed store, hash-verified

33 * before using it to map connectivity-array offsets.
34 */
35vtkLine* 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
67void vtkLagrangeCurve::InterpolateFunctions(const double pcoords[3], double* weights)
68{

Callers

nothing calls this directly

Calls 11

GetApproxMethod · 0.45
SetNumberOfTuplesMethod · 0.45
PointIndexFromIJKMethod · 0.45
GetPointMethod · 0.45
GetDataMethod · 0.45
SetPointMethod · 0.45
SetIdMethod · 0.45
GetIdMethod · 0.45
SetTupleMethod · 0.45
GetTupleMethod · 0.45

Tested by

no test coverage detected