LCOV - code coverage report
Current view: top level - imageanalysis/Annotations - AnnText.cc (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 0 36 0.0 %
Date: 2024-11-06 17:42:47 Functions: 0 7 0.0 %

          Line data    Source code
       1             : //# GaussianShape.cc:
       2             : //# Copyright (C) 1998,1999,2000
       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: casa-feedback@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             : #include <imageanalysis/Annotations/AnnText.h>
      28             : 
      29             : using namespace casacore;
      30             : namespace casa {
      31             : 
      32           0 : AnnText::AnnText(
      33             :         const Quantity& xPos, const Quantity& yPos,
      34             :         const String& dirRefFrameString,
      35             :         const CoordinateSystem& csys,
      36             :         const String& text,
      37             :         const Quantity& beginFreq,
      38             :         const Quantity& endFreq,
      39             :         const String& freqRefFrame,
      40             :         const String& dopplerString,
      41             :         const Quantity& restfreq,
      42             :         const Vector<Stokes::StokesTypes>& stokes
      43           0 : ) : AnnotationBase(
      44             :                 TEXT, dirRefFrameString, csys, beginFreq,
      45             :                 endFreq, freqRefFrame, dopplerString, restfreq, stokes
      46             :         ),
      47           0 :         _inputDirection(AnnotationBase::Direction(1)),
      48           0 :         _text(text) {
      49           0 :         _init(xPos, yPos);
      50           0 : }
      51             : 
      52           0 : AnnText::AnnText(
      53             :         const Quantity& xPos, const Quantity& yPos,
      54             :         const CoordinateSystem& csys,
      55             :         const String& text,
      56             :         const Vector<Stokes::StokesTypes>& stokes
      57           0 : ) : AnnotationBase(TEXT, csys, stokes),
      58           0 :         _inputDirection(AnnotationBase::Direction(1)),
      59           0 :         _text(text) {
      60           0 :         _init(xPos, yPos);
      61           0 : }
      62             : 
      63           0 : AnnText& AnnText::operator= (
      64             :         const AnnText& other
      65             : ) {
      66           0 :     if (this == &other) {
      67           0 :         return *this;
      68             :     }
      69           0 :     AnnotationBase::operator=(other);
      70           0 :     _inputDirection.resize(other._inputDirection.nelements());
      71           0 :     _inputDirection = other._inputDirection;
      72           0 :     _text = other._text;
      73           0 :     return *this;
      74             : }
      75             : 
      76           0 : void AnnText::_init(const Quantity& x, const Quantity& y) {
      77           0 :         _inputDirection[0].first = x;
      78           0 :         _inputDirection[0].second = y;
      79           0 :         _checkAndConvertDirections(
      80           0 :                 String(__FUNCTION__), _inputDirection
      81             :         );
      82           0 : }
      83             : 
      84           0 : MDirection AnnText::getDirection() const {
      85           0 :         return getConvertedDirections()[0];
      86             : }
      87             : 
      88           0 : String AnnText::getText() const {
      89           0 :         return _text;
      90             : }
      91             : 
      92           0 : ostream& AnnText::print(ostream &os) const {
      93           0 :         os << "text [["
      94           0 :                 << _printDirection(_inputDirection[0].first, _inputDirection[0].second)
      95           0 :                 << "], \"" << _text << "\"]";
      96           0 :         _printPairs(os);
      97           0 :         return os;
      98             : }
      99             : 
     100             : }
     101             : 
     102             : 

Generated by: LCOV version 1.16