Changeset 11935


Ignore:
Timestamp:
04/05/12 14:50:15 (13 years ago)
Author:
Eric.Larour
Message:

Sent ModuleEnd and ModuleBoot to Wrapper (not Matlab related).
New DomainOutlineRead overloaded prototype to return a dataset.

Location:
issm/trunk-jpl/src/c/shared
Files:
4 added
3 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp

    r9320 r11935  
    99#include "../Alloc/alloc.h"
    1010#include "../../include/include.h"
     11#include "../../objects/objects.h"
    1112#include "../Exceptions/exceptions.h"
     13#include "../../Container/DataSet.h"
    1214
    1315int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname,bool whole=true){
    1416
    1517       
    16         /*Error management: */
    17         int noerr=1;
     18        /*indexing: */
    1819        int i,counter;
    1920
     
    3940        if ((fid=fopen(domainname,"r"))==NULL){
    4041                _error_("%s%s","could not find domain file ",domainname);
    41                 noerr=0; goto cleanupandreturn;
    4242        }
    4343
     
    9595                /*Read vertices: */
    9696                for (i=0;i<n;i++){
    97                         fscanf(fid,"%20lf %20lf\n",x+i,y+i);
     97                        fscanf(fid,"%20lf %20lf\n",&x[i],&y[i]);
    9898                }
    9999
     
    117117        fclose(fid);
    118118
    119         cleanupandreturn:
    120         /*Free ressources: */
    121         if(!noerr){
    122                 xfree((void**)&x);
    123                 xfree((void**)&y);
    124                 n=-1;
    125         }
    126        
    127119        /*Assign output pointers: */
    128120        *pnprof=nprof;
     
    132124        if(pclosed)*pclosed=closed;
    133125        else       xfree((void**)&closed);
    134         return noerr;
    135126}
    136127
     128DataSet* DomainOutlineRead(char* domainname,bool whole=true){
     129
     130        /*indexing: */
     131        int i;
     132
     133        /*intermediary: */
     134        int nprof;
     135        int* profnvertices=NULL;
     136        double** pprofx=NULL;
     137        double** pprofy=NULL;
     138
     139        Contour* contour=NULL;
     140
     141        /*output: */
     142        DataSet* domain=NULL;
     143
     144        /*get domain outline from intermediary function:*/
     145        DomainOutlineRead(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname,whole);
     146
     147        /*now create dataset of contours: */
     148        domain=new DataSet(0);
     149
     150        for(i=0;i<nprof;i++){
     151                domain->AddObject(new Contour(i,profnvertices[i],pprofx[i],pprofy[i],1));
     152        }
     153
     154        return domain;
     155}
  • issm/trunk-jpl/src/c/shared/Exp/exp.h

    r11843 r11935  
    1313int IsOutsidePoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
    1414int IsInPolySerial(double* in,double* xc,double* yc,int numvertices,double* x,double* y,int nods, int edgevalue);
    15 int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname,bool whole);
    1615int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname,bool whole);
    1716int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue);
    1817
     18int      DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname,bool whole);
     19DataSet* DomainOutlineRead(char* domainname,bool whole);
     20
     21
    1922#endif
  • issm/trunk-jpl/src/c/shared/Matlab/CheckNumMatlabArguments.cpp

    r11853 r11935  
    33 */
    44
    5 #ifdef _SERIAL_
     5#ifdef HAVE_CONFIG_H
     6        #include <config.h>
     7#else
     8#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
     9#endif
     10
     11
     12#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    613
    714#include "../Exceptions/exceptions.h"
  • issm/trunk-jpl/src/c/shared/Matlab/matlabshared.h

    r11861 r11935  
    88#include "../../objects/objects.h"
    99
    10 
    11 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    12 int ModuleBoot(void);
    13 int ModuleEnd(void);
    14 #endif
    15 
    1610#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    1711#include "mex.h"
  • issm/trunk-jpl/src/c/shared/shared.h

    r9761 r11935  
    1919#include "Bamg/shared.h"
    2020#include "Matlab/matlabshared.h"
     21#include "Wrapper/wrappershared.h"
    2122
    2223#endif
Note: See TracChangeset for help on using the changeset viewer.