[11991] | 1 | Index: /proj/ice/larour/issm-uci-clean/trunk-jpl/src/mex/TriMesh/TriMesh.h
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- /proj/ice/larour/issm-uci-clean/trunk-jpl/src/mex/TriMesh/TriMesh.h (revision 11968)
|
---|
| 4 | +++ /proj/ice/larour/issm-uci-clean/trunk-jpl/src/mex/TriMesh/TriMesh.h (revision 11969)
|
---|
| 5 | @@ -12,7 +12,13 @@
|
---|
| 6 | #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
|
---|
| 7 | #endif
|
---|
| 8 |
|
---|
| 9 | +/*Very important definition in case we are compiling a python module!: needs to come before header files inclusion*/
|
---|
| 10 | +#ifdef _HAVE_PYTHON_
|
---|
| 11 | +#define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
|
---|
| 12 | +#endif
|
---|
| 13 | +
|
---|
| 14 | #include "../../c/include/globals.h"
|
---|
| 15 | +#include "../../c/toolkits/toolkits.h"
|
---|
| 16 | #include "../../c/include/include.h"
|
---|
| 17 | #include "../../c/modules/modules.h"
|
---|
| 18 | #include "../../c/Container/Container.h"
|
---|
| 19 | @@ -34,7 +40,20 @@
|
---|
| 20 | #define SEGMENTMARKERLIST (mxArray**)&plhs[4]
|
---|
| 21 |
|
---|
| 22 | #endif
|
---|
| 23 | +#ifdef _HAVE_PYTHON_
|
---|
| 24 | +/* serial input macros: */
|
---|
| 25 | +#define DOMAINOUTLINE PyTuple_GetItem(args,0)
|
---|
| 26 | +#define AREA PyTuple_GetItem(args,1)
|
---|
| 27 | +#define ORDER PyTuple_GetItem(args,2)
|
---|
| 28 |
|
---|
| 29 | +/* serial output macros: */
|
---|
| 30 | +#define INDEX output,0
|
---|
| 31 | +#define X output,1
|
---|
| 32 | +#define Y output,2
|
---|
| 33 | +#define SEGMENTS output,3
|
---|
| 34 | +#define SEGMENTMARKERLIST output,4
|
---|
| 35 | +#endif
|
---|
| 36 | +
|
---|
| 37 | /* local prototypes: */
|
---|
| 38 | void TriMeshUsage(void);
|
---|
| 39 |
|
---|
| 40 | Index: /proj/ice/larour/issm-uci-clean/trunk-jpl/src/mex/TriMesh/TriMesh.cpp
|
---|
| 41 | ===================================================================
|
---|
| 42 | --- /proj/ice/larour/issm-uci-clean/trunk-jpl/src/mex/TriMesh/TriMesh.cpp (revision 11968)
|
---|
| 43 | +++ /proj/ice/larour/issm-uci-clean/trunk-jpl/src/mex/TriMesh/TriMesh.cpp (revision 11969)
|
---|
| 44 | @@ -4,7 +4,7 @@
|
---|
| 45 |
|
---|
| 46 | #include "./TriMesh.h"
|
---|
| 47 |
|
---|
| 48 | -WRAPPER(TriMesh, char* DOMAINOUTLINE, double AREA, bool ORDER){
|
---|
| 49 | +WRAPPER(TriMesh){
|
---|
| 50 |
|
---|
| 51 | /* input: */
|
---|
| 52 | char* domainname=NULL;
|
---|
| 53 | @@ -32,12 +32,14 @@
|
---|
| 54 | FetchData(&area,AREA);
|
---|
| 55 | FetchData(&order,ORDER);
|
---|
| 56 |
|
---|
| 57 | +
|
---|
| 58 | /*Read domain outline: */
|
---|
| 59 | domain=DomainOutlineRead(domainname,false);
|
---|
| 60 |
|
---|
| 61 | /*call x core: */
|
---|
| 62 | TriMeshx(&index,&x,&y,&segments,&segmentmarkerlist,domain,area,order);
|
---|
| 63 | -
|
---|
| 64 | +
|
---|
| 65 | +
|
---|
| 66 | /*write outputs: */
|
---|
| 67 | WriteData(INDEX,index);
|
---|
| 68 | WriteData(X,x);
|
---|
| 69 | @@ -55,9 +57,10 @@
|
---|
| 70 |
|
---|
| 71 | /*end module: */
|
---|
| 72 | MODULEEND();
|
---|
| 73 | +
|
---|
| 74 | }
|
---|
| 75 |
|
---|
| 76 | -void TriMeshUsage(void)
|
---|
| 77 | +void TriMeshUsage(void) //{{{1
|
---|
| 78 | {
|
---|
| 79 | printf("\n");
|
---|
| 80 | printf(" usage: [index,x,y,segments,segmentmarkers]=TriMesh(domainoutlinefilename,area,ordered) \n");
|
---|
| 81 | @@ -69,11 +72,4 @@
|
---|
| 82 | printf(" order they are made by Triangle (ie none), or ordered counter clockwise around the domain outline.\n");
|
---|
| 83 | printf("\n");
|
---|
| 84 | }
|
---|
| 85 | -
|
---|
| 86 | -
|
---|
| 87 | -#ifdef _HAVE_PYTHON_
|
---|
| 88 | -BOOST_PYTHON_MODULE(TriMesh){
|
---|
| 89 | - boost::python::numeric::array::set_module_and_type( "numpy", "ndarray");
|
---|
| 90 | - def("TriMesh",TriMesh);
|
---|
| 91 | -}
|
---|
| 92 | -#endif
|
---|
| 93 | +//}}}
|
---|