lsst.afw  14.0-69-ge506bfb5f
Public Types | Public Member Functions | List of all members
lsst::afw::math::SpatialCellSet Class Reference

A collection of SpatialCells covering an entire image. More...

#include <SpatialCell.h>

Public Types

typedef std::vector< std::shared_ptr< SpatialCell > > CellList
 

Public Member Functions

 SpatialCellSet (lsst::afw::geom::Box2I const &region, int xSize, int ySize=0)
 Constructor. More...
 
 SpatialCellSet (SpatialCellSet const &)=default
 
 SpatialCellSet (SpatialCellSet &&)=default
 
SpatialCellSet & operator= (SpatialCellSet const &)=default
 
SpatialCellSet & operator= (SpatialCellSet &&)=default
 
virtual ~SpatialCellSet ()=default
 Destructor. More...
 
CellList & getCellList ()
 Return our SpatialCells. More...
 
lsst::afw::geom::Box2I getBBox () const
 Return the bounding box of the image. More...
 
void insertCandidate (std::shared_ptr< SpatialCellCandidate > candidate)
 Insert a candidate into the correct cell. More...
 
void sortCandidates ()
 Rearrange the Candidates in all SpatialCells to reflect their current ratings. More...
 
void visitCandidates (CandidateVisitor *visitor, int const nMaxPerCell=-1, bool const ignoreExceptions=false)
 Call the visitor's processCandidate method for each Candidate in the SpatialCellSet. More...
 
void visitCandidates (CandidateVisitor *visitor, int const nMaxPerCell=-1, bool const ignoreExceptions=false) const
 Call the visitor's processCandidate method for each Candidate in the SpatialCellSet (const version) More...
 
void visitAllCandidates (CandidateVisitor *visitor, bool const ignoreExceptions=false)
 Call the visitor's processCandidate method for every Candidate in the SpatialCellSet. More...
 
void visitAllCandidates (CandidateVisitor *visitor, bool const ignoreExceptions=false) const
 Call the visitor's processCandidate method for every Candidate in the SpatialCellSet (const version) More...
 
std::shared_ptr< SpatialCellCandidate > getCandidateById (int id, bool noThrow=false)
 Return the SpatialCellCandidate with the specified id. More...
 
void setIgnoreBad (bool ignoreBad)
 Set whether we should omit BAD candidates from candidate list when traversing. More...
 

Detailed Description

A collection of SpatialCells covering an entire image.

Definition at line 387 of file SpatialCell.h.

Member Typedef Documentation

◆ CellList

Definition at line 389 of file SpatialCell.h.

Constructor & Destructor Documentation

◆ SpatialCellSet() [1/3]

lsst::afw::math::SpatialCellSet::SpatialCellSet ( lsst::afw::geom::Box2I const &  region,
int  xSize,
int  ySize = 0 
)

Constructor.

Parameters
regionBounding box for image
xSizesize of cells in the column direction
ySizesize of cells in the row direction (0: == xSize)
Exceptions
lsst::pex::exceptions::LengthErrorif nx or ny is non-positive

◆ SpatialCellSet() [2/3]

lsst::afw::math::SpatialCellSet::SpatialCellSet ( SpatialCellSet const &  )
default

◆ SpatialCellSet() [3/3]

lsst::afw::math::SpatialCellSet::SpatialCellSet ( SpatialCellSet &&  )
default

◆ ~SpatialCellSet()

virtual lsst::afw::math::SpatialCellSet::~SpatialCellSet ( )
virtualdefault

Destructor.

Member Function Documentation

◆ getBBox()

lsst::afw::geom::Box2I lsst::afw::math::SpatialCellSet::getBBox ( ) const
inline

Return the bounding box of the image.

Definition at line 420 of file SpatialCell.h.

◆ getCandidateById()

std::shared_ptr<SpatialCellCandidate> lsst::afw::math::SpatialCellSet::getCandidateById ( int  id,
bool  noThrow = false 
)

Return the SpatialCellCandidate with the specified id.

Parameters
idThe desired ID
noThrowReturn NULL in case of error
Exceptions
lsst::pex::exceptions::NotFoundErrorif no candidate matches the id (unless noThrow is true, in which case a null pointer is returned

◆ getCellList()

CellList& lsst::afw::math::SpatialCellSet::getCellList ( )
inline

Return our SpatialCells.

Definition at line 415 of file SpatialCell.h.

◆ insertCandidate()

void lsst::afw::math::SpatialCellSet::insertCandidate ( std::shared_ptr< SpatialCellCandidate >  candidate)

Insert a candidate into the correct cell.

◆ operator=() [1/2]

SpatialCellSet& lsst::afw::math::SpatialCellSet::operator= ( SpatialCellSet const &  )
default

◆ operator=() [2/2]

SpatialCellSet& lsst::afw::math::SpatialCellSet::operator= ( SpatialCellSet &&  )
default

◆ setIgnoreBad()

void lsst::afw::math::SpatialCellSet::setIgnoreBad ( bool  ignoreBad)

Set whether we should omit BAD candidates from candidate list when traversing.

◆ sortCandidates()

void lsst::afw::math::SpatialCellSet::sortCandidates ( )

Rearrange the Candidates in all SpatialCells to reflect their current ratings.

◆ visitAllCandidates() [1/2]

void lsst::afw::math::SpatialCellSet::visitAllCandidates ( CandidateVisitor *  visitor,
bool const  ignoreExceptions = false 
)

Call the visitor's processCandidate method for every Candidate in the SpatialCellSet.

Parameters
visitorPass this object to every Candidate
ignoreExceptionsIgnore any exceptions thrown by the processing
See also
visitCandidates

◆ visitAllCandidates() [2/2]

void lsst::afw::math::SpatialCellSet::visitAllCandidates ( CandidateVisitor *  visitor,
bool const  ignoreExceptions = false 
) const

Call the visitor's processCandidate method for every Candidate in the SpatialCellSet (const version)

This is the const version of SpatialCellSet::visitAllCandidates

Parameters
visitorPass this object to every Candidate
ignoreExceptionsIgnore any exceptions thrown by the processing

◆ visitCandidates() [1/2]

void lsst::afw::math::SpatialCellSet::visitCandidates ( CandidateVisitor *  visitor,
int const  nMaxPerCell = -1,
bool const  ignoreExceptions = false 
)

Call the visitor's processCandidate method for each Candidate in the SpatialCellSet.

Parameters
visitorPass this object to every Candidate
nMaxPerCellVisit no more than this many Candidates (<= 0: all)
ignoreExceptionsIgnore any exceptions thrown by the processing
Note
This is obviously similar to the Design Patterns (Go4) Visitor pattern, but we've simplified the double dispatch (i.e. we don't call a virtual method on SpatialCellCandidate that in turn calls processCandidate(*this), but can be re-defined)

◆ visitCandidates() [2/2]

void lsst::afw::math::SpatialCellSet::visitCandidates ( CandidateVisitor *  visitor,
int const  nMaxPerCell = -1,
bool const  ignoreExceptions = false 
) const

Call the visitor's processCandidate method for each Candidate in the SpatialCellSet (const version)

This is the const version of SpatialCellSet::visitCandidates

Parameters
visitorPass this object to every Candidate
nMaxPerCellVisit no more than this many Candidates (-ve: all)
ignoreExceptionsIgnore any exceptions thrown by the processing

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