LSSTApplications  8.0.0.0+107,8.0.0.1+13,9.1+18,9.2,master-g084aeec0a4,master-g0aced2eed8+6,master-g15627eb03c,master-g28afc54ef9,master-g3391ba5ea0,master-g3d0fb8ae5f,master-g4432ae2e89+36,master-g5c3c32f3ec+17,master-g60f1e072bb+1,master-g6a3ac32d1b,master-g76a88a4307+1,master-g7bce1f4e06+57,master-g8ff4092549+31,master-g98e65bf68e,master-ga6b77976b1+53,master-gae20e2b580+3,master-gb584cd3397+53,master-gc5448b162b+1,master-gc54cf9771d,master-gc69578ece6+1,master-gcbf758c456+22,master-gcec1da163f+63,master-gcf15f11bcc,master-gd167108223,master-gf44c96c709
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 715 of file Baseline.cc.

Member Typedef Documentation

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

Definition at line 717 of file Baseline.cc.

Constructor & Destructor Documentation

RelativeSpanIterator::RelativeSpanIterator ( )
inline

Definition at line 719 of file Baseline.cc.

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

Definition at line 721 of file Baseline.cc.

724  : _real(real), _cx(cx), _cy(cy), _forward(forward)
725  {
726  if (_forward) {
727  _end = arr.end();
728  } else {
729  _end = arr.begin();
730  }
731  }
SpanList::const_iterator _real
Definition: Baseline.cc:811
SpanList::const_iterator _end
Definition: Baseline.cc:812
T real(const T &x)
Definition: Integrate.h:193

Member Function Documentation

int RelativeSpanIterator::dxhi ( )
inline

Definition at line 790 of file Baseline.cc.

790  {
791  if (_forward) {
792  return (*_real)->getX1() - _cx;
793  } else {
794  return _cx - (*_real)->getX0();
795  }
796  }
int RelativeSpanIterator::dxlo ( )
inline

Definition at line 783 of file Baseline.cc.

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

Definition at line 797 of file Baseline.cc.

797  {
798  return std::abs((*_real)->getY() - _cy);
799  }
bool RelativeSpanIterator::notDone ( )
inline

Definition at line 775 of file Baseline.cc.

775  {
776  if (_forward) {
777  return _real < _end;
778  } else {
779  return _real >= _end;
780  }
781  }
SpanList::const_iterator _real
Definition: Baseline.cc:811
SpanList::const_iterator _end
Definition: Baseline.cc:812
bool RelativeSpanIterator::operator!= ( const SpanList::const_iterator &  other)
inline

Definition at line 736 of file Baseline.cc.

736  {
737  return _real != other;
738  }
SpanList::const_iterator _real
Definition: Baseline.cc:811
bool RelativeSpanIterator::operator!= ( RelativeSpanIterator other)
inline

Definition at line 757 of file Baseline.cc.

757  {
758  return !(*this == other);
759  }
RelativeSpanIterator RelativeSpanIterator::operator++ ( )
inline

Definition at line 761 of file Baseline.cc.

761  {
762  if (_forward) {
763  _real++;
764  } else {
765  _real--;
766  }
767  return *this;
768  }
SpanList::const_iterator _real
Definition: Baseline.cc:811
RelativeSpanIterator RelativeSpanIterator::operator++ ( int  dummy)
inline

Definition at line 769 of file Baseline.cc.

769  {
770  RelativeSpanIterator result = *this;
771  ++(*this);
772  return result;
773  }
bool RelativeSpanIterator::operator< ( const SpanList::const_iterator &  other)
inline

Definition at line 742 of file Baseline.cc.

742  {
743  return _real < other;
744  }
SpanList::const_iterator _real
Definition: Baseline.cc:811
bool RelativeSpanIterator::operator<= ( const SpanList::const_iterator &  other)
inline

Definition at line 739 of file Baseline.cc.

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

Definition at line 733 of file Baseline.cc.

733  {
734  return _real == other;
735  }
SpanList::const_iterator _real
Definition: Baseline.cc:811
bool RelativeSpanIterator::operator== ( RelativeSpanIterator other)
inline

Definition at line 752 of file Baseline.cc.

752  {
753  return (_real == other._real) &&
754  (_cx == other._cx) && (_cy == other._cy) &&
755  (_forward == other._forward);
756  }
SpanList::const_iterator _real
Definition: Baseline.cc:811
bool RelativeSpanIterator::operator> ( const SpanList::const_iterator &  other)
inline

Definition at line 748 of file Baseline.cc.

748  {
749  return _real > other;
750  }
SpanList::const_iterator _real
Definition: Baseline.cc:811
bool RelativeSpanIterator::operator>= ( const SpanList::const_iterator &  other)
inline

Definition at line 745 of file Baseline.cc.

745  {
746  return _real >= other;
747  }
SpanList::const_iterator _real
Definition: Baseline.cc:811
int RelativeSpanIterator::x0 ( )
inline

Definition at line 800 of file Baseline.cc.

800  {
801  return (*_real)->getX0();
802  }
int RelativeSpanIterator::x1 ( )
inline

Definition at line 803 of file Baseline.cc.

803  {
804  return (*_real)->getX1();
805  }
int RelativeSpanIterator::y ( )
inline

Definition at line 806 of file Baseline.cc.

806  {
807  return (*_real)->getY();
808  }

Member Data Documentation

int RelativeSpanIterator::_cx
private

Definition at line 813 of file Baseline.cc.

int RelativeSpanIterator::_cy
private

Definition at line 814 of file Baseline.cc.

SpanList::const_iterator RelativeSpanIterator::_end
private

Definition at line 812 of file Baseline.cc.

bool RelativeSpanIterator::_forward
private

Definition at line 815 of file Baseline.cc.

SpanList::const_iterator RelativeSpanIterator::_real
private

Definition at line 811 of file Baseline.cc.


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