casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
LCComplement.h
Go to the documentation of this file.
00001 //# LCComplement.h: Make the complement of a region
00002 //# Copyright (C) 1998
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: LCComplement.h 18093 2004-11-30 17:51:10Z ddebonis $
00027 
00028 #ifndef LATTICES_LCCOMPLEMENT_H
00029 #define LATTICES_LCCOMPLEMENT_H
00030 
00031 //# Includes
00032 #include <lattices/Lattices/LCRegionMulti.h>
00033 
00034 
00035 namespace casa { //# NAMESPACE CASA - BEGIN
00036 
00037 // <summary>
00038 // Make the complement of a region.
00039 // </summary>
00040 
00041 // <use visibility=export>
00042 
00043 // <reviewed reviewer="" date="" tests="">
00044 // </reviewed>
00045 
00046 // <prerequisite>
00047 //   <li> <linkto class=LCRegion>LCRegion</linkto>
00048 // </prerequisite>
00049 
00050 // <synopsis> 
00051 // The LCComplement class is a specialization of class
00052 // <linkto class=LCRegion>LCRegion</linkto>.
00053 // It makes it possible to take the complement of a region with
00054 // respect to a given lattice shape.
00055 // <p>
00056 // The center of the complement must be inside the lattice
00057 // </synopsis> 
00058 
00059 // <example>
00060 // <srcblock>
00061 // </srcblock>
00062 // </example>
00063 
00064 // <todo asof="1997/11/11">
00065 // <li> Expand along (slanted) cone lines
00066 // </todo>
00067 
00068 class LCComplement: public LCRegionMulti
00069 {
00070 public:
00071     LCComplement();
00072 
00073     // Construct the complement of the given region.
00074     LCComplement (const LCRegion& region1);
00075 
00076     // Construct from multiple regions given as a Block.
00077     // When <src>takeOver</src> is True, the destructor will delete the
00078     // given regions. Otherwise a copy of the regions is made.
00079     LCComplement (Bool takeOver, const PtrBlock<const LCRegion*>& regions);
00080 
00081     // Copy constructor (copy semantics).
00082     LCComplement (const LCComplement& other);
00083 
00084     virtual ~LCComplement();
00085 
00086     // Assignment (copy semantics).
00087     LCComplement& operator= (const LCComplement& other);
00088 
00089     // Comparison
00090     virtual Bool operator== (const LCRegion& other) const;
00091  
00092     // Make a copy of the derived object.
00093     virtual LCRegion* cloneRegion() const;
00094 
00095     // Get the class name (to store in the record).
00096     static String className();
00097 
00098     // Get the region type.  Returns className()
00099     virtual String type() const;
00100 
00101     // Convert the (derived) object to a record.
00102     virtual TableRecord toRecord (const String& tableName) const;
00103 
00104     // Convert correct object from a record.
00105     static LCComplement* fromRecord (const TableRecord&,
00106                                      const String& tableName);
00107 
00108 protected:
00109     // Construct another LCRegion (for e.g. another lattice) by moving
00110     // this one. It recalculates the bounding box and mask.
00111     // A positive translation value indicates "to right".
00112     virtual LCRegion* doTranslate (const Vector<Float>& translateVector,
00113                                    const IPosition& newLatticeShape) const;
00114 
00115     // Do the actual getting of the mask.
00116     virtual void multiGetSlice (Array<Bool>& buffer, const Slicer& section);
00117 
00118 private:
00119     // Make the bounding box and determine the offsets.
00120     void defineBox();
00121 };
00122 
00123 
00124 
00125 } //# NAMESPACE CASA - END
00126 
00127 #endif