lsst.afw  21.0.0-27-g37a8c363b+c8448cd80e
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::geom::Box2I const &region, int xSize, int ySize=0)
 Constructor. More...
 
 SpatialCellSet (SpatialCellSet const &)=default
 
 SpatialCellSet (SpatialCellSet &&)=default
 
SpatialCellSetoperator= (SpatialCellSet const &)=default
 
SpatialCellSetoperator= (SpatialCellSet &&)=default
 
virtual ~SpatialCellSet ()=default
 Destructor. More...
 
CellListgetCellList ()
 Return our SpatialCells. More...
 
lsst::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< SpatialCellCandidategetCandidateById (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::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

Definition at line 303 of file SpatialCell.cc.

◆ 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::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

Definition at line 416 of file SpatialCell.cc.

◆ 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.

Definition at line 361 of file SpatialCell.cc.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ setIgnoreBad()

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

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

Definition at line 433 of file SpatialCell.cc.

◆ sortCandidates()

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

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

Definition at line 374 of file SpatialCell.cc.

◆ 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

Definition at line 399 of file SpatialCell.cc.

◆ 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

Definition at line 407 of file SpatialCell.cc.

◆ 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)

Definition at line 380 of file SpatialCell.cc.

◆ 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

Definition at line 389 of file SpatialCell.cc.


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