This class handles defining, getting and removing such regions.
It is used by class , but it can also
be used by other code to handle regions in other tables.
Another function performed by this class for PagedImage is the
definition of the default region to be used with an image.
Copy constructor (copy semantics).
Assignment (copy semantics).
Make a copy of the object.
Set the object pointer for callback function.
This class can define and handle regions.
Set the default mask to the mask with the given name.
It constructs a ImageRegion object for the new default mask.
If the table is writable, the setting is persistent by writing
the name as a keyword.
If the given maskName is the empty string, the default mask is unset.
Get the name of the default mask.
An empty string is returned if no default mask.
Define a region belonging to the table.
The group type determines if it stored as a region or mask.
If overwrite=False, an exception will be thrown if the region
already exists in the "regions" or "masks" keyword.
Otherwise the region will be removed first.
Does the table have a region with the given name?
Get a region belonging to the table.
A zero pointer is returned if the region does not exist.
The caller has to delete the ImageRegion object created.
Rename a region.
If a region with the new name already exists, it is deleted or
an exception is thrown (depending on overwrite).
The region name is looked up in the given group(s).
Remove a region belonging to the table.
Get the names of all regions/masks.
Make a mask (an LCPagedMask) for a stored lattice (a PagedImage).
It creates it with the shape and tile shape of the lattice.
Find field number of the region group to which a region belongs
(i.e. the field number of the "regions" or "masks" field).
<0 is returned if the region does not exist.
Example
Motivation
This class has 2 purposes:
Member Description
typedef Table& GetCallback (void* objectPtr, Bool writable)
Define the signature of the function being called to get
the table object needed for the region operations.
RegionHandlerTable (GetCallback* callback, void* objectPtr)
RegionHandlerTable (const RegionHandlerTable&)
virtual ~RegionHandlerTable()
RegionHandlerTable& operator= (const RegionHandlerTable&)
virtual RegionHandlerTable* clone() const
virtual void setObjectPtr (void* objectPtr)
virtual Bool canDefineRegion() const
virtual void setDefaultMask (const String& maskName)
virtual String getDefaultMask() const
virtual Bool defineRegion (const String& name, const ImageRegion& region, RegionHandler::GroupType, Bool overwrite = False)
A False status is returned if the table is not writable
virtual Bool hasRegion (const String& name, RegionHandler::GroupType = RegionHandler::Any) const
virtual ImageRegion* getRegion (const String& name, RegionHandler::GroupType = Any, Bool throwIfUnknown = True) const
No exception is thrown if the region does not exist.
virtual Bool renameRegion (const String& newName, const String& oldName, RegionHandler::GroupType = Any, Bool overwrite = False)
An exception is thrown if the old region name does not exist.
virtual Bool removeRegion (const String& name, RegionHandler::GroupType = Any, Bool throwIfUnknown = True)
Optionally an exception is thrown if the region does not exist.
A False status is returned if the table is not writable
virtual Vector<String> regionNames (RegionHandler::GroupType = Any) const
virtual ImageRegion makeMask (const LatticeBase& lattice, const String& name)
Table& rwTable()
Get the table object.
const Table& table() const
virtual Int findRegionGroup (const String& regionName, RegionHandler::GroupType = Any, Bool throwIfUnknown = True) const
Optionally an exception is thrown if the region does not exist.