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

Method MarkParents

Common/DataModel/vtkCellLocator.cxx:817–850  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

815
816//------------------------------------------------------------------------------
817void vtkCellLocator::MarkParents(
818 const vtkSmartPointer<vtkIdList>& parentOctant, int i, int j, int k, int ndivs, int level)
819{
820 int offset, prod, ii;
821 vtkIdType parentIdx;
822
823 for (offset = 0, prod = 1, ii = 0; ii < level - 1; ii++)
824 {
825 offset += prod;
826 prod = prod << 3;
827 }
828
829 while (level > 0)
830 {
831 i = i >> 1;
832 j = j >> 1;
833 k = k >> 1;
834 ndivs = ndivs >> 1;
835 level--;
836
837 parentIdx = offset + i + j * ndivs + k * ndivs * ndivs;
838
839 // if it already matches just return
840 if (parentOctant == this->Tree[parentIdx])
841 {
842 return;
843 }
844
845 this->Tree[parentIdx] = parentOctant;
846
847 prod = prod >> 3;
848 offset -= prod;
849 }
850}
851
852//------------------------------------------------------------------------------
853void vtkCellLocator::GenerateRepresentation(int level, vtkPolyData* pd)

Callers 1

BuildLocatorInternalMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected