LSSTApplications  18.0.0+106,18.0.0+50,19.0.0,19.0.0+1,19.0.0+10,19.0.0+11,19.0.0+13,19.0.0+17,19.0.0+2,19.0.0-1-g20d9b18+6,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+6,19.0.0-1-g6fe20d0+1,19.0.0-1-g7011481+9,19.0.0-1-g8c57eb9+6,19.0.0-1-gb5175dc+11,19.0.0-1-gdc0e4a7+9,19.0.0-1-ge272bc4+6,19.0.0-1-ge3aa853,19.0.0-10-g448f008b,19.0.0-12-g6990b2c,19.0.0-2-g0d9f9cd+11,19.0.0-2-g3d9e4fb2+11,19.0.0-2-g5037de4,19.0.0-2-gb96a1c4+3,19.0.0-2-gd955cfd+15,19.0.0-3-g2d13df8,19.0.0-3-g6f3c7dc,19.0.0-4-g725f80e+11,19.0.0-4-ga671dab3b+1,19.0.0-4-gad373c5+3,19.0.0-5-ga2acb9c+2,19.0.0-5-gfe96e6c+2,w.2020.01
LSSTDataManagementBasePackage
Public Types | Public Member Functions | List of all members
RelativeSpanIterator Class Reference

This is a convenience class used in symmetrizeFootprint, wrapping the idea of iterating through a SpanList either forward or backward, and looking at dx,dy coordinates relative to a center cx,cy coordinate. More...

Public Types

using SpanSet = afwGeom::SpanSet
 

Public Member Functions

 RelativeSpanIterator ()
 
 RelativeSpanIterator (SpanSet::const_iterator const &real, SpanSet const &arr, int cx, int cy, bool forward=true)
 
bool operator== (const SpanSet::const_iterator &other)
 
bool operator!= (const SpanSet::const_iterator &other)
 
bool operator<= (const SpanSet::const_iterator &other)
 
bool operator< (const SpanSet::const_iterator &other)
 
bool operator>= (const SpanSet::const_iterator &other)
 
bool operator> (const SpanSet::const_iterator &other)
 
bool operator== (RelativeSpanIterator &other)
 
bool operator!= (RelativeSpanIterator &other)
 
RelativeSpanIterator operator++ ()
 
RelativeSpanIterator operator++ (int dummy)
 
bool notDone ()
 
int dxlo ()
 
int dxhi ()
 
int dy ()
 
int x0 ()
 
int x1 ()
 
int y ()
 

Detailed Description

This is a convenience class used in symmetrizeFootprint, wrapping the idea of iterating through a SpanList either forward or backward, and looking at dx,dy coordinates relative to a center cx,cy coordinate.

This makes the symmetrizeFootprint code much tidier and more symmetric-looking; the operations on the forward and backward iterators are mostly the same.

Definition at line 819 of file BaselineUtils.cc.

Member Typedef Documentation

◆ SpanSet

Definition at line 821 of file BaselineUtils.cc.

Constructor & Destructor Documentation

◆ RelativeSpanIterator() [1/2]

RelativeSpanIterator::RelativeSpanIterator ( )
inline

Definition at line 823 of file BaselineUtils.cc.

823 {}

◆ RelativeSpanIterator() [2/2]

RelativeSpanIterator::RelativeSpanIterator ( SpanSet::const_iterator const &  real,
SpanSet const &  arr,
int  cx,
int  cy,
bool  forward = true 
)
inline

Definition at line 825 of file BaselineUtils.cc.

828  : _real(real), _cx(cx), _cy(cy), _forward(forward)
829  {
830  if (_forward) {
831  _end = arr.end();
832  } else {
833  _end = arr.begin();
834  }
835  }
T real(const T &x)
Definition: Integrate.h:199

Member Function Documentation

◆ dxhi()

int RelativeSpanIterator::dxhi ( )
inline

Definition at line 894 of file BaselineUtils.cc.

894  {
895  if (_forward) {
896  return _real->getX1() - _cx;
897  } else {
898  return _cx - _real->getX0();
899  }
900  }

◆ dxlo()

int RelativeSpanIterator::dxlo ( )
inline

Definition at line 887 of file BaselineUtils.cc.

887  {
888  if (_forward) {
889  return _real->getX0() - _cx;
890  } else {
891  return _cx - _real->getX1();
892  }
893  }

◆ dy()

int RelativeSpanIterator::dy ( )
inline

Definition at line 901 of file BaselineUtils.cc.

901  {
902  return std::abs(_real->getY() - _cy);
903  }
Angle abs(Angle const &a)
Definition: Angle.h:106

◆ notDone()

bool RelativeSpanIterator::notDone ( )
inline

Definition at line 879 of file BaselineUtils.cc.

879  {
880  if (_forward) {
881  return _real < _end;
882  } else {
883  return _real >= _end;
884  }
885  }

◆ operator!=() [1/2]

bool RelativeSpanIterator::operator!= ( const SpanSet::const_iterator other)
inline

Definition at line 840 of file BaselineUtils.cc.

840  {
841  return _real != other;
842  }
ItemVariant const * other
Definition: Schema.cc:56

◆ operator!=() [2/2]

bool RelativeSpanIterator::operator!= ( RelativeSpanIterator other)
inline

Definition at line 861 of file BaselineUtils.cc.

861  {
862  return !(*this == other);
863  }
ItemVariant const * other
Definition: Schema.cc:56

◆ operator++() [1/2]

RelativeSpanIterator RelativeSpanIterator::operator++ ( )
inline

Definition at line 865 of file BaselineUtils.cc.

865  {
866  if (_forward) {
867  _real++;
868  } else {
869  _real--;
870  }
871  return *this;
872  }

◆ operator++() [2/2]

RelativeSpanIterator RelativeSpanIterator::operator++ ( int  dummy)
inline

Definition at line 873 of file BaselineUtils.cc.

873  {
875  ++(*this);
876  return result;
877  }
This is a convenience class used in symmetrizeFootprint, wrapping the idea of iterating through a Spa...
py::object result
Definition: _schema.cc:429

◆ operator<()

bool RelativeSpanIterator::operator< ( const SpanSet::const_iterator other)
inline

Definition at line 846 of file BaselineUtils.cc.

846  {
847  return _real < other;
848  }
ItemVariant const * other
Definition: Schema.cc:56

◆ operator<=()

bool RelativeSpanIterator::operator<= ( const SpanSet::const_iterator other)
inline

Definition at line 843 of file BaselineUtils.cc.

843  {
844  return _real <= other;
845  }
ItemVariant const * other
Definition: Schema.cc:56

◆ operator==() [1/2]

bool RelativeSpanIterator::operator== ( const SpanSet::const_iterator other)
inline

Definition at line 837 of file BaselineUtils.cc.

837  {
838  return _real == other;
839  }
ItemVariant const * other
Definition: Schema.cc:56

◆ operator==() [2/2]

bool RelativeSpanIterator::operator== ( RelativeSpanIterator other)
inline

Definition at line 856 of file BaselineUtils.cc.

856  {
857  return (_real == other._real) &&
858  (_cx == other._cx) && (_cy == other._cy) &&
859  (_forward == other._forward);
860  }

◆ operator>()

bool RelativeSpanIterator::operator> ( const SpanSet::const_iterator other)
inline

Definition at line 852 of file BaselineUtils.cc.

852  {
853  return _real > other;
854  }
ItemVariant const * other
Definition: Schema.cc:56

◆ operator>=()

bool RelativeSpanIterator::operator>= ( const SpanSet::const_iterator other)
inline

Definition at line 849 of file BaselineUtils.cc.

849  {
850  return _real >= other;
851  }
ItemVariant const * other
Definition: Schema.cc:56

◆ x0()

int RelativeSpanIterator::x0 ( )
inline

Definition at line 904 of file BaselineUtils.cc.

904  {
905  return _real->getX0();
906  }

◆ x1()

int RelativeSpanIterator::x1 ( )
inline

Definition at line 907 of file BaselineUtils.cc.

907  {
908  return _real->getX1();
909  }

◆ y()

int RelativeSpanIterator::y ( )
inline

Definition at line 910 of file BaselineUtils.cc.

910  {
911  return _real->getY();
912  }

The documentation for this class was generated from the following file: