LSSTApplications  16.0-10-g0ee56ad+5,16.0-11-ga33d1f2+5,16.0-12-g3ef5c14+3,16.0-12-g71e5ef5+18,16.0-12-gbdf3636+3,16.0-13-g118c103+3,16.0-13-g8f68b0a+3,16.0-15-gbf5c1cb+4,16.0-16-gfd17674+3,16.0-17-g7c01f5c+3,16.0-18-g0a50484+1,16.0-20-ga20f992+8,16.0-21-g0e05fd4+6,16.0-21-g15e2d33+4,16.0-22-g62d8060+4,16.0-22-g847a80f+4,16.0-25-gf00d9b8+1,16.0-28-g3990c221+4,16.0-3-gf928089+3,16.0-32-g88a4f23+5,16.0-34-gd7987ad+3,16.0-37-gc7333cb+2,16.0-4-g10fc685+2,16.0-4-g18f3627+26,16.0-4-g5f3a788+26,16.0-5-gaf5c3d7+4,16.0-5-gcc1f4bb+1,16.0-6-g3b92700+4,16.0-6-g4412fcd+3,16.0-6-g7235603+4,16.0-69-g2562ce1b+2,16.0-8-g14ebd58+4,16.0-8-g2df868b+1,16.0-8-g4cec79c+6,16.0-8-gadf6c7a+1,16.0-8-gfc7ad86,16.0-82-g59ec2a54a+1,16.0-9-g5400cdc+2,16.0-9-ge6233d7+5,master-g2880f2d8cf+3,v17.0.rc1
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:284
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: