ngspice/src/include/graph.h

150 lines
3.9 KiB
C
Raw Normal View History

2000-04-27 22:03:57 +02:00
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1988 Jeffrey M. Hsu
**********/
/*
This file contains the graph structure.
*/
#ifndef _GRAPH_H
#define _GRAPH_H
2000-04-27 22:03:57 +02:00
#include "typedefs.h"
* src/Makefile.am src/main.c src/sconvert.c src/analysis/cktdisto.c src/analysis/cktnoise.c src/analysis/noisean.c: Updates for the new header files. * src/maths/cmaths/cmath1.c src/maths/cmaths/cmath2.c src/maths/cmaths/cmath3.c src/maths/cmaths/cmath4.c: Updates for the new header files. * src/frontend/.cvsignore src/frontend/Makefile.am: Updates for the new files. * src/frontend/agraf.c src/frontend/aspice.c src/frontend/breakp.c src/frontend/breakp2.c src/frontend/circuits.c src/frontend/cpitf.c src/frontend/debugcom.c src/frontend/define.c src/frontend/diff.c src/frontend/dimens.c src/frontend/display.c src/frontend/doplot.c src/frontend/dotcards.c src/frontend/evaluate.c src/frontend/fourier.c src/frontend/graf.c src/frontend/grid.c src/frontend/inp.c src/frontend/inpcom.c src/frontend/interp.c src/frontend/linear.c src/frontend/misccoms.c src/frontend/misccoms.h src/frontend/miscvars.c src/frontend/mw_coms.c src/frontend/newcoms.c src/frontend/nutinp.c src/frontend/options.c src/frontend/outitf.c src/frontend/parse.c src/frontend/plotcurv.c src/frontend/points.c src/frontend/postcoms.c src/frontend/rawfile.c src/frontend/runcoms.c src/frontend/runcoms2.c src/frontend/shyu.c src/frontend/spec.c src/frontend/spiceif.c src/frontend/typesdef.c src/frontend/vectors.c src/frontend/where.c src/frontend/postcoms.c: Updates for the new header files. Some commands have moved into the new files below. * src/frontend/README src/frontend/com_compose.c src/frontend/com_compose.h src/frontend/com_display.c src/frontend/com_display.h src/frontend/com_let.c src/frontend/com_let.h src/frontend/com_setscale.c src/frontend/com_setscale.h src/frontend/commands.c src/frontend/commands.h src/frontend/completion.h src/frontend/streams.h src/frontend/testcommands.c: Separation into different com_* commands. This is a start. The rest of the subdirectory needs doing. * src/include/complex.h src/include/cpdefs.h src/include/cpextern.h src/include/cpstd.h src/include/fteconst.h src/include/ftedata.h src/include/ftedev.h src/include/fteext.h src/include/ftegraph.h src/include/fteparse.h src/include/dvec.h src/include/grid.h src/include/plot.h src/include/pnode.h src/include/sim.h src/include/variable.h src/include/wordlist.h src/include/bool.h: Separation of header files into smaller pieces. This limits recompilation to only the affected source files. The original header files have a warning message embedded to flag obsoleted use. * src/frontend/compose.c src/frontend/compose.h src/frontend/nutctab.c src/frontend/nutctab.h src/frontend/plot5.c src/frontend/plot5.h src/frontend/spcmdtab.c src/frontend/x11.c src/frontend/x11.h src/frontend/xgraph.c src/frontend/xgraph.h: Moved these files into src/frontend/plotting subdirectory. * src/frontend/plotting/.cvsignore src/frontend/plotting/Makefile.am src/frontend/plotting/plot5.c src/frontend/plotting/plot5.h src/frontend/plotting/plotting.c src/frontend/plotting/plotting.h src/frontend/plotting/pvec.c src/frontend/plotting/pvec.h src/frontend/plotting/x11.c src/frontend/plotting/x11.h src/frontend/plotting/xgraph.c src/frontend/plotting/xgraph.h: The new libplotting library with automake and CVS infrastructure.
2000-05-06 16:12:51 +02:00
#include "grid.h"
#include "plot.h"
#include "dvec.h" /* for struct dvec */
2000-04-27 22:03:57 +02:00
struct _keyed;
2000-04-27 22:03:57 +02:00
/* Device-independent data structure for plots. */
#define NUMCOLORS 20
struct graph {
2000-04-27 22:03:57 +02:00
int graphid;
struct dveclist *plotdata; /* normalized data */
char *plotname; /* name of plot this graph is in */
int onevalue; /* boolean variable,
2010-07-03 17:36:05 +02:00
true if plotting one value
against itself (real vs imaginary) */
2000-04-27 22:03:57 +02:00
int degree; /* degree of polynomial interpretation */
int currentcolor;
int linestyle;
struct {
int height, width;
} viewport;
int viewportxoff; /* x offset of viewport w/in graph */
int viewportyoff; /* y offset of viewport w/in graph */
struct {
int xpos; /* x position of graph in screen coord */
int ypos; /* y position of graph in screen coord */
int width; /* width of window on screen */
int height; /* height of window on screen */
} absolute;
struct {
double xmin, ymin, xmax, ymax;
} data;
struct {
double xmin, ymin, xmax, ymax;
/* cache: width = xmax - xmin height = ymax - ymin */
double width, height;
} datawindow;
/* note: this int is device dependent */
int colors[NUMCOLORS];
/* cache (datawindow size) / (viewport size) */
double aspectratiox, aspectratioy;
int ticmarks; /* mark every ticmark'th point */
double *ticdata;
int fontwidth, fontheight; /* for use in grid */
PLOTTYPE plottype; /* defined in FTEconstant.h */
struct {
GRIDTYPE gridtype; /* defined in FTEconstant.h */
int circular; /* TRUE if circular plot area */
union {
struct {
2010-07-03 17:36:05 +02:00
char units[16]; /* unit labels */
int spacing, numspace;
double distance, lowlimit, highlimit;
int mult;
int onedec; /* a boolean */
int hacked; /* true if hi - lo already hacked up */
double tenpowmag;
double tenpowmagx;
int digits;
2000-04-27 22:03:57 +02:00
} lin;
struct {
2010-07-03 17:36:05 +02:00
char units[16]; /* unit labels */
int hmt, lmt, decsp, subs, pp;
2000-04-27 22:03:57 +02:00
} log;
struct {
2010-07-03 17:36:05 +02:00
char units[16]; /* unit labels */
int radius, center;
double mrad;
int lmt;
int hmt, mag; /* added, p.w.h. */
2000-04-27 22:03:57 +02:00
} circular; /* bogus, rework when write polar grids, etc */
} xaxis, yaxis;
int xdatatype, ydatatype;
int xsized, ysized;
double xdelta, ydelta; /* if non-zero, user-specified deltas */
char *xlabel, *ylabel;
} grid;
int numbuttons; /* number of buttons */
struct {
int id;
char *message;
} *buttons;
int buttonsxoff; /* viewportxoff + x size of viewport */
int buttonsyoff;
struct {
int width, height;
char message[161]; /* two lines of text */
} messagebox;
int messagexoff;
int messageyoff;
/* characters the user typed on graph */
2010-07-03 17:36:05 +02:00
/* note: think up better names */
struct _keyed *keyed;
2000-04-27 22:03:57 +02:00
/* for zoomin */
char *commandline;
/* Space here is allocated by NewViewport
and de-allocated by DestroyGraph.
*/
char *devdep;
};
/* characters the user typed on graph */
/* note: think up better names */
struct _keyed {
char *text;
int x, y;
int colorindex; /* index into colors array */
struct _keyed *next;
};
2000-04-27 22:03:57 +02:00
#define NEWGRAPH (GRAPH *) tmalloc(sizeof(GRAPH))
2000-04-27 22:03:57 +02:00
#define rnd(x) (int) ((x)+0.5)
#endif