source:
issm/oecreview/Archive/11961-11984/ISSM-11968-11969.diff@
11991
Last change on this file since 11991 was 11991, checked in by , 13 years ago | |
---|---|
File size: 2.6 KB |
-
proj/ice/larour/issm-uci-clean/trunk-jpl/src/mex/TriMesh/TriMesh.h
12 12 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" 13 13 #endif 14 14 15 /*Very important definition in case we are compiling a python module!: needs to come before header files inclusion*/ 16 #ifdef _HAVE_PYTHON_ 17 #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol 18 #endif 19 15 20 #include "../../c/include/globals.h" 21 #include "../../c/toolkits/toolkits.h" 16 22 #include "../../c/include/include.h" 17 23 #include "../../c/modules/modules.h" 18 24 #include "../../c/Container/Container.h" … … 34 40 #define SEGMENTMARKERLIST (mxArray**)&plhs[4] 35 41 36 42 #endif 43 #ifdef _HAVE_PYTHON_ 44 /* serial input macros: */ 45 #define DOMAINOUTLINE PyTuple_GetItem(args,0) 46 #define AREA PyTuple_GetItem(args,1) 47 #define ORDER PyTuple_GetItem(args,2) 37 48 49 /* serial output macros: */ 50 #define INDEX output,0 51 #define X output,1 52 #define Y output,2 53 #define SEGMENTS output,3 54 #define SEGMENTMARKERLIST output,4 55 #endif 56 38 57 /* local prototypes: */ 39 58 void TriMeshUsage(void); 40 59 -
proj/ice/larour/issm-uci-clean/trunk-jpl/src/mex/TriMesh/TriMesh.cpp
4 4 5 5 #include "./TriMesh.h" 6 6 7 WRAPPER(TriMesh , char* DOMAINOUTLINE, double AREA, bool ORDER){7 WRAPPER(TriMesh){ 8 8 9 9 /* input: */ 10 10 char* domainname=NULL; … … 32 32 FetchData(&area,AREA); 33 33 FetchData(&order,ORDER); 34 34 35 35 36 /*Read domain outline: */ 36 37 domain=DomainOutlineRead(domainname,false); 37 38 38 39 /*call x core: */ 39 40 TriMeshx(&index,&x,&y,&segments,&segmentmarkerlist,domain,area,order); 40 41 42 41 43 /*write outputs: */ 42 44 WriteData(INDEX,index); 43 45 WriteData(X,x); … … 55 57 56 58 /*end module: */ 57 59 MODULEEND(); 60 58 61 } 59 62 60 void TriMeshUsage(void) 63 void TriMeshUsage(void) //{{{1 61 64 { 62 65 printf("\n"); 63 66 printf(" usage: [index,x,y,segments,segmentmarkers]=TriMesh(domainoutlinefilename,area,ordered) \n"); … … 69 72 printf(" order they are made by Triangle (ie none), or ordered counter clockwise around the domain outline.\n"); 70 73 printf("\n"); 71 74 } 72 73 74 #ifdef _HAVE_PYTHON_ 75 BOOST_PYTHON_MODULE(TriMesh){ 76 boost::python::numeric::array::set_module_and_type( "numpy", "ndarray"); 77 def("TriMesh",TriMesh); 78 } 79 #endif 75 //}}}
Note:
See TracBrowser
for help on using the repository browser.