Skip to content

Commit 24aac65

Browse files
committed
Commit C source
1 parent af53f95 commit 24aac65

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

gdist.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import ctypes
2+
3+
import numpy as np
4+
5+
lib = ctypes.CDLL('./gdist_c_api.so')
6+
# build numpy arrays etc
7+
print(lib.computeGdist(1, 1, 1, 1))

gdist_c_api.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include <iostream>
2+
#include <fstream>
3+
4+
#include "geodesic_library/geodesic_algorithm_exact.h"
5+
6+
extern "C" {
7+
double computeGdist(int numberOfVertices, int numberOfTriangles, double *vertices, double *triangles);
8+
};
9+
10+
double computeGdist(int numberOfVertices, int numberOfTriangles, double *vertices, double *triangles) {
11+
return 1.0;
12+
}

geodesic_library/gdist.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* read mesh from file and
2+
- if one vertex is specified, for all vertices of the mesh print their distances to this vertex
3+
- if two vertices are specified, print the shortest path between these vertices
4+
5+
Danil Kirsanov, 01/2008
6+
Minor cleanup, 2011, SAK.
7+
*/
8+
#include <iostream>
9+
#include <fstream>
10+
11+
#include "geodesic_algorithm_exact.h"
12+
13+
extern "C" {
14+
double computeGdist(int numberOfVertices, int numberOfTriangles, double *vertices, double *triangles) {
15+
return computeGdistCpp(numberOfVertices, numberOfTriangles, vertices, triangles);
16+
}
17+
}
18+
19+
double computeGdistCpp(int numberOfVertices, int numberOfTriangles, double *vertices, double *triangles) {
20+
return 1.0;
21+
}

0 commit comments

Comments
 (0)