diff --git a/stim/biomodels/network.h b/stim/biomodels/network.h index aeeead0..130fb84 100644 --- a/stim/biomodels/network.h +++ b/stim/biomodels/network.h @@ -79,7 +79,7 @@ class network{ } */ - edge(std::vector p, std::vector s) + edge(std::vector > p, std::vector s) : cylinder(p,s) { } diff --git a/stim/visualization/cylinder.h b/stim/visualization/cylinder.h index 5945611..53fa2f3 100644 --- a/stim/visualization/cylinder.h +++ b/stim/visualization/cylinder.h @@ -54,13 +54,15 @@ public: { R = s; init(); - { + } +/* cylinder(stim::centerline p, std::vector s) { - d = s; + d = p; init(); - { + } +*/ //cylinder(centerlinec, T r) : centerline(c) { // init(); diff --git a/stim/visualization/gl_network.h b/stim/visualization/gl_network.h index 8761c58..022a0b2 100644 --- a/stim/visualization/gl_network.h +++ b/stim/visualization/gl_network.h @@ -156,9 +156,11 @@ public: } ///render the network cylinder as a series of tubes(when only one network loaded) - void glCylinder0() { + void glCylinder0(T scale = 1.0f, bool undo = false) { float r1, r2; + if (undo == true) + glDeleteLists(dlist, 1); // delete display list if (!glIsList(dlist)) { // if dlist isn't a display list, create it dlist = glGenLists(1); // generate a display list glNewList(dlist, GL_COMPILE); // start a new display list @@ -167,10 +169,10 @@ public: stim::circle C1 = E[e].circ(p - 1); stim::circle C2 = E[e].circ(p); r1 = E[e].r(p - 1); - r2 = E[e].r(p); - C1.set_R(r1); // re-scale the circle to the same - C2.set_R(r2); - std::vector< stim::vec3 > Cp1 = C1.glpoints(20);// get 20 points on the circle plane + r2 = E[e].r(p); + C1.set_R(scale * r1); // re-scale the circle to the same + C2.set_R(scale * r2); + std::vector< stim::vec3 > Cp1 = C1.glpoints(20); // get 20 points on the circle plane std::vector< stim::vec3 > Cp2 = C2.glpoints(20); glBegin(GL_QUAD_STRIP); for (unsigned i = 0; i < Cp1.size(); i++) { @@ -183,11 +185,11 @@ public: for (unsigned n = 0; n < V.size(); n++) { for (unsigned i = 0; i < E.size(); i++) { if (E[i].v[0] == n) { - r1 = E[i].r(0); + r1 = E[i].r(0) * scale; break; } else if (E[i].v[1] == n) { - r1 = E[i].r(E[i].size() - 1); + r1 = E[i].r(E[i].size() - 1) * scale; break; } } -- libgit2 0.21.4