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