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

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1