Changeset 8737
- Timestamp:
- 06/28/11 10:24:16 (14 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp ¶
r8716 r8737 31 31 int *pnvert=NULL; 32 32 double **pprofx=NULL,**pprofy=NULL; 33 bool *closed=NULL; 33 34 double *lat=NULL,*lon=NULL; 34 35 … … 52 53 /* read exp file */ 53 54 54 if (!DomainOutlineRead(&nprof,&pnvert,&pprofx,&pprofy, filexp))55 if (!DomainOutlineRead(&nprof,&pnvert,&pprofx,&pprofy,&closed,filexp)) 55 56 _error_("Error reading exp file."); 56 57 -
TabularUnified issm/trunk/src/c/shared/Exp/DomainOutlineRead.cpp ¶
r8301 r8737 11 11 #include "../Exceptions/exceptions.h" 12 12 13 int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy, char* domainname){13 int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname){ 14 14 15 15 … … 29 29 double** pprofx=NULL; //array of profiles x coordinates 30 30 double** pprofy=NULL; //array of profiles y coordinates 31 bool* closed=NULL; //array holding closed flags for the nprof profiles 31 32 32 33 /*For each profile: */ … … 34 35 double* x=NULL; 35 36 double* y=NULL; 37 bool cl; 36 38 37 39 /*open domain outline file for reading: */ … … 68 70 pprofy[i]=NULL; 69 71 } 72 closed=(bool*)xmalloc(nprof*sizeof(bool)); 70 73 71 74 /*Reaset file pointer to beginning of file: */ … … 97 100 98 101 /*Now check that we are dealing with open contours: */ 102 cl=false; 99 103 if((x[0]==x[n-1]) && (y[0]==y[n-1])){ 100 104 n=n-1; 105 cl=true; 101 106 } 102 107 … … 105 110 pprofx[counter]=x; 106 111 pprofy[counter]=y; 112 closed[counter]=cl; 107 113 } 108 114 … … 123 129 *ppprofx=pprofx; 124 130 *ppprofy=pprofy; 131 if(pclosed)*pclosed=closed; 132 else xfree((void**)&closed); 125 133 return noerr; 126 134 } -
TabularUnified issm/trunk/src/c/shared/Exp/exp.h ¶
r8301 r8737 12 12 int IsOutsidePoly(Vec in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue); 13 13 int IsInPolySerial(double* in,double* xc,double* yc,int numvertices,double* x,double* y,int nods, int edgevalue); 14 int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy, char* domainname);14 int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname); 15 15 int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue); 16 16 -
TabularUnified issm/trunk/src/mex/TriMesh/TriMesh.cpp ¶
r8306 r8737 96 96 97 97 /*Start reading the domain outline file: */ 98 if(!DomainOutlineRead(&nprof,&profnvertices,&pprofx,&pprofy, domainname)){98 if(!DomainOutlineRead(&nprof,&profnvertices,&pprofx,&pprofy,NULL,domainname)){ 99 99 printf("%s%s%s\n",__FUNCT__," error message reading domain outline ",domainname); 100 100 mexErrMsgTxt(" "); … … 103 103 /*Read rifts file if present: */ 104 104 if(riftname){ 105 if(!DomainOutlineRead(&numrifts,&riftsnumvertices,&riftsverticesx,&riftsverticesy, riftname)){105 if(!DomainOutlineRead(&numrifts,&riftsnumvertices,&riftsverticesx,&riftsverticesy,NULL,riftname)){ 106 106 printf("%s%s%s\n",__FUNCT__," error message reading rifts outline ",riftname); 107 107 mexErrMsgTxt(" "); -
TabularUnified issm/trunk/src/mex/TriMeshNoDensity/TriMeshNoDensity.cpp ¶
r8306 r8737 86 86 87 87 /*Start reading the domain outline file: */ 88 if(!DomainOutlineRead(&nprof,&profnvertices,&pprofx,&pprofy, domainname)){88 if(!DomainOutlineRead(&nprof,&profnvertices,&pprofx,&pprofy,NULL,domainname)){ 89 89 printf("%s%s%s\n",__FUNCT__," error message reading domain outline ",domainname); 90 90 mexErrMsgTxt(" "); … … 93 93 /*Read rifts file if present: */ 94 94 if(riftname){ 95 if(!DomainOutlineRead(&numrifts,&riftsnumvertices,&riftsverticesx,&riftsverticesy, riftname)){95 if(!DomainOutlineRead(&numrifts,&riftsnumvertices,&riftsverticesx,&riftsverticesy,NULL,riftname)){ 96 96 printf("%s%s%s\n",__FUNCT__," error message reading rifts outline ",riftname); 97 97 mexErrMsgTxt(" ");
Note:
See TracChangeset
for help on using the changeset viewer.