NEURON
spaceplt.cpp
Go to the documentation of this file.
1 #include <../../nrnconf.h>
2 #include <stdio.h>
3 #include "classreg.h"
4 
5 
6 #include <OS/list.h>
7 #include <OS/string.h>
8 #include <OS/math.h>
9 #include <string.h>
10 #include <ivstream.h>
11 #if HAVE_IV
12 #include "graph.h"
13 #include "scenepic.h"
14 #include "utility.h"
15 #include "ivoc.h"
16 #endif
17 #include "ivocvect.h"
18 #include "nrnoc2iv.h"
19 #include "objcmd.h"
20 
21 extern int nrn_multisplit_active_;
22 extern int hoc_execerror_messages;
23 extern int node_index(Section*, double);
24 extern "C" int structure_change_cnt;
25 extern int nrn_shape_changed_;
26 extern int hoc_return_type_code;
27 Object* (*nrnpy_rvp_rxd_to_callable)(Object*) = 0;
28 
29 class SecPos {
30 public:
31  float x;
32  float len;
34 };
35 
36 declareList(SecPosList, SecPos);
37 implementList(SecPosList, SecPos);
38 
39 class RangeExpr {
40 public:
41  RangeExpr(const char* expr, Object* pyobj, SecPosList*);
42  virtual ~RangeExpr();
43  void fill();
44  void compute();
45  bool exists(int);
46  double* pval(int);
47 private:
48  long n_;
49  SecPosList* spl_;
50  double* val_;
51  bool* exist_;
53 };
54 
55 #if !HAVE_IV
57 public:
58  NoIVGraphVector(const char*);
59  virtual ~NoIVGraphVector();
60  void begin();
61  void add(float, double*);
62  int count();
64  int count_, size_;
65  double** py_;
66  float* x_;
67 };
69  name_ = name;
70  size_ = 0;
71  count_ = 0;
72  py_ = NULL;
73  x_ = NULL;
74 }
76  if (py_) {
77  delete [] py_;
78  delete [] x_;
79  }
80 }
81 int NoIVGraphVector::count() {return count_;}
83  count_ = 0;
84  if (!size_) {
85  size_ = 20;
86  py_ = new double*[size_];
87  x_ = new float[size_];
88  }
89 }
90 void NoIVGraphVector::add(float x, double* y) {
91  if ( count_ == size_) {
92  size_ *= 2;
93  double** py = new double*[size_];
94  float* px = new float[size_];
95  for (int i=0; i<count_; i++) {
96  py[i] = py_[i];
97  px[i] = x_[i];
98  }
99  delete [] py_;
100  delete [] x_;
101  py_ = py;
102  x_ = px;
103  }
104  py_[count_] = y;
105  x_[count_++] = x;
106 }
107 #endif
108 
109 #if HAVE_IV
110 class RangeVarPlot : public GraphVector {
111 #else
113 #endif
114 public:
115  RangeVarPlot(const char*, Object* pyobj);
116  virtual ~RangeVarPlot();
117 #if HAVE_IV
118  virtual void save(ostream&);
119  virtual void request(Requisition& req) const;
120  virtual bool choose_sym(Graph*);
121  virtual void update(Observable*);
122 #endif
123  void x_begin(float, Section*);
124  void x_end(float, Section*);
125  void origin(float);
126  double d2root();
127  float left();
128  float right();
129  void list(Object*);
130  void compute();
131  int get_color(void);
132  void set_color(int);
133 private:
134  int color_;
135  void set_x();
136  void fill_pointers();
137 private:
139  Section* begin_section_, *end_section_;
140  float x_begin_, x_end_, origin_;
141  SecPosList* sec_list_;
145  double d2root_; // distance to root of closest point to root
146 };
147 
148 static double s_begin(void* v) {
149  double x;
150  Section* sec;
151  nrn_seg_or_x_arg(1, &sec, &x);
152  ((RangeVarPlot*)v)->x_begin(x, sec);
153  return 1.;
154 }
155 
156 static double s_end(void* v) {
157  double x;
158  Section* sec;
159  nrn_seg_or_x_arg(1, &sec, &x);
160  ((RangeVarPlot*)v)->x_end(x, sec);
161  return 1.;
162 }
163 
164 static double s_origin(void* v) {
165  ((RangeVarPlot*)v)->origin(*getarg(1));
166  return 1.;
167 }
168 
169 static double s_d2root(void* v) {
170  return ((RangeVarPlot*)v)->d2root();
171  return 0.0;
172 }
173 
174 static double s_left(void* v) {
175  return ((RangeVarPlot*)v)->left();
176  return 0.0;
177 }
178 
179 static double s_right(void* v) {
180  return ((RangeVarPlot*)v)->right();
181  return 0.0;
182 }
183 
184 static double s_list(void* v) {
185  Object* ob = *hoc_objgetarg(1);
186  check_obj_type(ob, "SectionList");
187  ((RangeVarPlot*)v)->list(ob);
188  return 0.;
189 }
190 
191 static double s_color(void* v) {
192  RangeVarPlot* me = (RangeVarPlot*) v;
193  hoc_return_type_code = 1; // integer
194  int old_color = me -> get_color();
195  if (ifarg(1)) {
196  me -> set_color((int)chkarg(1,0,100));
197  }
198  return old_color;
199 }
200 
201 
202 static long to_vector_helper(RangeVarPlot* rvp, Vect* y) {
203 #if HAVE_IV
204  long i, cnt = rvp->py_data()->count();
205 #else
206  long i, cnt = rvp->count();
207 #endif
208  rvp->compute();
209  y->resize(cnt);
210  for (i=0; i < cnt; ++i) {
211 #if HAVE_IV
212  y->elem(i) = *rvp->py_data()->p(i);
213 #else
214  if (rvp->py_[i]) {
215  y->elem(i) = *rvp->py_[i];
216  }else{
217  y->elem(i) = 0.0;
218  }
219 #endif
220  }
221  return cnt;
222 }
223 
224 static Object** rvp_vector(void* v) {
225  if (ifarg(1)) {
226  hoc_execerror("Too many arguments", "RangeVarPlot.vector takes no arguments; were you thinking of .to_vector?");
227  }
228  Vect* y = new Vect(0);
229  RangeVarPlot* rvp = (RangeVarPlot*)v;
230  to_vector_helper(rvp, y);
231  return y->temp_objvar();
232 }
233 
234 static double to_vector(void* v) {
235  if (ifarg(3)) {
236  hoc_execerror("Too many arguments", "RangeVarPlot.to_vector takes 1 or 2 arguments.");
237  }
238  long i;
239  RangeVarPlot* rvp = (RangeVarPlot*)v;
240  Vect* y = vector_arg(1);
241  long cnt = to_vector_helper(rvp, y);
242  if (ifarg(2)) {
243  Vect* x = vector_arg(2);
244  x->resize(cnt);
245  for (i=0; i < cnt; ++i) {
246 #if HAVE_IV
247  x->elem(i) = rvp->x_data()->get_val(i);
248 #else
249  x->elem(i) = rvp->x_[i];
250 #endif
251  }
252  }
253  return double(cnt);
254 }
255 
256 static double from_vector(void* v) {
257  RangeVarPlot* rvp = (RangeVarPlot*)v;
258  Vect* y = vector_arg(1);
259 #if HAVE_IV
260  long i, cnt = rvp->py_data()->count();
261  for (i=0; i < cnt; ++i) {
262  *rvp->py_data()->p(i) = y->elem(i);
263  }
264 #else
265  long i, cnt = rvp->count();
266  for (i=0; i < cnt; ++i) {
267  if (rvp->py_[i]) {
268  *rvp->py_[i] = y->elem(i);
269  }
270  }
271 #endif
272  return double(cnt);
273 }
274 
275 static Member_func s_members[] = {
276  "begin", s_begin,
277  "end", s_end,
278  "origin", s_origin,
279  "d2root", s_d2root,
280  "left", s_left,
281  "right", s_right,
282  "list", s_list,
283  "color", s_color,
284  "to_vector", to_vector,
285  "from_vector", from_vector,
286  0, 0
287 };
288 
290  "vector", rvp_vector,
291  0, 0
292 };
293 
294 static void* s_cons(Object*) {
295  char* var = NULL;
296  Object* pyobj = NULL;
297  Section* sec;
298  double x;
299  if (hoc_is_str_arg(1)) {
300  var = gargstr(1);
301  }else{
302  pyobj = *hoc_objgetarg(1);
303  }
304  RangeVarPlot* s = new RangeVarPlot(var, pyobj);
305 #if HAVE_IV
306  s->ref();
307 #endif
308  if (ifarg(2)) {
309  nrn_seg_or_x_arg(2, &sec, &x);
310  s->x_begin(x, sec);
311  }
312  if (ifarg(3)) {
313  nrn_seg_or_x_arg(3, &sec, &x);
314  s->x_end(x, sec);
315  }
316  return (void*)s;
317 }
318 
319 static void s_destruct(void* v) {
320 #if HAVE_IV
322 #endif
323 }
324 
326 //printf("RangeVarPlot_reg\n");
327  class2oc("RangeVarPlot", s_cons, s_destruct, s_members, NULL, rvp_retobj_members, NULL);
328 }
329 
330 #if HAVE_IV
331 RangeVarPlot::RangeVarPlot(const char* var, Object* pyobj) : GraphVector(var ? var : "pyobj") {
332 #else
333 RangeVarPlot::RangeVarPlot(const char* var, Object* pyobj) : NoIVGraphVector(var ? var : "pyobj") {
334 #endif
335  color_ = 1;
336  begin_section_ = 0;
337  end_section_ = 0;
338  sec_list_ = new SecPosList(50);
341 #if HAVE_IV
342  Oc oc;
343  oc.notify_attach(this);
344 #endif
345  if ((var && strstr(var, "$1")) || pyobj) {
346  rexp_ = new RangeExpr(var, pyobj, sec_list_);
347  }else{
348  rexp_ = NULL;
349  }
350  expr_ = var ? var : "pyobj";
351  origin_ = 0.;
352  d2root_ = 0.;
353 }
354 
356  if (begin_section_) {
359  }
360  if (end_section_) {
362  end_section_ = NULL;
363  }
364  delete sec_list_;
365  if (rexp_) {
366  delete rexp_;
367  }
368 #if HAVE_IV
369  Oc oc;
370  oc.notify_detach(this);
371 #endif
372 }
373 
375  return color_;
376 }
377 
378 
379 void RangeVarPlot::set_color(int new_color) {
380  color_ = new_color;
381 #if HAVE_IV
382 IFGUI
384 ENDGUI
385 #endif
386 }
387 
388 
389 
390 #if HAVE_IV
392  if (o) { // must be Oc::notify_change_ because free is NULL
393  // but do not update if multisplit active
395 //printf("RangeVarPlot::update shape_changed %d %d\n", shape_changed_, nrn_shape_changed_);
397  set_x();
398  fill_pointers();
399  }
400  }else{
401 //printf("RangeVarPlot::update -> GraphVector::update\n");
403  }
404 }
405 #endif
406 
407 void RangeVarPlot::origin(float x) {
408  origin_ = x;
409  fill_pointers();
410 }
411 
413  return d2root_;
414 }
415 
420  x_begin_ = x;
421  set_x();
422  fill_pointers();
423 }
424 
425 void RangeVarPlot::x_end(float x, Section* sec) {
427  end_section_ = sec;
429  x_end_ = x;
430  set_x();
431  fill_pointers();
432 }
433 
435  if (sec_list_->count()) {
436  return sec_list_->item(0).len + origin_;
437  }else{
438  return origin_;
439  }
440 }
441 
443  if (sec_list_->count()) {
444  return sec_list_->item(sec_list_->count() - 1).len + origin_;
445  }else{
446  return origin_;
447  }
448 }
449 
451  if (rexp_) {
452  rexp_->compute();
453  }
454 }
455 
456 #if HAVE_IV
457 void RangeVarPlot::request(Requisition& req) const {
458  if (rexp_) {
459  rexp_->compute();
460  }
462 }
463 #endif
464 
465 #if HAVE_IV
466 void RangeVarPlot::save(ostream& o) {
467  char buf[256];
468  o << "objectvar rvp_" << endl;
469  sprintf(buf, "rvp_ = new RangeVarPlot(\"%s\")", expr_.string());
470  o << buf << endl;
471  sprintf(buf, "%s rvp_.begin(%g)",hoc_section_pathname(begin_section_), x_begin_);
472  o << buf << endl;
473  sprintf(buf, "%s rvp_.end(%g)",hoc_section_pathname(end_section_), x_end_);
474  o << buf << endl;
475  sprintf(buf, "rvp_.origin(%g)", origin_);
476  o << buf << endl;
477  Coord x, y;
478  label_loc(x, y);
479  sprintf(buf, "save_window_.addobject(rvp_, %d, %d, %g, %g)",
480  colors->color(color()), brushes->brush(brush()), x, y);
481  o << buf << endl;
482 }
483 #endif
484 
485 #if HAVE_IV
486 bool RangeVarPlot::choose_sym(Graph* g) {
487 // printf("RangeVarPlot::choose_sym\n");
488  char s[256];
489  s[0] = '\0';
490  while (str_chooser("Range Variable or expr involving $1", s,
491  XYView::current_pick_view()->canvas()->window())) {
492  RangeVarPlot* rvp = new RangeVarPlot(s, NULL);
493  rvp->ref();
494 
496  rvp->x_begin_ = x_begin_;
497  rvp->end_section_ = end_section_;
498  rvp->x_end_ = x_end_;
499  rvp->set_x();
500  rvp->origin(origin_);
501  // check to see if there is anything to plot
502  if (!rvp->trivial()) {
503  g->add_graphVector(rvp);
504  rvp->label(g->label(s));
505  rvp->unref();
506  break;
507  }else{
508 printf("%s doesn't exist along the path %s(%g)", s,
510 printf(" to %s(%g)\n", secname(end_section_), x_end_);
511  }
512  rvp->unref();
513  }
514 
515  return true;
516 }
517 #endif
518 
519 #if 0
520 void SpacePlot::expr(const char* expr) {
521  is_var_ = false;
522  if (gv_) {
523  gv_->begin();
524  }
525  Graph::add_var(expr);
526  set_x();
527 }
528 #endif
529 
531  long xcnt = sec_list_->count();
532  if (xcnt) {
533  Symbol* sym;
534  char buf[200];
535  begin();
536  if (rexp_) {
537  rexp_->fill();
538  }else{
539  sscanf(expr_.string(), "%[^[]", buf);
540  sym = hoc_lookup(buf);
541  if (!sym) {
542  return;
543  }
544  sprintf(buf, "%s(hoc_ac_)", expr_.string());
545  }
546  int noexist=0;// don't plot single points that don't exist
547  bool does_exist;
548  double* pval = NULL;
549  for (long i=0; i < xcnt; ++i) {
550  Section* sec = sec_list_->item(i).sec;
551  hoc_ac_ = sec_list_->item(i).x;
552  if (rexp_) {
553  does_exist = rexp_->exists(int(i));
554  }else{
555  nrn_pushsec(sec);
556 does_exist = nrn_exists(sym, node_exact(sec, hoc_ac_));
557 //does_exist = nrn_exists(sym, sec->pnode[node_index(sec, hoc_ac_)]);
558  }
559  if (does_exist) {
560  if (rexp_) {
561  pval = rexp_->pval(int(i));
562  }else{
563  pval = hoc_val_pointer(buf);
564  }
565  if (noexist > 1) {
566  add (sec_list_->item(i-1).len + origin_, 0);
567  add (sec_list_->item(i-1).len + origin_, pval);
568  }
569  if (i == 1 && noexist == 1) {
570  add(sec_list_->item(i-1).len + origin_, pval);
571  }
572  add(sec_list_->item(i).len + origin_, pval);
573  noexist = 0;
574  }else{
575  if (noexist == 1) {
576  add (sec_list_->item(i-1).len + origin_, pval);
577  add (sec_list_->item(i-1).len + origin_, 0);
578  }
579  if (i == xcnt - 1 && noexist == 0) {
580  add (sec_list_->item(i).len + origin_, pval);
581  }
582  ++noexist;
583  }
584  nrn_popsec();
585  }
586  }
587 }
588 
590  hoc_List* l = (hoc_List*)ob->u.this_pointer;
591  long i, cnt = sec_list_->count();
592  Section* sec = NULL;
593  for (i = 0; i < cnt; ++i) {
594  if (sec_list_->item(i).sec != sec) {
595  sec = sec_list_->item(i).sec;
596  if (sec) {
597  hoc_l_lappendsec(l, sec);
598  section_ref(sec);
599  }
600  }
601  }
602 }
603 
604 #if 0
605 void SpacePlot::plot() {
606  Graph* g = (Graph*)this;
607  long xcnt = sec_list_->count();
608  double* x = hoc_val_pointer("x");
609  if (xcnt) {
610  g->begin();
611  for (long i=0; i < xcnt; ++i) {
612  nrn_pushsec(sec_list_->item(i).sec);
613  *x = sec_list_->item(i).x;
614  gr_->plot(sec_list_->item(i).len);
615  nrn_popsec();
616  }
617  }
618  gr_->flush();
619 }
620 
621 void SpacePlot::plot() {
622  gr_->flush();
623 }
624 #endif
625 
628  sec_list_->remove_all();
629  return;
630  }
631  SecPos spos;
632  double d, dist, d2r, x;
633  Section* sec, *sec1, *sec2, *rootsec;
634  Node* nd, *nd1, *nd2, *rootnode;
635  sec1 = begin_section_;
636  sec2 = end_section_;
637  v_setup_vectors();
638  sec_list_->remove_all(); // v_setup_vectors() may recurse once.
639  nd1 = node_exact(sec1, x_begin_);
640  nd2 = node_exact(sec2, x_end_);
641 
642  dist = topol_distance(sec1, nd1, sec2, nd2, &rootsec, &rootnode);
643 //printf("dist=%g\n", dist);
644  if (!rootnode) {
645  hoc_execerror("SpacePlot", "No path from begin to end points");
646  }
647  d2r = topol_distance(sec1, nd1, rootsec, rootnode, &rootsec, &rootnode);
648 #if 0
649  gr_->erase_most();
650  gr_->new_size(-d2r, -80, dist-d2r, 40);
651  gr_->xaxis(0,1,1);
652  gr_->yaxis(0,1,1);
653  Coord y1=gr_->y1(), y2 = gr_->y2();
654  gr_->new_size(-d2r - dist/10, y1 - (y2-y1)/10, dist*1.1 - d2r, y2 + (y2-y1)/10);
655 #endif
656 
657  nd = nd1; sec = sec1;
658  d = -d2r + node_dist(sec, nd);
659  while (nd != rootnode) {
660  x = node_dist(sec, nd);
661  spos.sec = sec;
662  spos.x = nrn_arc_position(sec, nd);
663  spos.len = d - x;
664 //printf("%s(%g) at %g %g\n", secname(spos.sec), spos.x, spos.len, x);
665  sec_list_->append(spos);
666  if (x == 0.) {
667  sec = nrn_trueparent(sec);
668  d += node_dist(sec, nd);
669  }
670  nd = nrn_parent_node(nd);
671  }
672 
673  if (sec) {
674  spos.sec = sec;
675  }else{
676  spos.sec = nd->child;
677  }
678  spos.x = nrn_arc_position(spos.sec, nd);
679  spos.len = 0.;
680 //printf("%s(%g) at %g root\n", secname(spos.sec), spos.x, spos.len);
681  sec_list_->append(spos);
682 
683  long indx = sec_list_->count();
684 
685  nd = nd2; sec = sec2;
686  d = dist - d2r - node_dist(sec, nd);
687  while (nd != rootnode) {
688  x = node_dist(sec, nd);
689  spos.sec = sec;
690  spos.x = nrn_arc_position(sec, nd);
691  spos.len = d + x;
692 //printf("%s(%g) at %g\n", secname(spos.sec), spos.x, spos.len);
693  sec_list_->insert(indx, spos);
694  if (x == 0.) {
695  sec = nrn_trueparent(sec);
696  d -= node_dist(sec, nd);
697  }
698  nd = nrn_parent_node(nd);
699  }
700  for (sec = rootsec; sec->parentsec; sec = sec->parentsec){}
701  nd = sec->parentnode;
702  d2root_ = topol_distance(rootsec, rootnode, sec, nd, &sec, &nd);
703 //debugging
704 #if 0
705 printf("debugging\n");
706  long cnt, icnt;
707  cnt = sec_list_->count();
708  for (icnt=0; icnt<cnt; ++icnt) {
709  printf("%s(%g) at %g\n", secname(sec_list_->item(icnt).sec),
710  sec_list_->item(icnt).x, sec_list_->item(icnt).len);
711  }
712 #endif
713 }
714 
715 RangeExpr::RangeExpr(const char* expr, Object* pycall, SecPosList* spl) {
716  spl_ = spl;
717  n_ = 0;
718  val_ = NULL;
719  exist_ = NULL;
720  if (pycall) {
722  cmd_ = new HocCommand(nrnpy_rvp_rxd_to_callable(pycall));
723  } else {
724  cmd_ = new HocCommand(pycall);
725  }
726  return;
727  }
728  char buf[256];
729  const char* p1;
730  char* p2;
731  sprintf(buf, "hoc_ac_ = ");
732  p2 = buf + strlen(buf);
733  for (p1 = expr; *p1;) {
734  if (p1[0] == '$' && p1[1] == '1') {
735  p1 += 2;
736  strcpy(p2, "hoc_ac_");
737  p2 += 7;
738  }else{
739  *p2++ = *p1++;
740  }
741  }
742  *p2 = '\0';
743  cmd_ = new HocCommand(buf);
744 }
745 
747  if (val_) {
748  delete [] val_;
749  delete [] exist_;
750  }
751  delete cmd_;
752 }
753 
754 
756  if (n_ != spl_->count()) {
757  if (val_) {
758  delete [] val_;
759  delete [] exist_;
760  }
761  n_ = spl_->count();
762  if (n_) {
763  val_ = new double[n_];
764  exist_ = new bool[n_];
765  }
766  }
767  int temp = hoc_execerror_messages;
768  for (long i=0; i < n_; ++i) {
769  nrn_pushsec(spl_->item(i).sec);
770  hoc_ac_ = spl_->item(i).x;
772  if (cmd_->pyobject()) {
773  hoc_pushx(hoc_ac_);
774  int err = 0; // no messages
775  val_[i] = cmd_->func_call(1, &err); // return err==0 means success
776  exist_[i] = err ? false : true;
777  if (err) { val_[i] = 0.0; }
778  nrn_popsec();
779  continue;
780  }
781  if (cmd_->execute(bool(false)) == 0) {
782  exist_[i] = true;
783  val_[i] = 0.;
784  }else{
785  exist_[i] = false;
786 #if 0
787  printf("RangeExpr: %s no exist at %s(%g)\n",
788  cmd_->name(), secname(spl_->item(i).sec),
789  spl_->item(i).x
790  );
791 #endif
792  }
793  nrn_popsec();
794  }
795  hoc_execerror_messages = temp;
796 }
797 
799  for (long i=0; i < n_; ++i) {
800  if (exist_[i]) {
801  nrn_pushsec(spl_->item(i).sec);
802  hoc_ac_ = spl_->item(i).x;
803  if (cmd_->pyobject()) {
804  hoc_pushx(hoc_ac_);
805  int err = 1; // messages
806  val_[i] = cmd_->func_call(1, &err);
807  }else{
808  cmd_->execute(bool(false));
809  val_[i] = hoc_ac_;
810  }
811  nrn_popsec();
812  }
813  }
814 }
815 
816 bool RangeExpr::exists(int i) {
817  if (i < n_) {
818  return exist_[i];
819  }else{
820  return false;
821  }
822 }
823 
824 double* RangeExpr::pval(int i) {
825  if (i < n_) {
826  return val_ + i;
827  }else{
828  return 0;
829  }
830 }
static double s_list(void *v)
Definition: spaceplt.cpp:184
o
Definition: seclist.cpp:180
static double compute(void *v)
Definition: impedanc.cpp:67
char * hoc_section_pathname(Section *sec)
Definition: cabcode.cpp:1846
virtual ~RangeVarPlot()
Definition: spaceplt.cpp:355
char * strstr(cs, ct) char *cs
struct Prop * prop
Definition: section.h:62
float left()
Definition: spaceplt.cpp:434
int hoc_is_str_arg(int narg)
Definition: code.cpp:741
static void s_destruct(void *v)
Definition: spaceplt.cpp:319
double * pval(int)
Definition: spaceplt.cpp:824
struct Node * parentnode
Definition: section.h:50
void fill()
Definition: spaceplt.cpp:755
RangeExpr(const char *expr, Object *pyobj, SecPosList *)
Definition: spaceplt.cpp:715
#define Vect
Definition: ivocvect.h:14
int hoc_return_type_code
Definition: code.cpp:41
void compute()
Definition: spaceplt.cpp:450
struct Section * parentsec
Definition: section.h:42
RangeExpr * rexp_
Definition: spaceplt.cpp:138
double node_dist(Section *, Node *)
Definition: solve.cpp:151
void begin()
virtual ~NoIVGraphVector()
Definition: spaceplt.cpp:75
Definition: ivoc.h:36
#define g
Definition: passive0.cpp:23
Section * begin_section_
Definition: spaceplt.cpp:139
double nrn_arc_position(Section *sec, Node *node)
Definition: cabcode.cpp:1880
void fill_pointers()
Definition: spaceplt.cpp:530
#define Coord
Definition: _defines.h:19
Symbol * hoc_lookup(const char *)
void * this_pointer
Definition: hocdec.h:231
void set_x()
Definition: spaceplt.cpp:626
static double from_vector(void *v)
Definition: spaceplt.cpp:256
bool * exist_
Definition: spaceplt.cpp:51
static void update(NrnThread *)
Definition: fadvance.cpp:570
check_obj_type(o, "SectionList")
void add_graphVector(GraphVector *)
nd
Definition: treeset.cpp:893
GLabel * label(float x, float y, const char *s, int fixtype, float scale, float x_align, float y_align, const Color *)
#define v
Definition: md1redef.h:4
GraphLine * add_var(const char *, const Color *, const Brush *, bool usepointer, int fixtype=1, double *p=NULL, const char *lab=NULL, Object *obj=NULL)
int node_index(Section *, double)
Definition: cabcode.cpp:1470
int shape_changed_
Definition: spaceplt.cpp:143
sprintf(buf," if (secondorder) {\ " int _i;\" " for(_i=0;_i< %d;++_i) {\" " _p[_slist%d[_i]]+=dt *_p[_dlist%d[_i]];\" " }}\", numeqn, listnum, listnum)
ColorPalette * colors
SecPosList * sec_list_
Definition: spaceplt.cpp:141
#define gargstr
Definition: hocdec.h:14
Definition: graph.h:48
const char * string() const
Definition: string.h:139
int struc_changed_
Definition: spaceplt.cpp:144
long n_
Definition: spaceplt.cpp:48
CopyString name_
Definition: spaceplt.cpp:63
CopyString expr_
Definition: spaceplt.cpp:142
#define color
Definition: rbtqueue.cpp:50
int nrn_multisplit_active_
Definition: multisplit.cpp:15
_CONST char * s
Definition: system.cpp:74
float len
Definition: spaceplt.cpp:32
void notify_detach(Observer *)
void class2oc(const char *, void *(*cons)(Object *), void(*destruct)(void *), Member_func *, int(*checkpoint)(void **), Member_ret_obj_func *, Member_ret_str_func *)
Definition: hoc_oop.cpp:1581
static void * s_cons(Object *)
Definition: spaceplt.cpp:294
static int indx
Definition: deriv.cpp:240
int get_color(void)
Definition: spaceplt.cpp:374
Section * end_section_
Definition: spaceplt.cpp:139
#define printf
Definition: mwprefix.h:26
void set_color(int)
Definition: spaceplt.cpp:379
static N_Vector x_
int nrn_exists(Symbol *s, Node *node)
Definition: cabcode.cpp:1317
const char * secname(Section *sec)
Definition: cabcode.cpp:1787
static Object ** rvp_vector(void *v)
Definition: spaceplt.cpp:224
void nrn_pushsec(Section *sec)
Definition: cabcode.cpp:97
static double s_color(void *v)
Definition: spaceplt.cpp:191
int set_color(int c)
Definition: plot.cpp:865
#define ENDGUI
Definition: hocdec.h:352
declareList(SecPosList, SecPos)
double topol_distance(Section *, Node *, Section *, Node *, Section **, Node **)
Definition: solve.cpp:166
void hoc_execerror(const char *, const char *)
Definition: hoc.cpp:741
#define cnt
Definition: spt2queue.cpp:19
static long to_vector_helper(RangeVarPlot *rvp, Vect *y)
Definition: spaceplt.cpp:202
void v_setup_vectors()
Definition: treeset.cpp:1623
void list(Object *)
Definition: spaceplt.cpp:589
const Brush * brush(int) const
Object *(* nrnpy_rvp_rxd_to_callable)(Object *)=0
Definition: spaceplt.cpp:27
static double s_end(void *v)
Definition: spaceplt.cpp:156
Definition: model.h:57
HocCommand * cmd_
Definition: spaceplt.cpp:52
virtual void unref() const
Definition: resource.cpp:52
Node * nrn_parent_node(Node *)
Definition: treeset.cpp:830
char * name
Definition: init.cpp:16
void x_end(float, Section *)
Definition: spaceplt.cpp:425
void notify_attach(Observer *)
Section * child
Definition: section.h:152
BrushPalette * brushes
SecPosList * spl_
Definition: spaceplt.cpp:49
virtual void update(Observable *)
#define left
Definition: rbtqueue.cpp:45
Section * sec
Definition: spaceplt.cpp:33
static Member_ret_obj_func rvp_retobj_members[]
Definition: spaceplt.cpp:289
double d2root_
Definition: spaceplt.cpp:145
int ifarg(int)
Definition: code.cpp:1562
RangeVarPlot(const char *, Object *pyobj)
Definition: spaceplt.cpp:333
#define right
Definition: rbtqueue.cpp:46
void section_ref(Section *)
Definition: solve.cpp:563
void hoc_pushx(double)
void nrn_seg_or_x_arg(int iarg, Section **psec, double *px)
Definition: point.cpp:191
void x_begin(float, Section *)
Definition: spaceplt.cpp:416
bool str_chooser(const char *, char *, Window *w=NULL, Coord x=400., Coord y=400.)
NoIVGraphVector(const char *)
Definition: spaceplt.cpp:68
void origin(float)
Definition: spaceplt.cpp:407
Vect * vector_arg(int i)
Definition: ivocvect.cpp:332
bool exists(int)
Definition: spaceplt.cpp:816
static double save(void *v)
Definition: ocbox.cpp:340
Definition: hocdec.h:226
void compute()
Definition: spaceplt.cpp:798
#define getarg
Definition: hocdec.h:15
double d2root()
Definition: spaceplt.cpp:412
double * hoc_val_pointer(const char *s)
Definition: code2.cpp:699
static double s_right(void *v)
Definition: spaceplt.cpp:179
#define i
Definition: md1redef.h:12
virtual ~RangeExpr()
Definition: spaceplt.cpp:746
sec
Definition: solve.cpp:885
char buf[512]
Definition: init.cpp:13
float x_begin_
Definition: spaceplt.cpp:140
static double s_d2root(void *v)
Definition: spaceplt.cpp:169
#define add
Definition: redef.h:24
Section * nrn_trueparent(Section *sec)
Definition: cabcode.cpp:1676
void nrn_popsec(void)
Definition: cabcode.cpp:122
static double s_origin(void *v)
Definition: spaceplt.cpp:164
float origin_
Definition: spaceplt.cpp:140
double hoc_ac_
Definition: hoc_init.cpp:261
static double s_begin(void *v)
Definition: spaceplt.cpp:148
double ** py_
Definition: spaceplt.cpp:65
union Object::@54 u
#define IFGUI
Definition: hocdec.h:351
static XYView * current_pick_view()
void section_unref(Section *)
Definition: solve.cpp:552
Definition: section.h:132
#define begin
Definition: redef.h:32
implementList(SecPosList, SecPos)
void add(float, double *)
Definition: spaceplt.cpp:90
double * val_
Definition: spaceplt.cpp:50
Object ** hoc_objgetarg(int)
Definition: code.cpp:1568
#define pval
Definition: md1redef.h:32
const Color * color(int) const
int nrn_shape_changed_
Definition: treeset.cpp:28
static double s_left(void *v)
Definition: spaceplt.cpp:174
float x
Definition: spaceplt.cpp:31
int structure_change_cnt
Definition: spaceplt.cpp:24
double var(InputIterator begin, InputIterator end)
Definition: ivocvect.h:93
static double to_vector(void *v)
Definition: spaceplt.cpp:234
return NULL
Definition: cabcode.cpp:461
Node * node_exact(Section *sec, double x)
Definition: cabcode.cpp:1956
double chkarg(int, double low, double high)
Definition: code2.cpp:608
virtual void request(Requisition &) const
hoc_Item * hoc_l_lappendsec(hoc_List *, struct Section *)
float x_end_
Definition: spaceplt.cpp:140
void RangeVarPlot_reg()
Definition: spaceplt.cpp:325
float right()
Definition: spaceplt.cpp:442
int hoc_execerror_messages
Definition: hoc.cpp:666
static Member_func s_members[]
Definition: spaceplt.cpp:275