Changeset 12093 for issm/trunk-jpl/src/c
- Timestamp:
- 04/20/12 15:02:46 (13 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/Makefile.am
r12074 r12093 793 793 ./modules/TriMeshx/TriMeshx.h\ 794 794 ./modules/TriMeshx/TriMeshx.cpp\ 795 ./modules/TriMeshRiftsx/TriMeshRiftsx.h\796 ./modules/TriMeshRiftsx/TriMeshRiftsx.cpp\797 795 ./modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h\ 798 796 ./modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp\ -
issm/trunk-jpl/src/c/modules/TriMeshRiftsx/TriMeshRiftsx.cpp
r12063 r12093 20 20 /*}}}*/ 21 21 22 void TriMeshRiftsx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area ,bool order){22 void TriMeshRiftsx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){ 23 23 24 24 /*indexing: */ … … 48 48 in.numberofpoints+=contour->nods; 49 49 } 50 if (rifts){ 51 for (i=0;i<rifts->Size();i++){ 52 contour=(Contour*)rifts->GetObjectByOffset(i); 53 in.numberofpoints+=contour->nods; 54 } 55 } 50 for (i=0;i<rifts->Size();i++){ 51 contour=(Contour*)rifts->GetObjectByOffset(i); 52 in.numberofpoints+=contour->nods; 53 } 54 56 55 /*number of point attributes: */ 57 56 in.numberofpointattributes=1; … … 69 68 } 70 69 } 71 if(rifts){ 72 for (i=0;i<rifts->Size();i++){ 73 contour=(Contour*)rifts->GetObjectByOffset(i); 74 for (j=0;j<contour->nods;j++){ 75 in.pointlist[2*counter+0]=contour->x[j]; 76 in.pointlist[2*counter+1]=contour->y[j]; 77 counter++; 78 } 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++; 79 76 } 80 77 } … … 94 91 in.numberofsegments+=contour->nods; 95 92 } 96 if(rifts){ 97 for(i=0;i<rifts->Size();i++){ 98 contour=(Contour*)rifts->GetObjectByOffset(i); 99 /*for rifts, we have one less segment as we have vertices*/ 100 in.numberofsegments+=contour->nods-1; 101 } 93 for(i=0;i<rifts->Size();i++){ 94 contour=(Contour*)rifts->GetObjectByOffset(i); 95 /*for rifts, we have one less segment as we have vertices*/ 96 in.numberofsegments+=contour->nods-1; 102 97 } 103 98 … … 122 117 } 123 118 counter2=counter; 124 if(rifts){ 125 for (i=0;i<rifts->Size();i++){ 126 contour=(Contour*)rifts->GetObjectByOffset(i); 127 for (j=0;j<(contour->nods-1);j++){ 128 in.segmentlist[2*counter2+0]=counter; 129 in.segmentlist[2*counter2+1]=counter+1; 130 in.segmentmarkerlist[counter2]=2+i; 131 counter2++; 132 counter++; 133 } 134 counter++; 135 } 119 for (i=0;i<rifts->Size();i++){ 120 contour=(Contour*)rifts->GetObjectByOffset(i); 121 for (j=0;j<(contour->nods-1);j++){ 122 in.segmentlist[2*counter2+0]=counter; 123 in.segmentlist[2*counter2+1]=counter+1; 124 in.segmentmarkerlist[counter2]=2+i; 125 counter2++; 126 counter++; 127 } 128 counter++; 136 129 } 137 130 … … 196 189 197 190 /*Order segments so that their normals point outside the domain: */ 198 if(order){ 199 OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles); 200 } 191 OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles); 201 192 202 193 /*Output : */ -
issm/trunk-jpl/src/c/modules/TriMeshRiftsx/TriMeshRiftsx.h
r12063 r12093 11 11 12 12 /* local prototypes: */ 13 void TriMeshRiftsx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area ,bool order);13 void TriMeshRiftsx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area); 14 14 15 15 #endif /* _TRIMESHX_H */ -
issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp
r12061 r12093 20 20 /*}}}*/ 21 21 22 void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain, double area,bool order){22 void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){ 23 23 24 24 /*indexing: */ … … 35 35 36 36 /*intermediary: */ 37 int counter, backcounter;37 int counter,counter2,backcounter; 38 38 Contour* contour=NULL; 39 39 … … 48 48 in.numberofpoints+=contour->nods; 49 49 } 50 for (i=0;i<rifts->Size();i++){ 51 contour=(Contour*)rifts->GetObjectByOffset(i); 52 in.numberofpoints+=contour->nods; 53 } 54 50 55 /*number of point attributes: */ 51 56 in.numberofpointattributes=1; … … 63 68 } 64 69 } 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 } 65 78 66 79 /*fill in the point attribute list: */ 67 in.pointattributelist = (REAL *) xmalloc(in.numberofpoints * in.numberofpointattributes *sizeof(REAL));80 in.pointattributelist = (REAL*)xmalloc(in.numberofpoints*in.numberofpointattributes*sizeof(REAL)); 68 81 for (i=0;i<in.numberofpoints;i++) in.pointattributelist[i] = 0.0; 69 82 … … 77 90 contour=(Contour*)domain->GetObjectByOffset(i); 78 91 in.numberofsegments+=contour->nods; 92 } 93 for(i=0;i<rifts->Size();i++){ 94 contour=(Contour*)rifts->GetObjectByOffset(i); 95 /*for rifts, we have one less segment as we have vertices*/ 96 in.numberofsegments+=contour->nods-1; 79 97 } 80 98 … … 97 115 counter++; 98 116 backcounter=counter; 117 } 118 counter2=counter; 119 for (i=0;i<rifts->Size();i++){ 120 contour=(Contour*)rifts->GetObjectByOffset(i); 121 for (j=0;j<(contour->nods-1);j++){ 122 in.segmentlist[2*counter2+0]=counter; 123 in.segmentlist[2*counter2+1]=counter+1; 124 in.segmentmarkerlist[counter2]=2+i; 125 counter2++; 126 counter++; 127 } 128 counter++; 99 129 } 100 130 … … 159 189 160 190 /*Order segments so that their normals point outside the domain: */ 161 if(order){ 162 OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles); 163 } 191 OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles); 164 192 165 193 /*Output : */ -
issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h
r12056 r12093 7 7 8 8 #include "string.h" 9 10 9 #include "../../Container/Container.h" 11 10 #include "../../objects/objects.h" 12 11 13 12 /* local prototypes: */ 14 void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain, double area,bool order);13 void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area); 15 14 16 15 #endif /* _TRIMESHX_H */ -
issm/trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp
r11935 r12093 14 14 15 15 int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname,bool whole=true){ 16 17 16 18 17 /*indexing: */ … … 128 127 DataSet* DomainOutlineRead(char* domainname,bool whole=true){ 129 128 130 /*indexing: */131 int i;132 133 129 /*intermediary: */ 134 int nprof; 135 int* profnvertices=NULL; 136 double** pprofx=NULL; 137 double** pprofy=NULL; 138 139 Contour* contour=NULL; 130 int nprof; 131 int *profnvertices = NULL; 132 double **pprofx = NULL; 133 double **pprofy = NULL; 134 Contour *contour = NULL; 140 135 141 136 /*output: */ 142 137 DataSet* domain=NULL; 143 138 144 /*get domain outline from intermediary function:*/ 145 DomainOutlineRead(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname,whole); 139 /*If domainname is an empty string, return empty dataset*/ 140 if (strcmp(domainname,"")==0){ 141 nprof=0; 142 } 143 else{ 144 DomainOutlineRead(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname,whole); 145 } 146 146 147 147 /*now create dataset of contours: */ 148 148 domain=new DataSet(0); 149 149 150 for(i =0;i<nprof;i++){150 for(int i=0;i<nprof;i++){ 151 151 domain->AddObject(new Contour(i,profnvertices[i],pprofx[i],pprofy[i],1)); 152 152 } 153 154 153 return domain; 155 154 }
Note:
See TracChangeset
for help on using the changeset viewer.