[1105] | 1 | /*! \file ContourToNodesx.c
|
---|
| 2 | */
|
---|
| 3 |
|
---|
| 4 | #include "./ContourToNodesx.h"
|
---|
| 5 |
|
---|
[14965] | 6 | int ContourToNodesx(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 |
|
---|
| 16 | /*output: */
|
---|
[14965] | 17 | IssmPDouble* flags=NULL;
|
---|
| 18 | flags=xNew<IssmPDouble>(nods);
|
---|
[1105] | 19 |
|
---|
| 20 | /*Loop through all contours: */
|
---|
| 21 | for (i=0;i<numcontours;i++){
|
---|
| 22 | contouri=*(contours+i);
|
---|
[8303] | 23 | numnodes=contouri->nods;
|
---|
[1105] | 24 | xc=contouri->x;
|
---|
| 25 | yc=contouri->y;
|
---|
[8303] | 26 | IsInPoly(flags,xc,yc,numnodes,x,y,0,nods,edgevalue);
|
---|
[1105] | 27 | }
|
---|
| 28 |
|
---|
| 29 | /*Assign output pointers: */
|
---|
| 30 | *pflags=flags;
|
---|
[11401] | 31 | return 1;
|
---|
[1105] | 32 | }
|
---|
[12121] | 33 |
|
---|
[14965] | 34 | int ContourToNodesx(IssmPDouble** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){
|
---|
[12121] | 35 |
|
---|
| 36 | /*Contour:*/
|
---|
[13220] | 37 | Contour<IssmPDouble>* contouri=NULL;
|
---|
[12121] | 38 | double* xc=NULL;
|
---|
| 39 | double* yc=NULL;
|
---|
| 40 |
|
---|
| 41 | /*output: */
|
---|
[14965] | 42 | IssmPDouble* flags=NULL;
|
---|
| 43 | flags=xNew<IssmPDouble>(nods);
|
---|
[12121] | 44 |
|
---|
| 45 | /*Loop through all contours: */
|
---|
| 46 | if(contours){
|
---|
[13762] | 47 | for(int i=0;i<contours->Size();i++){
|
---|
[13220] | 48 | Contour<IssmPDouble>* contour=(Contour<IssmPDouble>*)contours->GetObjectByOffset(i);
|
---|
[12121] | 49 | IsInPoly(flags,contour->x,contour->y,contour->nods,x,y,0,nods,edgevalue);
|
---|
| 50 | }
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 | /*Assign output pointers: */
|
---|
| 54 | *pflags=flags;
|
---|
| 55 | return 1;
|
---|
| 56 | }
|
---|