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