LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Public Types | Public Member Functions | Private Attributes | List of all members
RelativeSpanIterator Class Reference

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

Member Typedef Documentation

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

Definition at line 712 of file Baseline.cc.

Constructor & Destructor Documentation

RelativeSpanIterator::RelativeSpanIterator ( )
inline

Definition at line 714 of file Baseline.cc.

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

Definition at line 716 of file Baseline.cc.

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

Member Function Documentation

int RelativeSpanIterator::dxhi ( )
inline

Definition at line 785 of file Baseline.cc.

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

Definition at line 778 of file Baseline.cc.

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

Definition at line 792 of file Baseline.cc.

792  {
793  return std::abs((*_real)->getY() - _cy);
794  }
bool RelativeSpanIterator::notDone ( )
inline

Definition at line 770 of file Baseline.cc.

770  {
771  if (_forward) {
772  return _real < _end;
773  } else {
774  return _real >= _end;
775  }
776  }
SpanList::const_iterator _real
Definition: Baseline.cc:806
SpanList::const_iterator _end
Definition: Baseline.cc:807
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:806
bool RelativeSpanIterator::operator!= ( RelativeSpanIterator other)
inline

Definition at line 752 of file Baseline.cc.

752  {
753  return !(*this == other);
754  }
RelativeSpanIterator RelativeSpanIterator::operator++ ( )
inline

Definition at line 756 of file Baseline.cc.

756  {
757  if (_forward) {
758  _real++;
759  } else {
760  _real--;
761  }
762  return *this;
763  }
SpanList::const_iterator _real
Definition: Baseline.cc:806
RelativeSpanIterator RelativeSpanIterator::operator++ ( int  dummy)
inline

Definition at line 764 of file Baseline.cc.

764  {
765  RelativeSpanIterator result = *this;
766  ++(*this);
767  return result;
768  }
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:806
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:806
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:806
bool RelativeSpanIterator::operator== ( RelativeSpanIterator other)
inline

Definition at line 747 of file Baseline.cc.

747  {
748  return (_real == other._real) &&
749  (_cx == other._cx) && (_cy == other._cy) &&
750  (_forward == other._forward);
751  }
SpanList::const_iterator _real
Definition: Baseline.cc:806
bool RelativeSpanIterator::operator> ( const SpanList::const_iterator &  other)
inline

Definition at line 743 of file Baseline.cc.

743  {
744  return _real > other;
745  }
SpanList::const_iterator _real
Definition: Baseline.cc:806
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:806
int RelativeSpanIterator::x0 ( )
inline

Definition at line 795 of file Baseline.cc.

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

Definition at line 798 of file Baseline.cc.

798  {
799  return (*_real)->getX1();
800  }
int RelativeSpanIterator::y ( )
inline

Definition at line 801 of file Baseline.cc.

801  {
802  return (*_real)->getY();
803  }

Member Data Documentation

int RelativeSpanIterator::_cx
private

Definition at line 808 of file Baseline.cc.

int RelativeSpanIterator::_cy
private

Definition at line 809 of file Baseline.cc.

SpanList::const_iterator RelativeSpanIterator::_end
private

Definition at line 807 of file Baseline.cc.

bool RelativeSpanIterator::_forward
private

Definition at line 810 of file Baseline.cc.

SpanList::const_iterator RelativeSpanIterator::_real
private

Definition at line 806 of file Baseline.cc.


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