source:
issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp@
13216
Last change on this file since 13216 was 13216, checked in by , 13 years ago | |
---|---|
File size: 1.4 KB |
Rev | Line | |
---|---|---|
[1105] | 1 | /*! \file ContourToNodesx.c |
2 | */ | |
3 | ||
4 | #include "./ContourToNodesx.h" | |
5 | ||
[13216] | 6 | int ContourToNodesx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue){ |
[1105] | 7 | |
8 | int i; | |
9 | int m,n; | |
10 | ||
11 | /*Contour:*/ | |
12 | Contour* contouri=NULL; | |
[8303] | 13 | int numnodes; |
[1105] | 14 | double* xc=NULL; |
15 | double* yc=NULL; | |
16 | double value; | |
17 | ||
18 | /*output: */ | |
[13216] | 19 | Vector<IssmDouble>* flags=NULL; |
[1105] | 20 | |
[13216] | 21 | flags=new Vector<IssmDouble>(nods); |
[1105] | 22 | |
23 | /*Loop through all contours: */ | |
24 | for (i=0;i<numcontours;i++){ | |
25 | contouri=*(contours+i); | |
[8303] | 26 | numnodes=contouri->nods; |
[1105] | 27 | xc=contouri->x; |
28 | yc=contouri->y; | |
[8303] | 29 | IsInPoly(flags,xc,yc,numnodes,x,y,0,nods,edgevalue); |
[1105] | 30 | } |
31 | ||
32 | /*Assemble vector: */ | |
[11695] | 33 | flags->Assemble(); |
[1105] | 34 | |
35 | /*Assign output pointers: */ | |
36 | *pflags=flags; | |
[11401] | 37 | |
38 | return 1; | |
[1105] | 39 | } |
[12121] | 40 | |
[13216] | 41 | int ContourToNodesx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){ |
[12121] | 42 | |
43 | int i; | |
44 | int m,n; | |
45 | ||
46 | /*Contour:*/ | |
47 | Contour* contouri=NULL; | |
48 | int numnodes; | |
49 | double* xc=NULL; | |
50 | double* yc=NULL; | |
51 | double value; | |
52 | ||
53 | /*output: */ | |
[13216] | 54 | Vector<IssmDouble>* flags=NULL; |
[12121] | 55 | |
[13216] | 56 | flags=new Vector<IssmDouble>(nods); |
[12121] | 57 | |
58 | /*Loop through all contours: */ | |
59 | if(contours){ | |
60 | for (i=0;i<contours->Size();i++){ | |
61 | Contour* contour=(Contour*)contours->GetObjectByOffset(i); | |
62 | IsInPoly(flags,contour->x,contour->y,contour->nods,x,y,0,nods,edgevalue); | |
63 | } | |
64 | } | |
65 | ||
66 | /*Assemble vector: */ | |
67 | flags->Assemble(); | |
68 | ||
69 | /*Assign output pointers: */ | |
70 | *pflags=flags; | |
71 | ||
72 | return 1; | |
73 | } |
Note:
See TracBrowser
for help on using the repository browser.