LSSTApplications  17.0+11,17.0+34,17.0+56,17.0+57,17.0+59,17.0+7,17.0-1-g377950a+33,17.0.1-1-g114240f+2,17.0.1-1-g4d4fbc4+28,17.0.1-1-g55520dc+49,17.0.1-1-g5f4ed7e+52,17.0.1-1-g6dd7d69+17,17.0.1-1-g8de6c91+11,17.0.1-1-gb9095d2+7,17.0.1-1-ge9fec5e+5,17.0.1-1-gf4e0155+55,17.0.1-1-gfc65f5f+50,17.0.1-1-gfc6fb1f+20,17.0.1-10-g87f9f3f+1,17.0.1-11-ge9de802+16,17.0.1-16-ga14f7d5c+4,17.0.1-17-gc79d625+1,17.0.1-17-gdae4c4a+8,17.0.1-2-g26618f5+29,17.0.1-2-g54f2ebc+9,17.0.1-2-gf403422+1,17.0.1-20-g2ca2f74+6,17.0.1-23-gf3eadeb7+1,17.0.1-3-g7e86b59+39,17.0.1-3-gb5ca14a,17.0.1-3-gd08d533+40,17.0.1-30-g596af8797,17.0.1-4-g59d126d+4,17.0.1-4-gc69c472+5,17.0.1-6-g5afd9b9+4,17.0.1-7-g35889ee+1,17.0.1-7-gc7c8782+18,17.0.1-9-gc4bbfb2+3,w.2019.22
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 817 of file BaselineUtils.cc.

Member Typedef Documentation

◆ SpanSet

Definition at line 819 of file BaselineUtils.cc.

Constructor & Destructor Documentation

◆ RelativeSpanIterator() [1/2]

RelativeSpanIterator::RelativeSpanIterator ( )
inline

Definition at line 821 of file BaselineUtils.cc.

821 {}

◆ RelativeSpanIterator() [2/2]

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

Definition at line 823 of file BaselineUtils.cc.

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

Member Function Documentation

◆ dxhi()

int RelativeSpanIterator::dxhi ( )
inline

Definition at line 892 of file BaselineUtils.cc.

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

◆ dxlo()

int RelativeSpanIterator::dxlo ( )
inline

Definition at line 885 of file BaselineUtils.cc.

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

◆ dy()

int RelativeSpanIterator::dy ( )
inline

Definition at line 899 of file BaselineUtils.cc.

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

◆ notDone()

bool RelativeSpanIterator::notDone ( )
inline

Definition at line 877 of file BaselineUtils.cc.

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

◆ operator!=() [1/2]

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

Definition at line 838 of file BaselineUtils.cc.

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

◆ operator!=() [2/2]

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

Definition at line 859 of file BaselineUtils.cc.

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

◆ operator++() [1/2]

RelativeSpanIterator RelativeSpanIterator::operator++ ( )
inline

Definition at line 863 of file BaselineUtils.cc.

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

◆ operator++() [2/2]

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

Definition at line 871 of file BaselineUtils.cc.

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

◆ operator<()

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

Definition at line 844 of file BaselineUtils.cc.

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

◆ operator<=()

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

Definition at line 841 of file BaselineUtils.cc.

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

◆ operator==() [1/2]

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

Definition at line 835 of file BaselineUtils.cc.

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

◆ operator==() [2/2]

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

Definition at line 854 of file BaselineUtils.cc.

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

◆ operator>()

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

Definition at line 850 of file BaselineUtils.cc.

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

◆ operator>=()

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

Definition at line 847 of file BaselineUtils.cc.

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

◆ x0()

int RelativeSpanIterator::x0 ( )
inline

Definition at line 902 of file BaselineUtils.cc.

902  {
903  return _real->getX0();
904  }

◆ x1()

int RelativeSpanIterator::x1 ( )
inline

Definition at line 905 of file BaselineUtils.cc.

905  {
906  return _real->getX1();
907  }

◆ y()

int RelativeSpanIterator::y ( )
inline

Definition at line 908 of file BaselineUtils.cc.

908  {
909  return _real->getY();
910  }

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