Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.atnf.csiro.au/computing/software/casacore/casacore-1.2.0/doc/html/LCEllipsoid_8h_source.html
Дата изменения: Unknown
Дата индексирования: Mon Feb 14 20:59:26 2011
Кодировка:

Поисковые слова: earth's atmosphere
casacore: lattices/Lattices/LCEllipsoid.h Source File

LCEllipsoid.h

Go to the documentation of this file.
00001 //# LCEllipsoid.h: Define an N-dimensional ellipsoidal region of interest
00002 //# Copyright (C) 1997,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: LCEllipsoid.h 18093 2004-11-30 17:51:10Z ddebonis $
00027 
00028 #ifndef LATTICES_LCELLIPSOID_H
00029 #define LATTICES_LCELLIPSOID_H
00030 
00031 //# Includes
00032 #include <lattices/Lattices/LCRegionFixed.h>
00033 #include <casa/Arrays/Vector.h>
00034 
00035 
00036 namespace casa { //# NAMESPACE CASA - BEGIN
00037 
00038 // <summary>
00039 // Define an N-dimensional ellipsoidal region of interest.
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 LCEllipsoid class is a specialization of class
00053 // <linkto class=LCRegion>LCRegion</linkto>.
00054 // It makes it possible to define an N-dimensional ellipsoidal region
00055 // of interest, which includes the border. A separate constructor exists
00056 // to define the special case of an N-dimensional sphere.
00057 // <br>
00058 // The center and the radii of the ellipsoid do not need to be pixel aligned.
00059 // The center of the ellipsoid must be inside the lattice.
00060 // The current implementation only supports ellipsoids with axes parallel
00061 // to the lattice axes.
00062 // <p>
00063 // It can only be used for a lattice of any dimensionality as long as the
00064 // dimensionality of the (hyper-)ellipsoid matches the dimensionality of
00065 // the lattice.
00066 // </synopsis> 
00067 
00068 // <example>
00069 // <srcblock>
00070 // </srcblock>
00071 // </example>
00072 
00073 // <todo asof="1997/11/11">
00074 // <li> Arguments to have ellipsoid axes not parallel to lattice axes.
00075 // </todo>
00076 
00077 
00078 class LCEllipsoid: public LCRegionFixed
00079 {
00080 public:
00081     LCEllipsoid();
00082 
00083     // Construct an N-dimensional sphere with the given center and
00084     // radius (in pixels). The center is pixel-aligned.
00085     LCEllipsoid (const IPosition& center, Float radius,
00086                  const IPosition& latticeShape);
00087 
00088     // Construct an N-dimensional sphere with the given center and
00089     // radius (in pixels). The center does not need to be pixel-aligned.
00090     // <group>
00091     LCEllipsoid (const Vector<Float>& center, Float radius,
00092                  const IPosition& latticeShape);
00093     LCEllipsoid (const Vector<Double>& center, Double radius,
00094                  const IPosition& latticeShape);
00095     // </group>
00096 
00097     // Construct an N-dimensional ellipsoid with the given center and
00098     // radii (in pixels). The center does not need to be pixel-aligned.
00099     // (the radii are half the length of the axes of the ellipsoid).
00100     // <group>
00101     LCEllipsoid (const Vector<Float>& center, const Vector<Float>& radii,
00102                  const IPosition& latticeShape);
00103     LCEllipsoid (const Vector<Double>& center, const Vector<Double>& radii,
00104                  const IPosition& latticeShape);
00105     // </group>
00106 
00107     // Copy constructor (reference semantics).
00108     LCEllipsoid (const LCEllipsoid& other);
00109 
00110     virtual ~LCEllipsoid();
00111 
00112     // Assignment (copy semantics).
00113     LCEllipsoid& operator= (const LCEllipsoid& other);
00114 
00115     // Comparison
00116     virtual Bool operator== (const LCRegion& other) const;
00117 
00118     // Make a copy of the derived object.
00119     virtual LCRegion* cloneRegion() const;
00120 
00121     // Get the center.
00122     const Vector<Float>& center() const;
00123 
00124     // Get the radii.
00125     const Vector<Float>& radii() const;
00126 
00127     // Get the class name (to store in the record).
00128     static String className();
00129 
00130     // Get the region type.  Returns className()
00131     virtual String type() const;
00132 
00133     // Convert the (derived) object to a record.
00134     virtual TableRecord toRecord (const String& tableName) const;
00135 
00136     // Convert correct object from a record.
00137     static LCEllipsoid* fromRecord (const TableRecord&,
00138                                     const String& tableName);
00139 
00140 protected:
00141     // Construct another LCBox (for e.g. another lattice) by moving
00142     // this one. It recalculates the bounding box.
00143     // A positive translation value indicates "to right".
00144     virtual LCRegion* doTranslate (const Vector<Float>& translateVector,
00145                                    const IPosition& newLatticeShape) const;
00146 
00147 private:
00148     // Fill the itsCenter vector from an IPosition.
00149     void fillCenter (const IPosition& center);
00150 
00151     // Make the bounding box from center, radii, and shape.
00152     static Slicer makeBox (const Vector<Float>& center,
00153                            const Vector<Float>& radii,
00154                            const IPosition& latticeShape);
00155 
00156     // Define the mask to indicate which elements are inside the ellipsoid.
00157     void defineMask();
00158 
00159 
00160     Vector<Float> itsCenter;
00161     Vector<Float> itsRadii;
00162 };
00163 
00164 
00165 inline const Vector<Float>& LCEllipsoid::center() const
00166 {
00167     return itsCenter;
00168 }
00169 inline const Vector<Float>& LCEllipsoid::radii() const
00170 {
00171     return itsRadii;
00172 }
00173 
00174 
00175 
00176 } //# NAMESPACE CASA - END
00177 
00178 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines