casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ComponentType.h
Go to the documentation of this file.
1 //# ComponentType.h: Enumerators common to the Components Module
2 //# Copyright (C) 1997,1998,1999,2002
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //#
27 //# $Id: ComponentType.h 21130 2011-10-18 07:39:05Z gervandiepen $
28 
29 #ifndef COMPONENTS_COMPONENTTYPE_H
30 #define COMPONENTS_COMPONENTTYPE_H
31 
32 #include <casa/aips.h>
33 
34 //# Forward Declaration
35 namespace casacore{
36 
37 class String;
38 }
39 
40 namespace casac {
41  class componentlist;
42 }
43 
44 namespace casa {
45 
46 
47 //# Forward Declaration
48 class SkyCompRep;
49 class ComponentShape;
50 class SpectralModel;
51 
52 
53 // <summary>Enumerators common to the ComponentsModels module</summary>
54 
55 // <use visibility=export>
56 
57 // <reviewed reviewer="" date="yyyy/mm/dd" tests="tComponentType" demos="">
58 // </reviewed>
59 
60 // <etymology>
61 // This class contains the type definitions in the ComponentModels module
62 // </etymology>
63 
64 // <synopsis>
65 // This class does nothing. It is merely a container for the enumerations used
66 // by the ComponentModels module. These enumerations define the standard
67 // component types. It also contains:
68 // <ul>
69 // <li> static functions which convert between these enumerators and strings.
70 // <li> static functions which construct the appropriate derived object given
71 // an enumerator. Note that these functions are only accessible by the
72 // friend classes <linkto class=SkyCompRep>SkyCompRep</linkto> and
73 // <linkto class=ComponentList>ComponentList</linkto> and should be
74 // considered an implementation detail.
75 // </ul>
76 // The first element in the enumerator must be represented by zero and every
77 // enumerator must contain as the second last and last elements an UNKNOWN_*
78 // and NUMBER_* element.
79 // </synopsis>
80 
81 // <example>
82 // See the documentation for the ComponentModels classes for examples on the
83 // use of these enumerator and functions. For example the
84 // <linkto class=ComponentShape>ComponentShape</linkto> class.
85 // </example>
86 
87 // <todo asof="1999/11/15">
88 // <li> Nothing I can think of.
89 // </todo>
90 //
91 
93 public:
94  // Declare which classes access the private functions which convert
95  // enumerators to objects. The private construct functions can only be
96  // accessed by functions in the friend classes specified below.
97  friend class SkyCompRep;
98  friend class ::casac::componentlist;
99 
100  // The shapes of all the components
101  enum Shape {
102  // A simple point component
103  POINT = 0,
104  // A elliptical Gaussian component
106  // A elliptical disk component
108  // A elliptical disk component with limb-darkening effect
110  // An unknown Component
112  // The number of types in this enumerator
114  };
115  // The ways the Flux polarisation can be represented
117  // The four casacore::Stokes parameters, ie I,Q,U,V
118  STOKES = 0,
119  // Linear polarisation feeds ie., XX,XY,YX,YY with zero parrallactic angle
121  // Circular polarisation feeds ie., RR, RL, LR, LL
123  // An unknown Component
125  // The number of types in this enumerator
127  };
128  // The different functional forms for the spectral variation.
130  // The flux is constant at different frequencies
132  // The flux varies as <src>I = I_0 * (nu / nu_0)^alpha</src>
134  //Tabular values interpolated in between
136  // an unknown spectral type
138  // The number of spectral types in this enumerator
140  };
141  // Convert the Shape enumerator to a string
142  static casacore::String name(ComponentType::Shape shapeEnum);
143  // Convert a given casacore::String to a Shape enumerator (min match active)
144  static ComponentType::Shape shape(const casacore::String& shapeName);
145 
146  // Convert the Polarisation enumerator to a string
148  // Convert a given casacore::String to a Polarisation enumerator
150  polarisationName);
151  // Convert the SpectralShape enumerator to a string
153  // Convert a given casacore::String to a SpectralShape enumerator
155  spectralName);
156 private:
157 
158  // Convert the Shape enumerator to a shape object (upcast to the base
159  // object). Returns a null pointer if the object could not be
160  // constructed. This will occur is the enumerator is UNKNOWN_SHAPE or
161  // NUMBER_SHAPES or there is insufficient memory. The caller of this function
162  // is responsible for deleting the pointer.
163  static ComponentShape* construct(ComponentType::Shape shapeEnum);
164 
165  // Convert the SpectralShape enumerator to a spectral model object (upcast to
166  // the base object). Returns a null pointer if the object could not be
167  // constructed. This will occur is the enumerator is UNKNOWN_SPECTRAL_SHAPE
168  // or NUMBER_SPECTRAL_SHAPES or there is insufficient memory. The caller of
169  // this function is responsible for deleting the pointer.
171 };
172 
173 } //# NAMESPACE CASA - END
174 
175 #endif
A model component of the sky brightness.
Definition: SkyCompRep.h:133
Linear polarisation feeds ie., XX,XY,YX,YY with zero parrallactic angle.
A elliptical Gaussian component.
Circular polarisation feeds ie., RR, RL, LR, LL.
The four casacore::Stokes parameters, ie I,Q,U,V.
Shape
The shapes of all the components.
The flux varies as I = I_0 * (nu / nu_0)^alpha
The number of spectral types in this enumerator.
Tabular values interpolated in between.
A elliptical disk component with limb-darkening effect.
static ComponentType::Shape shape(const casacore::String &shapeName)
Convert a given casacore::String to a Shape enumerator (min match active)
Base class for component shapes.
A simple point component.
static casacore::String name(ComponentType::Shape shapeEnum)
Convert the Shape enumerator to a string.
static ComponentType::SpectralShape spectralShape(const casacore::String &spectralName)
Convert a given casacore::String to a SpectralShape enumerator.
The number of types in this enumerator.
Base class for spectral models.
A elliptical disk component.
Enumerators common to the ComponentsModels module.
Definition: ComponentType.h:92
The flux is constant at different frequencies.
SpectralShape
The different functional forms for the spectral variation.
The number of types in this enumerator.
static ComponentType::Polarisation polarisation(const casacore::String &polarisationName)
Convert a given casacore::String to a Polarisation enumerator.
Polarisation
The ways the Flux polarisation can be represented.
static ComponentShape * construct(ComponentType::Shape shapeEnum)
Convert the Shape enumerator to a shape object (upcast to the base object).
String: the storage and methods of handling collections of characters.
Definition: String.h:223
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42