casa
$Rev:20696$
|
00001 //# AsciiRegionLine.h 00002 //# Copyright (C) 1998,1999,2000,2001 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 00027 00028 #ifndef IMAGES_ASCIIANNOTATIONFILELINE_H 00029 #define IMAGES_ASCIIANNOTATIONFILELINE_H 00030 00031 #include <casa/aips.h> 00032 #include <imageanalysis/Annotations/AnnotationBase.h> 00033 #include <measures/Measures/Stokes.h> 00034 00035 namespace casa { 00036 00037 // <summary> 00038 // Represents a line in an ascii region file 00039 // </summary> 00040 // <author>Dave Mehringer</author> 00041 // <use visibility=export> 00042 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos=""> 00043 // </reviewed> 00044 // <prerequisite> 00045 00046 // </prerequisite> 00047 00048 // <etymology> 00049 // Represents a line in an ascii region file 00050 // </etymology> 00051 00052 // <synopsis> 00053 // Represents a line in an ascii region file 00054 // See the region file format proposal attached to CAS-2285 (https://bugs.nrao.edu/browse/CAS-2285) 00055 // </synopsis> 00056 00057 class AsciiAnnotationFileLine { 00058 00059 public: 00060 00061 enum Type { 00062 ANNOTATION, 00063 COMMENT, 00064 GLOBAL, 00065 UNKNOWN_TYPE 00066 }; 00067 00068 AsciiAnnotationFileLine(); 00069 00070 AsciiAnnotationFileLine(const String& comment); 00071 00072 AsciiAnnotationFileLine(const AnnotationBase * const annotationBase); 00073 00074 AsciiAnnotationFileLine(const map<AnnotationBase::Keyword, String>& globals); 00075 00076 AsciiAnnotationFileLine& operator= (const AsciiAnnotationFileLine& other); 00077 00078 String getComment() const; 00079 00080 map<AnnotationBase::Keyword, String> getGloabalParams() const; 00081 00082 const AnnotationBase* getAnnotationBase() const; 00083 00084 Type getType() const; 00085 00086 ostream& print(ostream& os) const; 00087 00088 private: 00089 Type _type; 00090 String _comment; 00091 const AnnotationBase *_annotationBase; 00092 map<AnnotationBase::Keyword, String> _globals; 00093 00094 }; 00095 00096 inline ostream &operator<<(ostream& os, const AsciiAnnotationFileLine& line) { 00097 return line.print(os); 00098 }; 00099 00100 } 00101 00102 #endif /* ASCIIREGIONLINE_H */