[1105] | 1 | /*! \file ContourToNodesx.c
|
---|
| 2 | */
|
---|
| 3 |
|
---|
| 4 | #include "./ContourToNodesx.h"
|
---|
| 5 |
|
---|
[13229] | 6 | int ContourToNodesx(SeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue){
|
---|
[1105] | 7 |
|
---|
| 8 | int i;
|
---|
| 9 |
|
---|
| 10 | /*Contour:*/
|
---|
[13220] | 11 | Contour<IssmPDouble>* contouri=NULL;
|
---|
[8303] | 12 | int numnodes;
|
---|
[1105] | 13 | double* xc=NULL;
|
---|
| 14 | double* yc=NULL;
|
---|
| 15 | double value;
|
---|
| 16 |
|
---|
| 17 | /*output: */
|
---|
[13229] | 18 | SeqVec<IssmPDouble>* flags=NULL;
|
---|
| 19 | flags=new SeqVec<IssmPDouble>(nods);
|
---|
[1105] | 20 |
|
---|
| 21 | /*Loop through all contours: */
|
---|
| 22 | for (i=0;i<numcontours;i++){
|
---|
| 23 | contouri=*(contours+i);
|
---|
[8303] | 24 | numnodes=contouri->nods;
|
---|
[1105] | 25 | xc=contouri->x;
|
---|
| 26 | yc=contouri->y;
|
---|
[8303] | 27 | IsInPoly(flags,xc,yc,numnodes,x,y,0,nods,edgevalue);
|
---|
[1105] | 28 | }
|
---|
| 29 |
|
---|
| 30 | /*Assemble vector: */
|
---|
[11695] | 31 | flags->Assemble();
|
---|
[1105] | 32 |
|
---|
| 33 | /*Assign output pointers: */
|
---|
| 34 | *pflags=flags;
|
---|
[13622] | 35 |
|
---|
[11401] | 36 | return 1;
|
---|
[1105] | 37 | }
|
---|
[12121] | 38 |
|
---|
[13229] | 39 | int ContourToNodesx(SeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){
|
---|
[12121] | 40 |
|
---|
| 41 | /*Contour:*/
|
---|
[13220] | 42 | Contour<IssmPDouble>* contouri=NULL;
|
---|
[12121] | 43 | double* xc=NULL;
|
---|
| 44 | double* yc=NULL;
|
---|
| 45 |
|
---|
| 46 | /*output: */
|
---|
[13229] | 47 | SeqVec<IssmPDouble>* flags=NULL;
|
---|
| 48 | flags=new SeqVec<IssmPDouble>(nods);
|
---|
[12121] | 49 |
|
---|
| 50 | /*Loop through all contours: */
|
---|
| 51 | if(contours){
|
---|
[13762] | 52 | for(int i=0;i<contours->Size();i++){
|
---|
[13220] | 53 | Contour<IssmPDouble>* contour=(Contour<IssmPDouble>*)contours->GetObjectByOffset(i);
|
---|
[12121] | 54 | IsInPoly(flags,contour->x,contour->y,contour->nods,x,y,0,nods,edgevalue);
|
---|
| 55 | }
|
---|
| 56 | }
|
---|
| 57 |
|
---|
| 58 | /*Assemble vector: */
|
---|
| 59 | flags->Assemble();
|
---|
| 60 |
|
---|
| 61 | /*Assign output pointers: */
|
---|
| 62 | *pflags=flags;
|
---|
| 63 | return 1;
|
---|
| 64 | }
|
---|