28 #ifndef LATTICES_LCREGION_H
29 #define LATTICES_LCREGION_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/lattices/Lattices/Lattice.h>
34 #include <casacore/casa/Arrays/IPosition.h>
35 #include <casacore/casa/Arrays/Slicer.h>
41 class RecordInterface;
214 const IPosition& newLatticeShape)
const = 0;
218 const String& className)
const;
263 return (!
operator==(other));
virtual Bool operator==(const LCRegion &other) const
Equality
virtual Bool isWritable() const
Usually the lattice (i.e.
LCRegion(const LCRegion &other)
Copy constructor (copy semantics).
void setComment(const String &comment)
static LCRegion * fromRecord(const TableRecord &, const String &tableName)
Convert correct object from a record.
virtual String type() const =0
Region type.
LCRegion * translate(const IPosition &translateVector) const
Construct another LCRegion (for e.g.
void setShapeAndBoundingBox(const IPosition &latticeShape, const Slicer &boundingBox)
void defineRecordFields(RecordInterface &record, const String &className) const
Define the type and class name in the record.
virtual void copyData(const Lattice< Bool > &from)
Copy the data from the given lattice to this one.
LCRegion & operator=(const LCRegion &other)
Assignment (copy semantics) is only useful for derived classes.
const String & comment() const
Get or set the comment.
Slicer expand(const Slicer &slicer) const
Expand a slicer or position in the region to the full lattice.
virtual void apply(Bool(*function)(const Bool &))
virtual uInt ndim() const
Return the dimensionality of the region.
virtual void apply(const Functional< Bool, Bool > &function)
Bool operator!=(const LCRegion &other) const
Non-equality.
virtual void doPutSlice(const Array< Bool > &sourceBuffer, const IPosition &where, const IPosition &stride)
Regions can usually not be put; i.e.
virtual TableRecord toRecord(const String &tableName) const =0
Convert the (derived) object to a record.
virtual void handleRename(const String &newName, Bool overwrite)
Handle renaming the region by renaming possible tables.
const Slicer & boundingBox() const
Give the bounding box.
IPosition expand(const IPosition &index) const
const IPosition & latticeShape() const
Give the full lattice shape.
LCRegion * translate(const IPosition &translateVector, const IPosition &newLatticeShape) const
virtual void apply(Bool(*function)(Bool))
Replace every element, x, of the Lattice with the result of f(x).
LCRegion(const IPosition &latticeShape)
Construct with the lattice shape only.
virtual void handleDelete()
Handle deletion of the region by deleting possible tables.
virtual Lattice< Bool > * clone() const
Make a copy of the derived object.
virtual IPosition shape() const
Return the shape of the region (i.e.
virtual LCRegion * doTranslate(const Vector< Float > &translateVector, const IPosition &newLatticeShape) const =0
Do the actual translate in a derived class.
virtual void set(const Bool &value)
Set all elements in the Lattice to the given value.
void setBoundingBox(const Slicer &boundingBox)
Sometimes it is inconvenient for a derived class to set the bounding box in the constructor.
virtual Bool hasMask() const =0
Does the region have a mask?
virtual void putAt(const Bool &value, const IPosition &where)
Put the value of a single element.
LCRegion * translate(const Vector< Float > &translateVector, const IPosition &newLatticeShape) const
virtual LCRegion * cloneRegion() const =0
String: the storage and methods of handling collections of characters.
this file contains all the compiler specific defines
bool Bool
Define the standard types used by Casacore.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.