Commit df480014be517aacc903e99bf78495068f69b988
1 parent
964b4898
added in comments the code to call resampling function
Showing
1 changed file
with
13 additions
and
6 deletions
Show diff stats
stim/biomodels/network.h
... | ... | @@ -53,7 +53,7 @@ class network{ |
53 | 53 | public: |
54 | 54 | //std::vector<unsigned int> edges; //indices of edges connected to this node. |
55 | 55 | std::vector<unsigned int> e[2]; //indices of edges going out (e[0]) and coming in (e[1]) |
56 | - //stim::vec<T> p; //position of this node in physical space. | |
56 | + //stim::vec<T> p; //position of this node in physical space. | |
57 | 57 | |
58 | 58 | //constructor takes a stim::vec |
59 | 59 | vertex(stim::vec<T> p) : stim::vec<T>(p){} |
... | ... | @@ -102,7 +102,7 @@ class network{ |
102 | 102 | stim::obj<T> O; //create an OBJ object |
103 | 103 | O.load(filename); //load the OBJ file as an object |
104 | 104 | |
105 | - //grab each line in the OBJ object - these will be fibers | |
105 | + //prints each line in the obj file - vertex positions and fibers | |
106 | 106 | std::cout<<O.str()<<std::endl; |
107 | 107 | |
108 | 108 | std::vector<unsigned> id2vert; //this list stores the OBJ vertex ID associated with each network vertex |
... | ... | @@ -115,7 +115,7 @@ class network{ |
115 | 115 | std::vector< stim::vec<T> > c; //allocate an array of points for the vessel centerline |
116 | 116 | O.getLine(l, c); //get the fiber centerline |
117 | 117 | |
118 | - edge e(c); //create an edge from the given centerline | |
118 | + edge e = c; //create an edge from the given centerline | |
119 | 119 | |
120 | 120 | //get the first and last vertex IDs for the line |
121 | 121 | std::vector< unsigned > id; //create an array to store the centerline point IDs |
... | ... | @@ -137,7 +137,7 @@ class network{ |
137 | 137 | id2vert.push_back(i[0]); //add the ID to the ID->vertex conversion list |
138 | 138 | } |
139 | 139 | else{ //if the vertex already exists |
140 | - V[it_idx].e[0].push_back(E.size()); //add the current edge as outgoing | |
140 | + V[it_idx].e[0].push_back(E.size()); //add the current edge as outgoing | |
141 | 141 | e.v[0] = it_idx; |
142 | 142 | } |
143 | 143 | |
... | ... | @@ -151,10 +151,17 @@ class network{ |
151 | 151 | id2vert.push_back(i[1]); //add the ID to the ID->vertex conversion list |
152 | 152 | } |
153 | 153 | else{ //if the vertex already exists |
154 | - V[it_idx].e[1].push_back(E.size()); //add the current edge as incoming | |
154 | + V[it_idx].e[1].push_back(E.size()); //add the current edge as incoming | |
155 | 155 | e.v[1] = it_idx; |
156 | 156 | } |
157 | - | |
157 | + /*lines to be added for resampling each fiber in the network class | |
158 | + //std::vector< stim::vec<T> > newFiberPos, fiberPos; | |
159 | + //fiberPos = e.centerline(); | |
160 | + //newFiberPos = e.Resample(fiberPos); | |
161 | + //edge newEdge = newFiberPos; | |
162 | + //E.push_back(newEdge); | |
163 | + */ | |
164 | + | |
158 | 165 | E.push_back(e); //push the edge to the list |
159 | 166 | |
160 | 167 | } | ... | ... |