LSSTApplications  17.0+124,17.0+14,17.0+73,18.0.0+37,18.0.0+80,18.0.0-4-g68ffd23+4,18.1.0-1-g0001055+12,18.1.0-1-g03d53ef+5,18.1.0-1-g1349e88+55,18.1.0-1-g2505f39+44,18.1.0-1-g5315e5e+4,18.1.0-1-g5e4b7ea+14,18.1.0-1-g7e8fceb+4,18.1.0-1-g85f8cd4+48,18.1.0-1-g8ff0b9f+4,18.1.0-1-ga2c679d+1,18.1.0-1-gd55f500+35,18.1.0-10-gb58edde+2,18.1.0-11-g0997b02+4,18.1.0-13-gfe4edf0b+12,18.1.0-14-g259bd21+21,18.1.0-19-gdb69f3f+2,18.1.0-2-g5f9922c+24,18.1.0-2-gd3b74e5+11,18.1.0-2-gfbf3545+32,18.1.0-26-g728bddb4+5,18.1.0-27-g6ff7ca9+2,18.1.0-3-g52aa583+25,18.1.0-3-g8ea57af+9,18.1.0-3-gb69f684+42,18.1.0-3-gfcaddf3+6,18.1.0-32-gd8786685a,18.1.0-4-gf3f9b77+6,18.1.0-5-g1dd662b+2,18.1.0-5-g6dbcb01+41,18.1.0-6-gae77429+3,18.1.0-7-g9d75d83+9,18.1.0-7-gae09a6d+30,18.1.0-9-gc381ef5+4,w.2019.45
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: