#include <LCRegion.h>
Inheritance diagram for casa::LCRegion:


Part of API
The LCRegion class is the abstract base class for various types of LCRegion's (e.g. LCEllipsoid , LCBox ). It contains the minimal bounding box of the region and, if needed, a mask with the same shape as the bounding box. A mask element is true if the element is inside the box.
Each LCRegion object must be able to convert itself to and from a record. In that way they can be made persistent (in for example a Table).
The LCRegion can be used in several Lattices and Images classes and functions to limit the area to operate on.
The Slicer class is too limited as a region, because it can only describe a rectangular region. Specialized classes are needed to describe arbitrary regions. They need a base class to combine them.
Definition at line 86 of file LCRegion.h.
Public Member Functions | |
| LCRegion () | |
| LCRegion (const IPosition &latticeShape) | |
| Construct with the lattice shape only. | |
| LCRegion (const LCRegion &other) | |
| Copy constructor (copy semantics). | |
| virtual | ~LCRegion () |
| virtual Bool | operator== (const LCRegion &other) const |
| Equality. | |
| Bool | operator!= (const LCRegion &other) const |
| Watch out ! You must not, in the derived class structure, invoke LCRegion::operator!= If you do, you will be stuck in a time warp, as this will just fetch the operator== of the concrete class and you start all over again. | |
| virtual void | handleDelete () |
| Handle deletion of the region by deleting possible tables. | |
| virtual void | handleRename (const String &newName, Bool overwrite) |
| Handle renaming the region by renaming possible tables. | |
| virtual String | type () const=0 |
| Region type. | |
| virtual Bool | hasMask () const=0 |
| Does the region have a mask? | |
| const IPosition & | latticeShape () const |
| Give the full lattice shape. | |
| const Slicer & | boundingBox () const |
| Give the bounding box. | |
| virtual TableRecord | toRecord (const String &tableName) const =0 |
| Convert the (derived) object to a record. | |
| virtual uInt | ndim () const |
| Return the dimensionality of the region. | |
| virtual IPosition | shape () const |
| Return the shape of the region (i.e. | |
| virtual Bool | isWritable () const |
| Usually the lattice (i.e. | |
| virtual Lattice< Bool > * | clone () const |
| Make a copy of the derived object. | |
| virtual LCRegion * | cloneRegion () const=0 |
| const String & | comment () const |
| Get or set the comment. | |
| void | setComment (const String &comment) |
| LCRegion * | translate (const IPosition &translateVector) const |
| Construct another LCRegion (for e.g. | |
| LCRegion * | translate (const IPosition &translateVector, const IPosition &newLatticeShape) const |
| LCRegion * | translate (const Vector< Float > &translateVector) const |
| LCRegion * | translate (const Vector< Float > &translateVector, const IPosition &newLatticeShape) const |
| Slicer | expand (const Slicer &slicer) const |
| Expand a slicer or position in the region to the full lattice. | |
| IPosition | expand (const IPosition &index) const |
| virtual void | doPutSlice (const Array< Bool > &sourceBuffer, const IPosition &where, const IPosition &stride) |
| Regions can usually not be put; i.e. | |
| virtual void | set (const Bool &value) |
| virtual void | apply (Bool(*function)(Bool)) |
| virtual void | apply (Bool(*function)(const Bool &)) |
| virtual void | apply (const Functional< Bool, Bool > &function) |
| virtual void | putAt (const Bool &value, const IPosition &where) |
| virtual void | copyData (const Lattice< Bool > &from) |
Static Public Member Functions | |
| static LCRegion * | fromRecord (const TableRecord &, const String &tableName) |
| Convert correct object from a record. | |
Protected Member Functions | |
| LCRegion & | operator= (const LCRegion &other) |
| Assignment (copy semantics) is only useful for derived classes. | |
| virtual LCRegion * | doTranslate (const Vector< Float > &translateVector, const IPosition &newLatticeShape) const =0 |
| Do the actual translate in a derived class. | |
| void | defineRecordFields (RecordInterface &record, const String &className) const |
| Define the type and class name in the record. | |
| void | setBoundingBox (const Slicer &boundingBox) |
| Sometimes it is inconvenient for a derived class to set the bounding box in the constructor. | |
| void | setShapeAndBoundingBox (const IPosition &latticeShape, const Slicer &boundingBox) |
Private Attributes | |
| IPosition | itsShape |
| Slicer | itsBoundingBox |
| String | itsComment |
| casa::LCRegion::LCRegion | ( | ) |
| casa::LCRegion::LCRegion | ( | const IPosition & | latticeShape | ) |
Construct with the lattice shape only.
| casa::LCRegion::LCRegion | ( | const LCRegion & | other | ) |
Copy constructor (copy semantics).
| virtual casa::LCRegion::~LCRegion | ( | ) | [virtual] |
Watch out ! You must not, in the derived class structure, invoke LCRegion::operator!= If you do, you will be stuck in a time warp, as this will just fetch the operator== of the concrete class and you start all over again.
Be careful, do not use this anywhere in the derived class structure. You must use, e.g., if (! LCRegion::operator== (.\..)) rather than if (LCRegion::operator!= (.\..)) as the latter will invoke an infinite loop. It is ok to use when applying to a concrete class object.
Definition at line 252 of file LCRegion.h.
| virtual LCRegion* casa::LCRegion::cloneRegion | ( | ) | const [pure virtual] |
| virtual void casa::LCRegion::handleDelete | ( | ) | [virtual] |
Handle deletion of the region by deleting possible tables.
The default implementation does nothing.
Handle renaming the region by renaming possible tables.
The default implementation does nothing.
| virtual String casa::LCRegion::type | ( | ) | const [pure virtual] |
Region type.
Returns className() of derived class.
| const String & casa::LCRegion::comment | ( | ) | const [inline] |
Get or set the comment.
Definition at line 243 of file LCRegion.h.
References itsComment.
Referenced by setComment().
| void casa::LCRegion::setComment | ( | const String & | comment | ) | [inline] |
| virtual Bool casa::LCRegion::hasMask | ( | ) | const [pure virtual] |
Does the region have a mask?
Construct another LCRegion (for e.g.
another lattice) by moving this one. It recalculates the bounding box and mask. A positive translation value indicates "to right".
Definition at line 234 of file LCRegion.h.
References itsShape.
Referenced by translate().
| LCRegion* casa::LCRegion::translate | ( | const IPosition & | translateVector, | |
| const IPosition & | newLatticeShape | |||
| ) | const |
| LCRegion* casa::LCRegion::translate | ( | const Vector< Float > & | translateVector, | |
| const IPosition & | newLatticeShape | |||
| ) | const |
| const IPosition & casa::LCRegion::latticeShape | ( | ) | const [inline] |
| const Slicer & casa::LCRegion::boundingBox | ( | ) | const [inline] |
Expand a slicer or position in the region to the full lattice.
This converts the positions in the region to positions in the entire lattice.
| virtual TableRecord casa::LCRegion::toRecord | ( | const String & | tableName | ) | const [pure virtual] |
Convert the (derived) object to a record.
The record can be used to make the object persistent. The tableName argument can be used by derived classes (e.g. LCPagedMask) to put very large objects.
| static LCRegion* casa::LCRegion::fromRecord | ( | const TableRecord & | , | |
| const String & | tableName | |||
| ) | [static] |
Convert correct object from a record.
| virtual uInt casa::LCRegion::ndim | ( | ) | const [virtual] |
| virtual IPosition casa::LCRegion::shape | ( | ) | const [virtual] |
| virtual Bool casa::LCRegion::isWritable | ( | ) | const [virtual] |
| virtual void casa::LCRegion::doPutSlice | ( | const Array< Bool > & | sourceBuffer, | |
| const IPosition & | where, | |||
| const IPosition & | stride | |||
| ) | [virtual] |
Regions can usually not be put; i.e.
no putSlice, etc. can be done on their masks. Hence LCRegion throws by default an exception for the following functions.
| virtual void casa::LCRegion::set | ( | const Bool & | value | ) | [virtual] |
| virtual void casa::LCRegion::apply | ( | const Functional< Bool, Bool > & | function | ) | [virtual] |
Assignment (copy semantics) is only useful for derived classes.
| void casa::LCRegion::setBoundingBox | ( | const Slicer & | boundingBox | ) | [protected] |
Sometimes it is inconvenient for a derived class to set the bounding box in the constructor.
So it can be set explicitly. It fills in the possibly undefined Slicer values. It may even be needed to set the lattice shape.
| void casa::LCRegion::setShapeAndBoundingBox | ( | const IPosition & | latticeShape, | |
| const Slicer & | boundingBox | |||
| ) | [protected] |
| virtual LCRegion* casa::LCRegion::doTranslate | ( | const Vector< Float > & | translateVector, | |
| const IPosition & | newLatticeShape | |||
| ) | const [protected, pure virtual] |
Do the actual translate in a derived class.
\.
| void casa::LCRegion::defineRecordFields | ( | RecordInterface & | record, | |
| const String & | className | |||
| ) | const [protected] |
Define the type and class name in the record.
IPosition casa::LCRegion::itsShape [private] |
Slicer casa::LCRegion::itsBoundingBox [private] |
String casa::LCRegion::itsComment [private] |
1.5.1