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

Method ProcessStructuredGrid

Filters/General/vtkAxisAlignedReflectionFilter.cxx:475–512  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

473
474//------------------------------------------------------------------------------
475void vtkAxisAlignedReflectionFilter::ProcessStructuredGrid(vtkStructuredGrid* input,
476 vtkStructuredGrid* output, double constant[3], int mirrorDir[3], int mirrorSymmetricTensorDir[6],
477 int mirrorTensorDir[9])
478{
479 output->SetExtent(input->GetExtent());
480
481 vtkIdType numPts = input->GetNumberOfPoints();
482 vtkSmartPointer<vtkPoints> outPoints = vtkSmartPointer<vtkPoints>::New();
483 vtkPointData* inPD = input->GetPointData();
484 vtkPointData* outPD = output->GetPointData();
485
486 outPoints->Allocate(numPts);
487 outPD->CopyAllOn();
488 outPD->CopyAllocate(inPD);
489
490 std::vector<std::pair<vtkIdType, int>> reflectableArrays;
491 vtkReflectionUtilities::FindAllReflectableArrays(
492 reflectableArrays, inPD, this->ReflectAllInputArrays);
493
494 for (vtkIdType i = numPts - 1; i >= 0; i--)
495 {
496 if (this->CheckAbort())
497 {
498 break;
499 }
500
501 double point[3];
502 input->GetPoint(i, point);
503 vtkIdType ptId = outPoints->InsertNextPoint(mirrorDir[0] * point[0] + constant[0],
504 mirrorDir[1] * point[1] + constant[1], mirrorDir[2] * point[2] + constant[2]);
505 outPD->CopyData(inPD, i, ptId);
506
507 vtkReflectionUtilities::ReflectReflectableArrays(reflectableArrays, inPD, outPD, i, mirrorDir,
508 mirrorSymmetricTensorDir, mirrorTensorDir, ptId);
509 }
510
511 output->SetPoints(outPoints);
512}
513
514//------------------------------------------------------------------------------
515void vtkAxisAlignedReflectionFilter::ProcessPolyData(vtkPolyData* input, vtkPolyData* output,

Callers

nothing calls this directly

Calls 13

CheckAbortMethod · 0.80
NewFunction · 0.50
SetExtentMethod · 0.45
GetExtentMethod · 0.45
GetNumberOfPointsMethod · 0.45
GetPointDataMethod · 0.45
AllocateMethod · 0.45
CopyAllOnMethod · 0.45
CopyAllocateMethod · 0.45
GetPointMethod · 0.45
InsertNextPointMethod · 0.45
CopyDataMethod · 0.45

Tested by

no test coverage detected