1 #include <../../nrnconf.h>
61 void add(
float,
double*);
95 double** py =
new double*[
size_];
96 float* px =
new float[
size_];
120 virtual void save(ostream&);
122 virtual bool choose_sym(
Graph*);
214 for (
i = 0;
i <
cnt; ++
i) {
216 y->elem(
i) = *rvp->py_data()->p(
i);
219 y->elem(
i) = *rvp->
py_[
i];
231 "RangeVarPlot.vector takes no arguments; were you thinking of .to_vector?");
236 return y->temp_objvar();
241 hoc_execerror(
"Too many arguments",
"RangeVarPlot.to_vector takes 1 or 2 arguments.");
250 for (
i = 0;
i <
cnt; ++
i) {
252 x->elem(
i) = rvp->x_data()->get_val(
i);
254 x->elem(
i) = rvp->
x_[
i];
266 for (
i = 0;
i <
cnt; ++
i) {
267 *rvp->py_data()->p(
i) = y->elem(
i);
271 for (
i = 0;
i <
cnt; ++
i) {
273 *rvp->
py_[
i] = y->elem(
i);
463 void RangeVarPlot::request(
Requisition& req)
const {
474 o <<
"objectvar rvp_" << endl;
486 "save_window_.addobject(rvp_, %d, %d, %g, %g)",
496 bool RangeVarPlot::choose_sym(
Graph*
g) {
500 while (
str_chooser(
"Range Variable or expr involving $1",
513 if (!rvp->trivial()) {
514 g->add_graphVector(rvp);
515 rvp->label(
g->label(s));
530 void SpacePlot::expr(
const char* expr) {
559 for (
long i = 0;
i < xcnt; ++
i) {
579 if (
i == 1 && noexist == 1) {
589 if (
i == xcnt - 1 && noexist == 0) {
614 void SpacePlot::plot() {
616 long xcnt = sec_list_->count();
620 for (
long i=0;
i < xcnt; ++
i) {
622 *x = sec_list_->item(
i).x;
623 gr_->plot(sec_list_->item(
i).len);
630 void SpacePlot::plot() {
641 double d, dist, d2r, x;
643 Node *nd, *nd1, *nd2, *rootnode;
654 hoc_execerror(
"SpacePlot",
"No path from begin to end points");
656 d2r =
topol_distance(sec1, nd1, rootsec, rootnode, &rootsec, &rootnode);
659 gr_->new_size(-d2r, -80, dist-d2r, 40);
662 Coord y1=gr_->y1(), y2 = gr_->y2();
663 gr_->new_size(-d2r - dist/10, y1 - (y2-y1)/10, dist*1.1 - d2r, y2 + (y2-y1)/10);
669 while (nd != rootnode) {
698 while (nd != rootnode) {
711 for (
sec = rootsec;
sec->parentsec;
sec =
sec->parentsec) {
713 nd =
sec->parentnode;
720 for (icnt=0; icnt<
cnt; ++icnt) {
745 for (p1 = expr; *p1;) {
746 if (p1[0] ==
'$' && p1[1] ==
'1') {
748 strcpy(p2,
"hoc_ac_");
780 for (
long i = 0;
i <
n_; ++
i) {
788 exist_[
i] = err ? false :
true;
801 printf(
"RangeExpr: %s no exist at %s(%g)\n",
813 for (
long i = 0;
i <
n_; ++
i) {
const char * secname(Section *sec)
void nrn_pushsec(Section *sec)
double nrn_arc_position(Section *sec, Node *node)
Section * nrn_trueparent(Section *sec)
int nrn_exists(Symbol *s, Node *node)
char * hoc_section_pathname(Section *sec)
Node * node_exact(Section *sec, double x)
const Brush * brush(int) const
const Color * color(int) const
GraphLine * add_var(const char *, const Color *, const Brush *, bool usepointer, int fixtype=1, double *p=NULL, const char *lab=NULL, Object *obj=NULL)
virtual void request(Requisition &) const
virtual void update(Observable *)
double func_call(int narg, int *perr=NULL)
int execute(bool notify=true)
NoIVGraphVector(const char *)
void add(float, double *)
virtual ~NoIVGraphVector()
void notify_detach(Observer *)
void notify_attach(Observer *)
RangeExpr(const char *expr, Object *pyobj, SecPosList *)
void x_end(float, Section *)
RangeVarPlot(const char *, Object *pyobj)
void x_begin(float, Section *)
virtual void unref() const
const char * string() const
static XYView * current_pick_view()
sprintf(buf, " if (secondorder) {\n" " int _i;\n" " for (_i = 0; _i < %d; ++_i) {\n" " _p[_slist%d[_i]] += dt*_p[_dlist%d[_i]];\n" " }}\n", numeqn, listnum, listnum)
double chkarg(int, double low, double high)
static void update(NrnThread *)
void hoc_execerror(const char *, const char *)
int hoc_is_str_arg(int narg)
double * hoc_val_pointer(const char *s)
Symbol * hoc_lookup(const char *)
hoc_Item * hoc_l_lappendsec(hoc_List *, struct Section *)
Object ** hoc_objgetarg(int)
double var(InputIterator begin, InputIterator end)
void section_ref(Section *)
double node_dist(Section *, Node *)
double topol_distance(Section *, Node *, Section *, Node *, Section **, Node **)
void section_unref(Section *)
void nrn_seg_or_x_arg(int iarg, Section **psec, double *px)
void class2oc(const char *, void *(*cons)(Object *), void(*destruct)(void *), Member_func *, int(*checkpoint)(void **), Member_ret_obj_func *, Member_ret_str_func *)
static double save(void *v)
check_obj_type(o, "SectionList")
Node * nrn_parent_node(Node *)
static double s_right(void *v)
int node_index(Section *, double)
int hoc_execerror_messages
static double from_vector(void *v)
int nrn_multisplit_active_
static void s_destruct(void *v)
static double to_vector(void *v)
static double s_list(void *v)
static Member_func s_members[]
static double s_begin(void *v)
static double s_color(void *v)
static double s_end(void *v)
static double s_left(void *v)
static Object ** rvp_vector(void *v)
static double s_origin(void *v)
std::vector< SecPos > SecPosList
Object *(* nrnpy_rvp_rxd_to_callable)(Object *)=0
static void * s_cons(Object *)
static Member_ret_obj_func rvp_retobj_members[]
static double s_d2root(void *v)
static long to_vector_helper(RangeVarPlot *rvp, Vect *y)
bool str_chooser(const char *, char *, Window *w=NULL, Coord x=400., Coord y=400.)
char * strstr(char *cs, char *ct)