casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
AnnSymbol.h
Go to the documentation of this file.
00001 //# Copyright (C) 1998,1999,2000,2001
00002 //# Associated Universities, Inc. Washington DC, USA.
00003 //#
00004 //# This library is free software; you can redistribute it and/or modify it
00005 //# under the terms of the GNU Library General Public License as published by
00006 //# the Free Software Foundation; either version 2 of the License, or (at your
00007 //# option) any later version.
00008 //#
00009 //# This library is distributed in the hope that it will be useful, but WITHOUT
00010 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012 //# License for more details.
00013 //#
00014 //# You should have received a copy of the GNU Library General Public License
00015 //# along with this library; if not, write to the Free Software Foundation,
00016 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00017 //#
00018 //# Correspondence concerning AIPS++ should be addressed as follows:
00019 //#        Internet email: aips2-request@nrao.edu.
00020 //#        Postal address: AIPS++ Project Office
00021 //#                        National Radio Astronomy Observatory
00022 //#                        520 Edgemont Road
00023 //#                        Charlottesville, VA 22903-2475 USA
00024 //#
00025 
00026 #ifndef ANNOTATIONS_ANNSYMBOL_H
00027 #define ANNOTATIONS_ANNSYMBOL_H
00028 
00029 #include <imageanalysis/Annotations/AnnotationBase.h>
00030 
00031 #include <measures/Measures/MDirection.h>
00032 
00033 namespace casa {
00034 
00035 // <summary>Represents a symbol annotation</summary>
00036 
00037 // <use visibility=export>
00038 
00039 // <reviewed reviewer="" date="yyyy/mm/dd">
00040 // </reviewed>
00041 
00042 // <synopsis>
00043 
00044 // Represents an ascii symbol annotation
00045 // </synopsis>
00046 
00047 class AnnSymbol: public AnnotationBase {
00048 public:
00049 
00050         // allowed symbols
00051         enum Symbol {
00052                 POINT,
00053                 PIXEL,
00054                 CIRCLE,
00055                 TRIANGLE_DOWN,
00056                 TRIANGLE_UP,
00057                 TRIANGLE_LEFT,
00058                 TRIANGLE_RIGHT,
00059                 TRI_DOWN,
00060                 TRI_UP,
00061                 TRI_LEFT,
00062                 TRI_RIGHT,
00063                 SQUARE,
00064                 PENTAGON,
00065                 STAR,
00066                 HEXAGON1,
00067                 HEXAGON2,
00068                 PLUS,
00069                 X,
00070                 DIAMOND,
00071                 THIN_DIAMOND,
00072                 VLINE,
00073                 HLINE,
00074                 UNKNOWN
00075         };
00076 
00077         AnnSymbol(
00078                 const Quantity& x, const Quantity& y,
00079                 const String& dirRefFrameString,
00080                 const CoordinateSystem& csys,
00081                 const Char symbolChar,
00082                 const Quantity& beginFreq,
00083                 const Quantity& endFreq,
00084                 const String& freqRefFrame,
00085                 const String& dopplerString,
00086                 const Quantity& restfreq,
00087                 const Vector<Stokes::StokesTypes>& stokes
00088         );
00089 
00090         AnnSymbol(
00091                 const Quantity& x, const Quantity& y,
00092                 const CoordinateSystem& csys,
00093                 const Symbol symbol,
00094                 const Vector<Stokes::StokesTypes>& stokes
00095         );
00096 
00097         // implicit copy constructor and destructor are fine
00098 
00099         AnnSymbol& operator=(const AnnSymbol& other);
00100 
00101         MDirection getDirection() const;
00102 
00103         Symbol getSymbol() const;
00104 
00105         static Symbol charToSymbol(const Char c);
00106 
00107         static Char symbolToChar(const Symbol s);
00108 
00109         virtual ostream& print(ostream &os) const;
00110 
00111 private:
00112         AnnotationBase::Direction _inputDirection;
00113         Symbol _symbol;
00114         Char _symbolChar;
00115         const static String _class;
00116         static map<Char, Symbol> _symbolMap;
00117 
00118         static void _initMap();
00119 
00120         void _init(const Quantity& x, const Quantity& y);
00121 
00122 };
00123 
00124 
00125 
00126 }
00127 
00128 #endif