Changeset 12098
- Timestamp:
- 04/20/12 15:44:32 (13 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp
r11554 r12098 61 61 /* read exp file */ 62 62 63 if (!DomainOutlineRead(&nprof,&pnvert,&pprofx,&pprofy,&closed,filexp ,true))63 if (!DomainOutlineRead(&nprof,&pnvert,&pprofx,&pprofy,&closed,filexp)) 64 64 _error_("Error reading exp file."); 65 65 _printf_(true,"Exp2Kmlx -- Reading %d exp profiles from file \"%s\".\n",nprof,filexp); -
issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp
r12093 r12098 46 46 for (i=0;i<domain->Size();i++){ 47 47 contour=(Contour*)domain->GetObjectByOffset(i); 48 in.numberofpoints+=contour->nods ;48 in.numberofpoints+=contour->nods-1; 49 49 } 50 50 for (i=0;i<rifts->Size();i++){ … … 62 62 for (i=0;i<domain->Size();i++){ 63 63 contour=(Contour*)domain->GetObjectByOffset(i); 64 for (j=0;j<contour->nods-1;j++){ 65 in.pointlist[2*counter+0]=contour->x[j]; 66 in.pointlist[2*counter+1]=contour->y[j]; 67 counter++; 68 } 69 } 70 for (i=0;i<rifts->Size();i++){ 71 contour=(Contour*)rifts->GetObjectByOffset(i); 64 72 for (j=0;j<contour->nods;j++){ 65 73 in.pointlist[2*counter+0]=contour->x[j]; … … 68 76 } 69 77 } 70 for (i=0;i<rifts->Size();i++){71 contour=(Contour*)rifts->GetObjectByOffset(i);72 for (j=0;j<contour->nods;j++){73 in.pointlist[2*counter+0]=contour->x[j];74 in.pointlist[2*counter+1]=contour->y[j];75 counter++;76 }77 }78 78 79 79 /*fill in the point attribute list: */ … … 89 89 for (i=0;i<domain->Size();i++){ 90 90 contour=(Contour*)domain->GetObjectByOffset(i); 91 in.numberofsegments+=contour->nods ;91 in.numberofsegments+=contour->nods-1; 92 92 } 93 93 for(i=0;i<rifts->Size();i++){ … … 103 103 for (i=0;i<domain->Size();i++){ 104 104 contour=(Contour*)domain->GetObjectByOffset(i); 105 for (j=0;j<contour->nods- 1;j++){105 for (j=0;j<contour->nods-2;j++){ 106 106 in.segmentlist[2*counter+0]=counter; 107 107 in.segmentlist[2*counter+1]=counter+1; … … 138 138 for (i=0;i<domain->Size()-1;i++){ 139 139 contour=(Contour*)domain->GetObjectByOffset(i+1); 140 GridInsideHole(&in.holelist[2*i+0],&in.holelist[2*i+1],contour->nods ,contour->x,contour->y);140 GridInsideHole(&in.holelist[2*i+0],&in.holelist[2*i+1],contour->nods-1,contour->x,contour->y); 141 141 } 142 142 } -
issm/trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp
r12093 r12098 13 13 #include "../../Container/DataSet.h" 14 14 15 int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname ,bool whole=true){15 int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname){ 16 16 17 17 /*indexing: */ … … 101 101 if((x[0]==x[n-1]) && (y[0]==y[n-1])){ 102 102 cl=true; 103 if (!whole) {104 n=n-1;105 }106 103 } 107 104 … … 125 122 } 126 123 127 DataSet* DomainOutlineRead(char* domainname ,bool whole=true){124 DataSet* DomainOutlineRead(char* domainname){ 128 125 129 126 /*intermediary: */ … … 142 139 } 143 140 else{ 144 DomainOutlineRead(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname ,whole);141 DomainOutlineRead(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname); 145 142 } 146 143 -
issm/trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp
r9320 r12098 11 11 #include "../Exceptions/exceptions.h" 12 12 13 int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname ,bool whole=true){13 int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname){ 14 14 15 15 … … 20 20 /*I/O: */ 21 21 FILE* fid=NULL; 22 23 /*input: */24 // int nprof; //number of profiles in the domainname file25 // int* profnvertices=NULL; //array holding the number of vertices for the nprof profiles26 // double** pprofx=NULL; //array of profiles x coordinates27 // double** pprofy=NULL; //array of profiles y coordinates28 // bool* closed=NULL; //array holding closed flags for the nprof profiles29 22 30 23 /*open domain outline file for writing: */ … … 43 36 44 37 /*Write number of profile vertices: */ 45 if(closed[counter] && !whole) 46 fprintf(fid,"%u %s\n",profnvertices[counter]+1,"1."); 47 else 48 fprintf(fid,"%u %s\n",profnvertices[counter] ,"1."); 38 fprintf(fid,"%u %s\n",profnvertices[counter] ,"1."); 49 39 50 40 /*Write next line: */ … … 55 45 fprintf(fid,"%lf\t%lf\n",pprofx[counter][i],pprofy[counter][i]); 56 46 } 57 58 /*Now check that we are dealing with open contours: */59 if(closed[counter] && !whole)60 fprintf(fid,"%lf\t%lf\n",pprofx[counter][0],pprofy[counter][0]);61 47 62 48 /*Write blank line: */ -
issm/trunk-jpl/src/c/shared/Exp/exp.h
r11935 r12098 13 13 int IsOutsidePoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue); 14 14 int IsInPolySerial(double* in,double* xc,double* yc,int numvertices,double* x,double* y,int nods, int edgevalue); 15 int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname ,bool whole);15 int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname); 16 16 int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue); 17 17 18 int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname ,bool whole);19 DataSet* DomainOutlineRead(char* domainname ,bool whole);18 int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname); 19 DataSet* DomainOutlineRead(char* domainname); 20 20 21 21 -
issm/trunk-jpl/src/modules/TriMesh/TriMesh.cpp
r12093 r12098 35 35 36 36 /*Read domain outline: */ 37 domain = DomainOutlineRead(domainname ,false);38 rifts = DomainOutlineRead(riftsname ,false);37 domain = DomainOutlineRead(domainname); 38 rifts = DomainOutlineRead(riftsname); 39 39 40 40 /*call x core: */
Note:
See TracChangeset
for help on using the changeset viewer.