NEURON
plt.cpp
Go to the documentation of this file.
1 #include <../../nrnconf.h>
2 
3 #define FIG 1/* version 7.1.1 12/8/88
4  added plots in fig format
5  */
6 #include "hoc.h"
7 #include "gui-redirect.h"
8 extern Object** (*nrnpy_gui_helper_)(const char* name, Object* obj);
9 extern double (*nrnpy_object_to_double_)(Object*);
10 
11 extern void Fig_file(const char*, int);
12 
13 #if !defined(CYGWIN)
14 
15 void Plt(void)
16 {
18  int mode;
19  double x, y;
20 #ifndef WIN32
21  mode = *getarg(1);
22  if (mode >= 0 || ifarg(2))
23  {
24  if ((x = *getarg(2)) > 2047)
25  x = 2047;
26  else if (x < 0)
27  x = 0;
28  if ((y = *getarg(3)) > 2047)
29  y = 2047;
30  else if (y < 0)
31  y = 0;
32  }else{
33  x=y=0.;
34  }
35  plt(mode, x, y);
36 #endif
37  ret();
38  pushx(1.);
39 }
40 
41 void Setcolor(void)
42 {
43  TRY_GUI_REDIRECT_DOUBLE("setcolor", NULL);
44  double i;
45  i = set_color((int)*getarg(1));
46  ret();
47  pushx(i);
48 }
49 
50 void hoc_Lw(void)
51 {
52  char *s;
53  static int dev=2;
54 #ifndef WIN32
55  if (ifarg(1)) {
56  s = gargstr(1);
57  if (ifarg(2)) {
58  dev = *getarg(2);
59  }
60  if (s[0] != '\0') {
61  Fig_file(s, dev);
62  } else {
63  Fig_file((char *)0, dev);
64  }
65  } else {
66  Fig_file((char *) 0, dev);
67  }
68 #endif
69  ret();
70  pushx(0.);
71 }
72 
73 #endif /*!defined(CYGWIN)*/
void Plt(void)
Definition: plt.cpp:15
void pushx(double d)
Definition: code.cpp:641
void hoc_Lw(void)
Definition: plt.cpp:50
#define gargstr
Definition: hocdec.h:14
#define TRY_GUI_REDIRECT_DOUBLE(name, obj)
Definition: gui-redirect.h:54
_CONST char * s
Definition: system.cpp:74
#define plt
Definition: redef.h:14
#define ret
Definition: redef.h:123
void Fig_file(const char *, int)
Definition: plot.cpp:618
int set_color(int c)
Definition: plot.cpp:865
double(* nrnpy_object_to_double_)(Object *)
Definition: xmenu.cpp:14
char * name
Definition: init.cpp:16
void Setcolor(void)
Definition: plt.cpp:41
int ifarg(int)
Definition: code.cpp:1562
Definition: hocdec.h:226
#define getarg
Definition: hocdec.h:15
#define i
Definition: md1redef.h:12
return NULL
Definition: cabcode.cpp:461