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

Method PrepareApproxData

Common/DataModel/vtkHigherOrderCurve.cxx:318–340  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

316 * object so that the point ids and scalar ids can match.
317 */
318void 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.
343bool vtkHigherOrderCurve::SubCellCoordinatesFromId(vtkVector3i& ijk, int subId)

Callers 2

ContourMethod · 0.95
ClipMethod · 0.95

Calls 9

GetApproxMethod · 0.95
GetOrderMethod · 0.95
GetTuple1Method · 0.80
InitializeMethod · 0.45
CopyAllOnMethod · 0.45
CopyAllocateMethod · 0.45
CopyDataMethod · 0.45
GetIdMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected