LSSTApplications  11.0-13-gbb96280,12.1+18,12.1+7,12.1-1-g14f38d3+72,12.1-1-g16c0db7+5,12.1-1-g5961e7a+84,12.1-1-ge22e12b+23,12.1-11-g06625e2+4,12.1-11-g0d7f63b+4,12.1-19-gd507bfc,12.1-2-g7dda0ab+38,12.1-2-gc0bc6ab+81,12.1-21-g6ffe579+2,12.1-21-gbdb6c2a+4,12.1-24-g941c398+5,12.1-3-g57f6835+7,12.1-3-gf0736f3,12.1-37-g3ddd237,12.1-4-gf46015e+5,12.1-5-g06c326c+20,12.1-5-g648ee80+3,12.1-5-gc2189d7+4,12.1-6-ga608fc0+1,12.1-7-g3349e2a+5,12.1-7-gfd75620+9,12.1-9-g577b946+5,12.1-9-gc4df26a+10
LSSTDataManagementBasePackage
Public Types | Public Member Functions | Private Attributes | 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

typedef det::Footprint::SpanList SpanList
 

Public Member Functions

 RelativeSpanIterator ()
 
 RelativeSpanIterator (SpanList::const_iterator const &real, SpanList const &arr, int cx, int cy, bool forward=true)
 
bool operator== (const SpanList::const_iterator &other)
 
bool operator!= (const SpanList::const_iterator &other)
 
bool operator<= (const SpanList::const_iterator &other)
 
bool operator< (const SpanList::const_iterator &other)
 
bool operator>= (const SpanList::const_iterator &other)
 
bool operator> (const SpanList::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 ()
 

Private Attributes

SpanList::const_iterator _real
 
SpanList::const_iterator _end
 
int _cx
 
int _cy
 
bool _forward
 

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 707 of file Baseline.cc.

Member Typedef Documentation

typedef det::Footprint::SpanList RelativeSpanIterator::SpanList

Definition at line 709 of file Baseline.cc.

Constructor & Destructor Documentation

RelativeSpanIterator::RelativeSpanIterator ( )
inline

Definition at line 711 of file Baseline.cc.

711 {}
RelativeSpanIterator::RelativeSpanIterator ( SpanList::const_iterator const &  real,
SpanList const &  arr,
int  cx,
int  cy,
bool  forward = true 
)
inline

Definition at line 713 of file Baseline.cc.

716  : _real(real), _cx(cx), _cy(cy), _forward(forward)
717  {
718  if (_forward) {
719  _end = arr.end();
720  } else {
721  _end = arr.begin();
722  }
723  }
SpanList::const_iterator _real
Definition: Baseline.cc:803
SpanList::const_iterator _end
Definition: Baseline.cc:804
T real(const T &x)
Definition: Integrate.h:193

Member Function Documentation

int RelativeSpanIterator::dxhi ( )
inline

Definition at line 782 of file Baseline.cc.

782  {
783  if (_forward) {
784  return (*_real)->getX1() - _cx;
785  } else {
786  return _cx - (*_real)->getX0();
787  }
788  }
int RelativeSpanIterator::dxlo ( )
inline

Definition at line 775 of file Baseline.cc.

775  {
776  if (_forward) {
777  return (*_real)->getX0() - _cx;
778  } else {
779  return _cx - (*_real)->getX1();
780  }
781  }
int RelativeSpanIterator::dy ( )
inline

Definition at line 789 of file Baseline.cc.

789  {
790  return std::abs((*_real)->getY() - _cy);
791  }
bool RelativeSpanIterator::notDone ( )
inline

Definition at line 767 of file Baseline.cc.

767  {
768  if (_forward) {
769  return _real < _end;
770  } else {
771  return _real >= _end;
772  }
773  }
SpanList::const_iterator _real
Definition: Baseline.cc:803
SpanList::const_iterator _end
Definition: Baseline.cc:804
bool RelativeSpanIterator::operator!= ( const SpanList::const_iterator &  other)
inline

Definition at line 728 of file Baseline.cc.

728  {
729  return _real != other;
730  }
SpanList::const_iterator _real
Definition: Baseline.cc:803
bool RelativeSpanIterator::operator!= ( RelativeSpanIterator other)
inline

Definition at line 749 of file Baseline.cc.

749  {
750  return !(*this == other);
751  }
RelativeSpanIterator RelativeSpanIterator::operator++ ( )
inline

Definition at line 753 of file Baseline.cc.

753  {
754  if (_forward) {
755  _real++;
756  } else {
757  _real--;
758  }
759  return *this;
760  }
SpanList::const_iterator _real
Definition: Baseline.cc:803
RelativeSpanIterator RelativeSpanIterator::operator++ ( int  dummy)
inline

Definition at line 761 of file Baseline.cc.

761  {
762  RelativeSpanIterator result = *this;
763  ++(*this);
764  return result;
765  }
This is a convenience class used in symmetrizeFootprint, wrapping the idea of iterating through a Spa...
Definition: Baseline.cc:707
bool RelativeSpanIterator::operator< ( const SpanList::const_iterator &  other)
inline

Definition at line 734 of file Baseline.cc.

734  {
735  return _real < other;
736  }
SpanList::const_iterator _real
Definition: Baseline.cc:803
bool RelativeSpanIterator::operator<= ( const SpanList::const_iterator &  other)
inline

Definition at line 731 of file Baseline.cc.

731  {
732  return _real <= other;
733  }
SpanList::const_iterator _real
Definition: Baseline.cc:803
bool RelativeSpanIterator::operator== ( const SpanList::const_iterator &  other)
inline

Definition at line 725 of file Baseline.cc.

725  {
726  return _real == other;
727  }
SpanList::const_iterator _real
Definition: Baseline.cc:803
bool RelativeSpanIterator::operator== ( RelativeSpanIterator other)
inline

Definition at line 744 of file Baseline.cc.

744  {
745  return (_real == other._real) &&
746  (_cx == other._cx) && (_cy == other._cy) &&
747  (_forward == other._forward);
748  }
SpanList::const_iterator _real
Definition: Baseline.cc:803
bool RelativeSpanIterator::operator> ( const SpanList::const_iterator &  other)
inline

Definition at line 740 of file Baseline.cc.

740  {
741  return _real > other;
742  }
SpanList::const_iterator _real
Definition: Baseline.cc:803
bool RelativeSpanIterator::operator>= ( const SpanList::const_iterator &  other)
inline

Definition at line 737 of file Baseline.cc.

737  {
738  return _real >= other;
739  }
SpanList::const_iterator _real
Definition: Baseline.cc:803
int RelativeSpanIterator::x0 ( )
inline

Definition at line 792 of file Baseline.cc.

792  {
793  return (*_real)->getX0();
794  }
int RelativeSpanIterator::x1 ( )
inline

Definition at line 795 of file Baseline.cc.

795  {
796  return (*_real)->getX1();
797  }
int RelativeSpanIterator::y ( )
inline

Definition at line 798 of file Baseline.cc.

798  {
799  return (*_real)->getY();
800  }

Member Data Documentation

int RelativeSpanIterator::_cx
private

Definition at line 805 of file Baseline.cc.

int RelativeSpanIterator::_cy
private

Definition at line 806 of file Baseline.cc.

SpanList::const_iterator RelativeSpanIterator::_end
private

Definition at line 804 of file Baseline.cc.

bool RelativeSpanIterator::_forward
private

Definition at line 807 of file Baseline.cc.

SpanList::const_iterator RelativeSpanIterator::_real
private

Definition at line 803 of file Baseline.cc.


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