Commit ac2781358f367d42bb5783bf248230d54472c1b4

Authored by Jiaming Guo
1 parent ac5ae422

new stuff here

stim/biomodels/network.h
... ... @@ -79,7 +79,7 @@ class network{
79 79  
80 80 }
81 81 */
82   - edge(std::vector<stim::vec3<T> p, std::vector<T> s)
  82 + edge(std::vector<stim::vec3<T> > p, std::vector<T> s)
83 83 : cylinder<T>(p,s)
84 84 {
85 85 }
... ...
stim/visualization/cylinder.h
... ... @@ -54,13 +54,15 @@ public:
54 54 {
55 55 R = s;
56 56 init();
57   - {
  57 + }
58 58  
  59 +/*
59 60 cylinder(stim::centerline<T> p, std::vector<T> s)
60 61 {
61   - d = s;
  62 + d = p;
62 63 init();
63   - {
  64 + }
  65 +*/
64 66  
65 67 //cylinder(centerline<T>c, T r) : centerline(c) {
66 68 // init();
... ...
stim/visualization/gl_network.h
... ... @@ -156,9 +156,11 @@ public:
156 156 }
157 157  
158 158 ///render the network cylinder as a series of tubes(when only one network loaded)
159   - void glCylinder0() {
  159 + void glCylinder0(T scale = 1.0f, bool undo = false) {
160 160  
161 161 float r1, r2;
  162 + if (undo == true)
  163 + glDeleteLists(dlist, 1); // delete display list
162 164 if (!glIsList(dlist)) { // if dlist isn't a display list, create it
163 165 dlist = glGenLists(1); // generate a display list
164 166 glNewList(dlist, GL_COMPILE); // start a new display list
... ... @@ -167,10 +169,10 @@ public:
167 169 stim::circle<T> C1 = E[e].circ(p - 1);
168 170 stim::circle<T> C2 = E[e].circ(p);
169 171 r1 = E[e].r(p - 1);
170   - r2 = E[e].r(p);
171   - C1.set_R(r1); // re-scale the circle to the same
172   - C2.set_R(r2);
173   - std::vector< stim::vec3<T> > Cp1 = C1.glpoints(20);// get 20 points on the circle plane
  172 + r2 = E[e].r(p);
  173 + C1.set_R(scale * r1); // re-scale the circle to the same
  174 + C2.set_R(scale * r2);
  175 + std::vector< stim::vec3<T> > Cp1 = C1.glpoints(20); // get 20 points on the circle plane
174 176 std::vector< stim::vec3<T> > Cp2 = C2.glpoints(20);
175 177 glBegin(GL_QUAD_STRIP);
176 178 for (unsigned i = 0; i < Cp1.size(); i++) {
... ... @@ -183,11 +185,11 @@ public:
183 185 for (unsigned n = 0; n < V.size(); n++) {
184 186 for (unsigned i = 0; i < E.size(); i++) {
185 187 if (E[i].v[0] == n) {
186   - r1 = E[i].r(0);
  188 + r1 = E[i].r(0) * scale;
187 189 break;
188 190 }
189 191 else if (E[i].v[1] == n) {
190   - r1 = E[i].r(E[i].size() - 1);
  192 + r1 = E[i].r(E[i].size() - 1) * scale;
191 193 break;
192 194 }
193 195 }
... ...