casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AnnPolyline.h
Go to the documentation of this file.
1 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
3 //# License for more details.
4 //#
5 //# You should have received a copy of the GNU Library General Public License
6 //# along with this library; if not, write to the Free Software Foundation,
7 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
8 //#
9 //# Correspondence concerning AIPS++ should be addressed as follows:
10 //# Internet email: aips2-request@nrao.edu.
11 //# Postal address: AIPS++ Project Office
12 //# National Radio Astronomy Observatory
13 //# 520 Edgemont Road
14 //# Charlottesville, VA 22903-2475 USA
15 //#
16 
17 #ifndef ANNOTATIONS_ANNPOLYLINE_H
18 #define ANNOTATIONS_ANNPOLYLINE_H
19 
20 #include <casa/aips.h>
22 
23 namespace casa {
24 
25 // <summary>
26 // This class represents a single polyline (in position coordinates) annotation specified
27 // in an ascii region file as proposed in CAS-2285
28 // </summary>
29 // <use visibility=export>
30 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
31 // </reviewed>
32 // <prerequisite>
33 
34 // </prerequisite>
35 
36 // <etymology>
37 // Holds the specification of a polyline annotation.
38 // </etymology>
39 
40 // <synopsis>
41 // This class represents a polyline annotation.
42 // </synopsis>
43 
44 
45 class AnnPolyline: public AnnRegion {
46 
47 public:
48 
50  const casacore::Vector<casacore::Quantity>& xPositions,
51  const casacore::Vector<casacore::Quantity>& yPositions,
52  const casacore::String& dirRefFrameString,
53  const casacore::CoordinateSystem& csys,
54  const casacore::IPosition& imShape,
55  const casacore::Quantity& beginFreq,
56  const casacore::Quantity& endFreq,
57  const casacore::String& freqRefFrameString,
58  const casacore::String& dopplerString,
59  const casacore::Quantity& restfreq,
61  const casacore::Bool annotationOnly,
62  const casacore::Bool requireImageRegion=true
63  );
64 
65  // Simplified constructor.
66  // all frequencies are used (these can be set after construction).
67  // xPositions and yPositions
68  // must be in the same frame as the csys direction coordinate.
69  // is a region (not just an annotation), although this value can be changed after
70  // construction.
72  const casacore::Vector<casacore::Quantity>& xPositions,
73  const casacore::Vector<casacore::Quantity>& yPositions,
74  const casacore::CoordinateSystem& csys,
75  const casacore::IPosition& imShape,
77  const casacore::Bool requireImageRegion=true
78  );
79 
80  // implicit copy constructor and destructor are fine
81 
82  AnnPolyline& operator=(const AnnPolyline& other);
83 
84  // get the vertices converted to the coordinate system used at construction.
86 
87  // get the world coordinates of the polygon vertices
88  void worldVertices(std::vector<casacore::Quantity>& x, std::vector<casacore::Quantity>& y) const;
89 
90  // get the pixel coordinates of the polygon vertices
91  void pixelVertices(std::vector<casacore::Double>& x, std::vector<casacore::Double>& y) const;
92 
93 
94  virtual std::ostream& print(std::ostream &os) const;
95 
96 private:
98 
99  void _init();
100 };
101 
102 }
103 
104 #endif /* ASCIIPOLYLINEREGION_H_ */
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
A 1-D Specialization of the Array class.
void pixelVertices(std::vector< casacore::Double > &x, std::vector< casacore::Double > &y) const
get the pixel coordinates of the polygon vertices
This class represents a annotation referring to a region specified in an ascii region file as propose...
Definition: AnnRegion.h:53
casacore::Vector< casacore::Quantity > _origXPos
Definition: AnnPolyline.h:97
void worldVertices(std::vector< casacore::Quantity > &x, std::vector< casacore::Quantity > &y) const
get the world coordinates of the polygon vertices
This class represents a single polyline (in position coordinates) annotation specified in an ascii re...
Definition: AnnPolyline.h:45
AnnPolyline & operator=(const AnnPolyline &other)
implicit copy constructor and destructor are fine
virtual std::ostream & print(std::ostream &os) const
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::Vector< casacore::MDirection > getCorners() const
get the vertices converted to the coordinate system used at construction.
casacore::Vector< casacore::Quantity > _origYPos
Definition: AnnPolyline.h:97
AnnPolyline(const casacore::Vector< casacore::Quantity > &xPositions, const casacore::Vector< casacore::Quantity > &yPositions, const casacore::String &dirRefFrameString, const casacore::CoordinateSystem &csys, const casacore::IPosition &imShape, const casacore::Quantity &beginFreq, const casacore::Quantity &endFreq, const casacore::String &freqRefFrameString, const casacore::String &dopplerString, const casacore::Quantity &restfreq, const casacore::Vector< casacore::Stokes::StokesTypes > stokes, const casacore::Bool annotationOnly, const casacore::Bool requireImageRegion=true)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
Interconvert pixel and world coordinates.