ds9writer.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef DISPLAY_DS9_DS9WRITER_H_
00029 #define DISPLAY_DS9_DS9WRITER_H_
00030 #include <stdio.h>
00031
00032 namespace casa {
00033
00034 class WorldCanvas;
00035
00036 namespace viewer {
00037
00038 class ds9writer {
00039 public:
00040 ds9writer( const char *output_path, const char *coord_sys );
00041 virtual ~ds9writer( );
00042 void setCsysSource(const char *);
00043 bool open( );
00044 bool rectangle( WorldCanvas *, const std::vector<std::pair<double,double> > &pts );
00045 bool ellipse( WorldCanvas *, const std::vector<std::pair<double,double> > &pts );
00046 bool polygon( WorldCanvas *, const std::vector<std::pair<double,double> > &pts );
00047 bool polyline( WorldCanvas *, const std::vector<std::pair<double,double> > &pts );
00048 bool point( WorldCanvas *, const std::vector<std::pair<double,double> > &pts );
00049 private:
00050 typedef std::map<std::string,std::string> str_map_type;
00051 str_map_type defaults;
00052
00053 struct cs {
00054 typedef void (*from_linear_2_type)(WorldCanvas*wc,double,double,double&,double&);
00055 typedef void (*from_linear_4_type)(WorldCanvas*wc,double,double,double,double,double&,double&,double&,double&);
00056 cs( const char *ds9_type, MDirection::Types t,
00057 from_linear_2_type func2, from_linear_4_type func4 ) : ds9(ds9_type), type(t), cvt2(func2), cvt4(func4) { }
00058 ~cs( ) { }
00059 const std::string ds9;
00060 const MDirection::Types type;
00061 from_linear_2_type cvt2;
00062 from_linear_4_type cvt4;
00063 };
00064 typedef std::map<std::string,cs> coord_map_type;
00065 coord_map_type coord_systems;
00066 char *path;
00067 char *csys;
00068 char *csys_file_path;
00069 bool opened;
00070 FILE *fptr;
00071 };
00072 }
00073 }
00074
00075 #endif