Commit 018bda334328ef185e363968e349e227b01d51ff
1 parent
17647f6e
added functions to return all the nodes and return index of a node
Showing
1 changed file
with
22 additions
and
0 deletions
Show diff stats
stim/visualization/obj.h
... | ... | @@ -550,6 +550,28 @@ public: |
550 | 550 | stim::vec<T> v = V[vi]; |
551 | 551 | return v; |
552 | 552 | } |
553 | + std::vector< stim::vec<T> > getAllV(std::vector<unsigned> vertexIndices){ | |
554 | + std::vector< stim::vec<T> > allVerticesList; | |
555 | + for (int i=0; i<numV(); i++) | |
556 | + { | |
557 | + vertexIndices[i] = i + 1; | |
558 | + } | |
559 | + allVerticesList = getV(vertexIndices); | |
560 | + return allVerticesList; | |
561 | + } | |
562 | + int | |
563 | + getIndex(std::vector< stim::vec<T> >allVerticesList, stim::vec<T> v0) | |
564 | + { | |
565 | + int result = 0; | |
566 | + for (int i = 0; i < allVerticesList.size() ; i++) | |
567 | + { | |
568 | + if (allVerticesList[i] == v0) | |
569 | + { | |
570 | + result = i; | |
571 | + } | |
572 | + } | |
573 | + return result; | |
574 | + } | |
553 | 575 | |
554 | 576 | /// Retrieve the vertex texture coordinate at index i |
555 | 577 | /// @param vti is the desired index | ... | ... |