casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
LCPixelSet.h
Go to the documentation of this file.
00001 //# LCPixelSet.h: Class to define a rectangular set of pixels as a region
00002 //# Copyright (C) 1998,1999
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: LCPixelSet.h 18093 2004-11-30 17:51:10Z ddebonis $
00027 
00028 #ifndef LATTICES_LCPIXELSET_H
00029 #define LATTICES_LCPIXELSET_H
00030 
00031 //# Includes
00032 #include <lattices/Lattices/LCBox.h>
00033 #include <casa/Arrays/Slicer.h>
00034 
00035 
00036 namespace casa { //# NAMESPACE CASA - BEGIN
00037 
00038 // <summary>
00039 // Class to define a rectangular mask as a region
00040 // </summary>
00041 
00042 // <use visibility=export>
00043 
00044 // <reviewed reviewer="" date="" tests="">
00045 // </reviewed>
00046 
00047 // <prerequisite>
00048 //   <li> <linkto class=LCRegion>LCRegion</linkto>
00049 // </prerequisite>
00050 
00051 // <synopsis> 
00052 // The LCPixelSet class is a specialization of class
00053 // <linkto class=LCRegion>LCRegion</linkto>.
00054 // It makes it possible to define a rectangular region of interest.
00055 // </synopsis> 
00056 
00057 // <example>
00058 // <srcblock>
00059 // </srcblock>
00060 // </example>
00061 
00062 // <todo asof="1997/11/11">
00063 // </todo>
00064 
00065 class LCPixelSet: public LCRegionFixed
00066 {
00067 public:
00068     LCPixelSet();
00069 
00070     // Construct from the box defining the position of the mask.
00071     // The shape of the region and mask must be the same.
00072     LCPixelSet (const Array<Bool>& mask, const LCBox& region);
00073 
00074     // Copy constructor (copy semantics).
00075     LCPixelSet (const LCPixelSet& other);
00076 
00077     virtual ~LCPixelSet();
00078 
00079     // Assignment (copy semantics).
00080     LCPixelSet& operator= (const LCPixelSet& other);
00081 
00082     // Comparison
00083     virtual Bool operator== (const LCRegion& other) const;
00084  
00085     // Make a copy of the derived object.
00086     virtual LCRegion* cloneRegion() const;
00087 
00088     // Get the class name (to store in the record).
00089     static String className();
00090 
00091     // Get the region type.  Returns className().
00092     virtual String type() const;
00093 
00094     // Convert the (derived) object to a record.
00095     virtual TableRecord toRecord (const String& tableName) const;
00096 
00097     // Convert correct object from a record.
00098     static LCPixelSet* fromRecord (const TableRecord&,
00099                                    const String& tablename);
00100 
00101 protected:
00102     // Construct another LCPixelSet (for e.g. another lattice) by moving
00103     // this one. It recalculates the bounding mask.
00104     // A positive translation value indicates "to right".
00105     virtual LCRegion* doTranslate (const Vector<Float>& translateVector,
00106                                    const IPosition& newLatticeShape) const;
00107 
00108 private:
00109     LCBox itsBox;
00110 };
00111 
00112 
00113 
00114 } //# NAMESPACE CASA - END
00115 
00116 #endif