casa
$Rev:20696$
|
00001 //# LCRegionFixed.h: Abstract base class to define a fixed region 00002 //# Copyright (C) 1998,2000 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 00010 //# This library is distributed in the hope that it will be useful, but WITHOUT 00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be addressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# Charlottesville, VA 22903-2475 USA 00025 //# 00026 //# $Id: LCRegionFixed.h 18093 2004-11-30 17:51:10Z ddebonis $ 00027 00028 #ifndef LATTICES_LCREGIONFIXED_H 00029 #define LATTICES_LCREGIONFIXED_H 00030 00031 //# Includes 00032 #include <lattices/Lattices/LCRegionSingle.h> 00033 #include <lattices/Lattices/ArrayLattice.h> 00034 00035 00036 namespace casa { //# NAMESPACE CASA - BEGIN 00037 00038 // <summary> 00039 // Abstract base class to define a fixed region. 00040 // </summary> 00041 00042 // <use visibility=export> 00043 00044 // <reviewed reviewer="" date="" tests=""> 00045 // </reviewed> 00046 00047 // <prerequisite> 00048 // <li> <linkto class=Slicer>Slicer</linkto> 00049 // </prerequisite> 00050 00051 // <synopsis> 00052 // The LCRegion class is the abstract base class for various types 00053 // of LCRegion's (e.g. LCRegionEllipsoid, LCRegionBox). 00054 // It contains the minimal bounding box of the region and, if needed, 00055 // a mask with the same shape as the bounding box. A mask element 00056 // is true if the element is inside the box. 00057 // <p> 00058 // Each LCRegion object must be able to convert itself to and from a record. 00059 // In that way they can be made persistent (in for example a Table). 00060 // <p> 00061 // The LCRegion can be used in several Lattices and Images classes and 00062 // functions to limit the area to operate on. 00063 // </synopsis> 00064 00065 // <example> 00066 // <srcblock> 00067 // </srcblock> 00068 // </example> 00069 00070 // <motivation> 00071 // The Slicer class is too limited as a region, because it can only 00072 // describe a rectangular region. Specialized classes are needed to 00073 // describe arbitrary regions. They need a base class to combine them. 00074 // </motivation> 00075 00076 //# <todo asof="1997/11/11"> 00077 //# <li> 00078 //# </todo> 00079 00080 class LCRegionFixed : public LCRegionSingle 00081 { 00082 public: 00083 LCRegionFixed(); 00084 00085 // Construct with the lattice shape only. 00086 LCRegionFixed (const IPosition& latticeShape); 00087 00088 // Copy constructor (copy semantics). 00089 LCRegionFixed (const LCRegionFixed& other); 00090 00091 // Destructor 00092 virtual ~LCRegionFixed(); 00093 00094 // Comparison. Mask is not checked. Use the 00095 // LCRegionSingle::masksEqual function as well if 00096 // you want to check the masks 00097 virtual Bool operator== (const LCRegion& other) const; 00098 00099 protected: 00100 // Assignment (copy semantics) is only useful for derived classes. 00101 LCRegionFixed& operator= (const LCRegionFixed& other); 00102 00103 // Set the mask. 00104 void setMask (const Array<Bool>& mask); 00105 00106 private: 00107 ArrayLattice<Bool> itsMask; 00108 }; 00109 00110 00111 00112 } //# NAMESPACE CASA - END 00113 00114 #endif