1 #include <../../nrnconf.h>
13 static FILE *
fin, *fmark, *fdat;
15 static dashes(), file_func(), dat_head();
44 if ((fmark =
fopen(
name,
"w")) == (FILE*) 0) {
48 if ((fdat =
fopen(
name,
"w")) == (FILE*) 0) {
59 marksec[
i] = marksec[isec];
61 if (imark < MAXMARKS) {
62 marksec[
i] = 1L << (imark++);
69 for (
i = 0;
i < rootnodecount;
i++) {
70 printline(v_node[
i]->child, 0, 0., (
double) (
i * 100));
71 dashes(v_node[
i]->child, 0., (
double) (
i * 100), 0., 1);
73 free((
char*) marksec);
84 double cos(),
sin(), xx, yy, ttheta, dx;
87 nrall = (int)
sec->prop->dparam[4].val;
88 for (irall = 0; irall < nrall; irall++) {
91 ttheta = theta + (double) (nrall - 2 * irall - 1) / (double) nrall;
92 for (
i = 0;
i <
sec->nnode - 1;
i++) {
93 xx += dx *
cos(ttheta);
94 yy += dx *
sin(ttheta);
95 printline(
sec,
i, xx, yy);
97 for (
i =
sec->nnode - 1;
i >= 0;
i--) {
99 if (
i ==
sec->nnode - 1) {
100 dashes(ch, xx, yy, ttheta, 0);
102 dashes(ch, xx, yy, ttheta + .5, 0);
105 if (i < sec->nnode - 1) {
106 xx -= dx *
cos(ttheta);
107 yy -= dx *
sin(ttheta);
111 ttheta = 3.14159 - .5;
114 dashes(ch, x, y, ttheta + .5, 0);
119 static double diamval(
Node* nd) {
122 for (
p = nd->
prop;
p;
p =
p->next) {
131 static void printline(
Section*
sec,
int i,
double x,
double y) {
147 if (
i ==
sec->nnode - 2) {
154 if (i < sec->nnode - 2) {
161 fwrite((
char*) &marksec[
sec->order],
sizeof(
long), 1, fmark);
162 Fprintf(
fin,
"%d\t%c\t%g\t%g\t0\t%g\n", inode++,
type, (x += .001), y, d);
165 }
else if (nb == 2) {
167 }
else if (nb == 0) {
170 fwrite((
char*) &marksec[
sec->order],
sizeof(
long), 1, fmark);
180 static int hhtype = 0;
189 for (
p = nd->
prop;
p;
p =
p->next) {
190 if (
p->type == hhtype) {
196 fprintf(fdat,
"%s\n",
sec->prop->dparam[0].sym->name);
197 fprintf(fdat,
"^area %g\n", 1.);
200 fprintf(fdat,
"^synapse %d\n", 0);
201 fprintf(fdat,
"^Erev %g\n", 0.);
202 fprintf(fdat,
"^gback %g\n", 0.);
203 fprintf(fdat,
"^gsyn %g\n", 0.);
204 fprintf(fdat,
"^tstart %g\n", 0.);
205 fprintf(fdat,
"^twidth %g\n", 0.);
208 static void dat_head(
void) {
212 fprintf(fdat,
"%d %g %g\n", 4, 1., 1000.);
215 fprintf(fdat,
"%g %g\n", .1, 10.);
218 fprintf(fdat,
"%g %g %g\n", 1000., 1.e-6, Ra);
221 fprintf(fdat,
"%g %g\n", 30., -15.);
224 fprintf(fdat,
"%g %g %g %g %g %g\n", 1., 1., 1., 1., 1., 1.);
227 fprintf(fdat,
"%g %g\n", 115., -12.);
double section_length(Section *sec)
static double active(void *v)
void hoc_execerror(const char *, const char *)
void hoc_retpushx(double x)
Symbol * hoc_lookup(const char *)
void * ecalloc(size_t n, size_t size)
static void dashes(Section *sec, int offset, int first)