Line data Source code
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 :
18 : #include <imageanalysis/Annotations/AnnRectBox.h>
19 :
20 : #include <casacore/coordinates/Coordinates/DirectionCoordinate.h>
21 :
22 : using namespace casacore;
23 : namespace casa {
24 :
25 0 : AnnRectBox::AnnRectBox(
26 : const Quantity& blcx,
27 : const Quantity& blcy,
28 : const Quantity& trcx,
29 : const Quantity& trcy,
30 : const String& dirRefFrameString,
31 : const CoordinateSystem& csys,
32 : const IPosition& imShape,
33 : const Quantity& beginFreq,
34 : const Quantity& endFreq,
35 : const String& freqRefFrameString,
36 : const String& dopplerString,
37 : const Quantity& restfreq,
38 : const Vector<Stokes::StokesTypes> stokes,
39 : const Bool annotationOnly,
40 : const Bool requireImageRegion
41 0 : ) : AnnPolygon(
42 : RECT_BOX, blcx, blcy, trcx, trcy,
43 : dirRefFrameString, csys, imShape,
44 : beginFreq, endFreq, freqRefFrameString,
45 : dopplerString, restfreq, stokes,
46 : annotationOnly, requireImageRegion
47 0 : ), _inputCorners(2) {
48 0 : _inputCorners[0].first = blcx;
49 0 : _inputCorners[0].second = blcy;
50 0 : _inputCorners[1].first = trcx;
51 0 : _inputCorners[1].second = trcy;
52 0 : }
53 :
54 0 : AnnRectBox::AnnRectBox(
55 : const Quantity& blcx,
56 : const Quantity& blcy,
57 : const Quantity& trcx,
58 : const Quantity& trcy,
59 : const CoordinateSystem& csys,
60 : const IPosition& imShape,
61 : const Vector<Stokes::StokesTypes>& stokes,
62 : const Bool requireImageRegion
63 0 : ) : AnnPolygon(
64 : RECT_BOX, blcx, blcy, trcx, trcy, csys, imShape, stokes,
65 : requireImageRegion
66 0 : ), _inputCorners(2) {
67 0 : _inputCorners[0].first = blcx;
68 0 : _inputCorners[0].second = blcy;
69 0 : _inputCorners[1].first = trcx;
70 0 : _inputCorners[1].second = trcy;
71 0 : }
72 :
73 0 : AnnRectBox& AnnRectBox::operator= (
74 : const AnnRectBox& other
75 : ) {
76 0 : if (this == &other) {
77 0 : return *this;
78 : }
79 0 : AnnPolygon::operator=(other);
80 0 : _inputCorners.resize(other._inputCorners.shape());
81 0 : _inputCorners = other._inputCorners;
82 :
83 0 : return *this;
84 : }
85 :
86 0 : ostream& AnnRectBox::print(ostream &os) const {
87 0 : _printPrefix(os);
88 0 : os << "box [["
89 0 : << _printDirection(_inputCorners[0].first, _inputCorners[0].second)
90 0 : << "], ["
91 0 : << _printDirection(_inputCorners[1].first, _inputCorners[1].second)
92 0 : << "]]";
93 0 : _printPairs(os);
94 0 : return os;
95 : }
96 :
97 : }
98 :
|