casa
$Rev:20696$
|
00001 //# WCComplement.h: Make the complement of an image region 00002 //# Copyright (C) 1998,2004 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: WCComplement.h 20615 2009-06-09 02:16:01Z Malte.Marquarding $ 00027 00028 #ifndef IMAGES_WCCOMPLEMENT_H 00029 #define IMAGES_WCCOMPLEMENT_H 00030 00031 //# Includes 00032 #include <images/Regions/WCCompound.h> 00033 00034 00035 namespace casa { //# NAMESPACE CASA - BEGIN 00036 00037 // <summary> 00038 // Make the complement of an image region. 00039 // </summary> 00040 00041 // <use visibility=export> 00042 00043 // <reviewed reviewer="" date="" tests=""> 00044 // </reviewed> 00045 00046 // <prerequisite> 00047 // <li> <linkto class=WCCompound>WCCompound</linkto> 00048 // </prerequisite> 00049 00050 // <synopsis> 00051 // The WCComplement class is a specialization of class 00052 // <linkto class=WCCompound>WCCompound</linkto>. 00053 // It makes it possible to take the complement of the given region 00054 // (which can be a simple WCBox, but also a complex compound region). 00055 // Note that only world coordinate regions can be used in a compound, 00056 // thus an LCSlicer object is not allowed in an intersection. 00057 // <p> 00058 // Note that a region consists of all its masked-on pixels inside the 00059 // bounding box of the region. Thus the complement consists of all 00060 // pixels outside the bounding box and all masked-off pixels inside 00061 // the bounding box. So the complement of the complement of a region 00062 // is the region itself. 00063 // </synopsis> 00064 00065 // <example> 00066 // <srcblock> 00067 // </srcblock> 00068 // </example> 00069 00070 //# <todo asof="1997/11/11"> 00071 //# <li> 00072 //# </todo> 00073 00074 00075 class WCComplement: public WCCompound 00076 { 00077 public: 00078 WCComplement(); 00079 00080 // Construct the complement of the given region. 00081 WCComplement (const ImageRegion& region1); 00082 00083 // Copy constructor (copy semantics). 00084 WCComplement (const WCComplement& other); 00085 00086 virtual ~WCComplement(); 00087 00088 // Assignment (copy semantics). 00089 WCComplement& operator= (const WCComplement& other); 00090 00091 // Comparison 00092 virtual Bool operator== (const WCRegion& other) const; 00093 00094 // Make a copy of the derived object. 00095 // cloneRegion needs to return a WCRegion * because the 00096 // SGI compiler is smart enough to do the right thing. 00097 virtual WCRegion* cloneRegion() const; 00098 00099 // Get the class name (to store in the record). 00100 static String className(); 00101 00102 // Get the region type. Returns className() 00103 virtual String type() const; 00104 00105 // Convert the (derived) object to a record. 00106 virtual TableRecord toRecord (const String& tableName) const; 00107 00108 // Convert correct object from a record. 00109 static WCComplement* fromRecord (const TableRecord&, 00110 const String& tableName); 00111 00112 // Construct from multiple regions. 00113 // When <src>takeOver</src> is True, the destructor will delete the 00114 // given regions. Otherwise a copy of the regions is made. 00115 WCComplement (Bool takeOver, 00116 const PtrBlock<const WCRegion*>& regions); 00117 00118 protected: 00119 // Convert to an LCRegion using the given coordinate system and shape. 00120 // pixelAxesMap(i) gives the pixel axis in cSys of axes <src>i</src> 00121 // in the axesDesc. 00122 virtual LCRegion* doToLCRegion (const CoordinateSystem& cSys, 00123 const IPosition& shape, 00124 const IPosition& pixelAxesMap, 00125 const IPosition& outOrder) const; 00126 }; 00127 00128 00129 00130 } //# NAMESPACE CASA - END 00131 00132 #endif