source: trunk/src/Outputs/AnnotationWriter.hh @ 1074

Last change on this file since 1074 was 1074, checked in by MatthewWhiting, 12 years ago

Implementing the new annotation writing class, and updating the standard .ann results to include the new statistics information. All looking good.

File size: 3.2 KB
Line 
1// -----------------------------------------------------------------------
2// AnnotationWriter.hh: Base class for writing results to annotation files,
3//                      annotating images in some FITS viewer.
4// -----------------------------------------------------------------------
5// Copyright (C) 2006, Matthew Whiting, ATNF
6//
7// This program is free software; you can redistribute it and/or modify it
8// under the terms of the GNU General Public License as published by the
9// Free Software Foundation; either version 2 of the License, or (at your
10// option) any later version.
11//
12// Duchamp is distributed in the hope that it will be useful, but WITHOUT
13// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15// for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with Duchamp; if not, write to the Free Software Foundation,
19// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
20//
21// Correspondence concerning Duchamp may be directed to:
22//    Internet email: Matthew.Whiting [at] atnf.csiro.au
23//    Postal address: Dr. Matthew Whiting
24//                    Australia Telescope National Facility, CSIRO
25//                    PO Box 76
26//                    Epping NSW 1710
27//                    AUSTRALIA
28// -----------------------------------------------------------------------
29#ifndef DUCHAMP_ANNOTATION_WRITER_H_
30#define DUCHAMP_ANNOTATION_WRITER_H_
31
32#include <duchamp/Outputs/CatalogueWriter.hh>
33#include <duchamp/Outputs/FileCatalogueWriter.hh>
34#include <duchamp/Detection/detection.hh>
35#include <ios>
36#include <iostream>
37#include <fstream>
38
39namespace duchamp {
40
41  /// @brief Base class for writing FITS annotation files
42  /// @details This class supports the creation of annotation files
43  /// that can be used to supplement the viewing of FITS files in
44  /// external viewers. Examples include kvis, ds9, casaviewer. The
45  /// class will support the I/O, writing of different types of
46  /// annotations (text, lines, circles, ellipses) and other basic
47  /// functionality. Classes to write to specific types of annotation
48  /// files should derive from this and implement their own header and
49  /// primitive methods.
50
51  class AnnotationWriter : public FileCatalogueWriter
52  {
53  public:
54    AnnotationWriter();
55    AnnotationWriter(std::string name);
56    AnnotationWriter(const AnnotationWriter& other);
57    AnnotationWriter& operator= (const AnnotationWriter& other);
58    virtual ~AnnotationWriter(){};
59
60    void setCommentString(std::string s){itsComment = s;};
61
62    virtual void writeHeader();
63    virtual void writeParameters();
64    virtual void writeStats();
65    virtual void writeTableHeader()=0;
66    virtual void writeEntry(Detection *object);
67
68    virtual void writeFooter(){};
69
70    virtual void text(double x, double y, std::string text)=0;
71    virtual void line(double x1, double x2, double y1, double y2)=0;
72    virtual void circle(double x, double y, double r)=0;
73    virtual void ellipse(double x, double y, double r1, double r2, double angle)=0;
74
75  protected:
76    std::string itsComment; ///< How comments are denoted in the annotation file (may be just a single char, eg. '#', but make it flexible)
77  };
78
79}
80
81#endif
Note: See TracBrowser for help on using the repository browser.