#ifndef WMMVIS_H
#define WMMVIS_H

/*
 * WMM
 * Wave-matching method for mode analysis of dielectric waveguides
 * Manfred Lohmeyer 
 * University of Osnabrueck, Department of Physics
 * Barbarastrasse 7, D-49069 Osnabrueck, Germany
 * (1999)
 * Manfred Hammer
 * University of Twente, Faculty of Mathematical Sciences
 * P.O. Box 217, 7500AE Enschede, The Netherlands
 * (2002)
 */

/*
 * wmmvis.h
 * output to MATLAB .m -files, visualization  
 * helper routines for mode.c and wmmarr.c
 */

/* some global settings */
#define YES 1
#define NO  0

/* output uses colour */ 
extern int Mlop_Colour;
/* output files include print commands */
extern int Mlop_Print;

/* waveguide geometry and field extrema */
void mlout_geo(FILE *dat, Waveguide wg, double minf, double maxf);

/* waveguide geometry and field extrema for interference visualization */
void mlout_geoyz(FILE *dat, Waveguide wg, double minf, double maxf);

/* three segment coupler geometry and field extrema for interference 
   visualization, input and output waveguides included */
void mlout_iopropgeo(FILE *dat, Waveguide iwg, Waveguide pwg, Waveguide owg,
                     double l, double minf, double maxf);

/* output mesh, x-y-plane */
void mlout_meshxy(FILE *dat, Rect disp, int npx, int npy);

/* output mesh, y-z-plane */
void mlout_meshyz(FILE *dat, double ybeg, double yend, int npy,
                             double zbeg, double zend, int npz);

/* matrix of field values */
void mlout_fld(FILE *dat, int npx, int npy, Fcomp cp, Dmatrix fld);

/* field section */
void mlout_sec(FILE *dat, double x0, double y0, double x1, double y1, 
                     int np, Fcomp cp, char c2, char c3, Dvector fld);

/* field section, 1D*/
void mlout_sec1D(FILE *dat,  
		 Fcomp cp, char c2, char c3, char c4, char c5,
                 int np, Dvector fld, Dvector pos);

/* contour plot */
void mlout_contour(char *name, FILE *dat, Fcomp cp, Afo foa);

/* surface plot */
void mlout_surface(char *name, FILE *dat, Fcomp cp, Afo foa);

/* intensity image */
void mlout_image(char *name, FILE *dat, Fcomp cp, Afo foa);

/* six component surface plot */  
void mlout_acmfile(char *name, FILE *dat, 
		   double minE, double maxE, double minH, double maxH);

/* mode section plot geometry  */
void mlout_Lsecgeo(FILE *dat, double x0, double y0, double x1, double y1,
                   int nbd, Dvector bd, Dvector ri);

/* mode section plot, plot commands */
void mlout_Lsecplot(char *name, FILE *dat, char ori, double minf, double maxf,
                    Fcomp cp, int nbd, int nsec);
void mlout_Vsecplot(FILE *dat, Fcomp cp, int nsec, char ext0, char ext1);

/* fancy plot */
void mlout_fancy(char *name, FILE *dat, Fcomp cp, int numc);

/* for interference data: show the z position */
void mlout_annotatezpos(FILE *dat, double rz);

/* interference field animation */
void mlout_play(FILE *dat, char *name, int numz);

/* .m file title comment */
void mlout_title(FILE *dat, char *name, char *intro);

/* print commands */
void mlout_print(FILE *dat, char *name, char dev);

/* interference intensity image */
void mlout_propimage(char *name, FILE *dat);

/* three segment coupler, interference intensity image */
void mlout_iopropimage(char *name, FILE *dat);

#endif  // WMMVIS_H

