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

Method PrepareApproxData

Common/DataModel/vtkHigherOrderWedge.cxx:961–986  ·  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

959 * object so that the point ids and scalar ids can match.
960 */
961void vtkHigherOrderWedge::PrepareApproxData(
962 vtkPointData* pd, vtkCellData* cd, vtkIdType cellId, vtkDataArray* cellScalars)
963{
964 this->GetApprox(); // Ensure this->Approx{PD,CD} are non-NULL.
965 // this->GetOrder(); // Ensure the order has been updated to match this element.
966 this->SetOrderFromCellData(cd, this->Points->GetNumberOfPoints(), cellId);
967 vtkIdType npts = this->Order[3];
968 vtkIdType nele = this->Order[0] * this->Order[1] * this->Order[2];
969 this->ApproxPD->Initialize();
970 this->ApproxCD->Initialize();
971 this->ApproxPD->CopyAllOn();
972 this->ApproxCD->CopyAllOn();
973 this->ApproxPD->CopyAllocate(pd, npts);
974 this->ApproxCD->CopyAllocate(cd, nele);
975
976 this->CellScalars->SetNumberOfTuples(npts);
977 for (int pp = 0; pp < npts; ++pp)
978 {
979 this->ApproxPD->CopyData(pd, this->PointIds->GetId(pp), pp);
980 this->CellScalars->SetValue(pp, cellScalars->GetTuple1(pp));
981 }
982 for (int ee = 0; ee < nele; ++ee)
983 {
984 this->ApproxCD->CopyData(cd, cellId, ee);
985 }
986}
987
988/**\brief Populate the linear wedge returned by GetApprox() with point-data from one wedge-like
989 * interval of this cell.

Callers 2

ContourMethod · 0.95
ClipMethod · 0.95

Calls 11

GetApproxMethod · 0.95
SetOrderFromCellDataMethod · 0.95
GetTuple1Method · 0.80
GetNumberOfPointsMethod · 0.45
InitializeMethod · 0.45
CopyAllOnMethod · 0.45
CopyAllocateMethod · 0.45
SetNumberOfTuplesMethod · 0.45
CopyDataMethod · 0.45
GetIdMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected