diff options
author | mcarrier <mcarrier@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2017-01-26 17:46:25 +0000 |
---|---|---|
committer | mcarrier <mcarrier@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2017-01-26 17:46:25 +0000 |
commit | 8684c0b834ef4da54bf8246dbf918b553d9222b8 (patch) | |
tree | 498fbd7df48380d958d56bed570aa34d39dbc99b /src/Nerve_GIC/example/graph_off.cpp | |
parent | b3654bd1ac7d38aaac0550de063158dbdf96522f (diff) |
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/Nerve_GIC@2015 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: fdaf0e66eaae7539080af7bada668f32e7ae1dc0
Diffstat (limited to 'src/Nerve_GIC/example/graph_off.cpp')
-rw-r--r-- | src/Nerve_GIC/example/graph_off.cpp | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/Nerve_GIC/example/graph_off.cpp b/src/Nerve_GIC/example/graph_off.cpp deleted file mode 100644 index 574d9fc6..00000000 --- a/src/Nerve_GIC/example/graph_off.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include <iostream> -#include <set> -#include <fstream> -#include <vector> -#include <string.h> -#include <sstream> -#include <stdlib.h> -#include <algorithm> - -using namespace std; - -int main (int argc, char **argv) { - - char* const fileoff = argv[1]; ifstream input(fileoff); char ngoff[100]; sprintf(ngoff,"%s_NG", fileoff); ofstream output(ngoff); - char buf[256]; - vector<vector<int> > NG; - - input.getline(buf, 255); // skip "OFF" - int n, m; - input >> n >> m; - input.getline(buf, 255); // skip "0" - - // read vertices - double x,y,z; vector<int> ng; int nn = n; - while(nn-->0) { - input >> x >> z >> y; NG.push_back(ng); - } - - // read triangles - int d, p, q, s; - while (m-->0) { - input >> d >> p >> q >> s; - NG[p].push_back(q); NG[p].push_back(s); - NG[q].push_back(p); NG[q].push_back(s); - NG[s].push_back(q); NG[s].push_back(p); - } - - for(int i = 0; i < n; i++){ - vector<int> ng = NG[i]; - sort(ng.begin(),ng.end()); vector<int>::iterator iter = unique(ng.begin(),ng.end()); ng.resize(distance(ng.begin(),iter)); - int size = ng.size(); - for(int j = 0; j < size; j++) - output << ng[j] << " "; - output << endl; - } - - return 0; - -} |