source: issm/oecreview/Archive/11961-11984/ISSM-11968-11969.diff@ 11991

Last change on this file since 11991 was 11991, checked in by Eric.Larour, 13 years ago

oecreview from 11518 to present

File size: 2.6 KB
  • proj/ice/larour/issm-uci-clean/trunk-jpl/src/mex/TriMesh/TriMesh.h

     
    1212#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    1313#endif
    1414
     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
    1520#include "../../c/include/globals.h"
     21#include "../../c/toolkits/toolkits.h"
    1622#include "../../c/include/include.h"
    1723#include "../../c/modules/modules.h"
    1824#include "../../c/Container/Container.h"
     
    3440#define SEGMENTMARKERLIST (mxArray**)&plhs[4]
    3541
    3642#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)
    3748
     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
    3857/* local prototypes: */
    3958void TriMeshUsage(void);
    4059
  • proj/ice/larour/issm-uci-clean/trunk-jpl/src/mex/TriMesh/TriMesh.cpp

     
    44
    55#include "./TriMesh.h"
    66
    7 WRAPPER(TriMesh, char* DOMAINOUTLINE, double AREA, bool ORDER){
     7WRAPPER(TriMesh){
    88       
    99        /* input: */
    1010        char*  domainname=NULL;
     
    3232        FetchData(&area,AREA);
    3333        FetchData(&order,ORDER);
    3434
     35
    3536        /*Read domain outline: */
    3637        domain=DomainOutlineRead(domainname,false);
    3738
    3839        /*call x core: */
    3940        TriMeshx(&index,&x,&y,&segments,&segmentmarkerlist,domain,area,order);
    40 
     41       
     42       
    4143        /*write outputs: */
    4244        WriteData(INDEX,index);
    4345        WriteData(X,x);
     
    5557
    5658        /*end module: */
    5759        MODULEEND();
     60
    5861}
    5962
    60 void TriMeshUsage(void)
     63void TriMeshUsage(void) //{{{1
    6164{
    6265        printf("\n");
    6366        printf("   usage: [index,x,y,segments,segmentmarkers]=TriMesh(domainoutlinefilename,area,ordered) \n");
     
    6972        printf("      order they are made by Triangle (ie none), or ordered counter clockwise around the domain outline.\n");
    7073        printf("\n");
    7174}
    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.