epsfutils.h

Go to the documentation of this file.
00001 /* Gxsm - Gnome X Scanning Microscopy
00002  * universal STM/AFM/SARLS/SPALEED/... controlling and
00003  * data analysis software
00004  * 
00005  * Copyright (C) 1999,2000,2001,2002,2003 Percy Zahl
00006  *
00007  * Authors: Percy Zahl <zahl@users.sf.net>
00008  * additional features: Andreas Klust <klust@users.sf.net>
00009  * WWW Home: http://gxsm.sf.net
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
00024  */
00025 
00026 /* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 8 c-style: "K&R" -*- */
00027 
00028 /* EPSF Optionen */
00029 #define EPSF_AUTO  1
00030 #define EPSF_NEXT  2
00031 #define EPSF_nxm   4
00032 
00033 #define EPSF_XM 500
00034 #define EPSF_YM_A4 800
00035 #define EPSF_YM_LETTER 740
00036 
00037 #define FIGNRMFNTSZ 12.
00038 #define FIGNRMWIDTH 177.
00039 
00040 #define A4PAPER 1
00041 #define LETTERPAPER 2
00042 
00043 int EpsfFileWrite (char *fname, Scan *Original, Scan *Icon, int NoAuto, int rfac);
00044 
00045 class EpsfTools{
00046 public:
00047   EpsfTools(int paper=A4PAPER);
00048   virtual ~EpsfTools();
00049 
00050   void SetPaperTyp(int paper=A4PAPER) { papertyp=paper; };
00051   int open(char *name, int fullpage=FALSE, int typ=-1, int info=-1);
00052   void NIcons(int n=0){ MkTyp=n/2; nPicPage=n*n*3/2; };
00053   void SetAbbWidth(double mm=FIGNRMWIDTH){ Width=mm; };
00054   void SetFontSize(double  p=FIGNRMFNTSZ);
00055 
00056   void FootLine(Scan *s, int force=FALSE);
00057 
00058   void init();
00059   void placeimage();
00060   void putframe();
00061   void putline(Scan *s, int x1, int y1, int x2, int y2);
00062   void putcircle(Scan *s, int x1, int y1, int x2, int y2);
00063   int  putticks(Scan *s, int OriginZero=TRUE);
00064   void putgrey(Scan *s, Mem2d *m, int autoskl=TRUE, int quick=TRUE, int option=0);
00065   void putbar(Scan *s);
00066   virtual void putsize(Scan  *s);
00067   virtual void putmore(Scan  *s, char *Title=NULL);
00068 
00069   void endimage();
00070 
00071   void close();
00072 
00073  private:
00074   void makesize(int &Nx, int &Ny);
00075   void tr2picorigin(int Nx, int Ny);
00076   void putheader(int fullpage, int typ, int info);
00077   void putimgdef(Mem2d *m, int y=-1);
00078 
00079   char EpsfBuffer[32000];
00080   char *fname;
00081   int MkTyp;
00082   int imgdef;
00083   int PicNo;
00084   int nPicPage;
00085   int page;
00086   int papertyp;
00087 
00088  protected:
00089   std::ofstream Icf;
00090   double Width, FontSize;
00091   gchar *font;
00092 };
00093 
00094 class SPM_epsftools : public EpsfTools{
00095 public:
00096   SPM_epsftools(){};
00097   virtual ~SPM_epsftools(){};
00098 };
00099 
00100 class SPA_epsftools : public EpsfTools{
00101 public:
00102   SPA_epsftools(){};
00103   virtual ~SPA_epsftools(){};
00104 
00105   virtual void putsize(Scan  *s);
00106   virtual void putmore(Scan  *s, char *Title=NULL);
00107 
00108 };

Generated on Sat Apr 1 09:03:53 2006 for GXSM by  doxygen 1.4.6