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

Method NextBin

Common/DataModel/vtkStaticPointLocator2D.cxx:687–722  ·  view source on GitHub ↗

Return the next bin in the iteration sequence over the annulus at the current level.

Source from the content-addressed store, hash-verified

685 // Return the next bin in the iteration sequence over the annulus at the
686 // current level.
687 vtkIdType NextBin(int& i, int& j)
688 {
689 // There is no next bin at level 0
690 if (this->Level <= 0)
691 {
692 i = j = (-1);
693 return (-1);
694 }
695
696 // Begin iteration until a bin on the annulus is discovered. Note that
697 // I,J should have been previously set. However, we need to move to the
698 // next possible bin, meaning incrementing I,J.
699 while (this->J <= this->Max[1])
700 {
701 // Forward increment
702 this->I++;
703 if (this->I > this->Max[0])
704 {
705 this->I = this->Min[0];
706 this->J++;
707 }
708 // Check if on annulus boundary
709 if (this->J <= this->Max[1] &&
710 (this->I == (this->Center[0] + this->Level) || this->I == (this->Center[0] - this->Level) ||
711 this->J == (this->Center[1] + this->Level) || this->J == (this->Center[1] - this->Level)))
712 {
713 i = this->I;
714 j = this->J;
715 return (this->I + this->J * this->Divs[0]);
716 }
717 }
718
719 // Completed traversal
720 i = j = (-1);
721 return (-1); // nothing found
722 }
723
724 // Return true if the bin can be culled: if the bin specified by
725 // (i,j) is completely outside of the annulus request; and completely

Callers 1

FindNPointsInAnnulusMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected