Last change
on this file since 12121 was 12121, checked in by Eric.Larour, 13 years ago |
Added new ContourToNodesx prototype to handle same functionality, but with DataSet* contours in input instead of just a simple Contour struct
Adapted InterpFromMeshToMesh2dx accordingly.
|
File size:
1.3 KB
|
Rev | Line | |
---|
[1105] | 1 | /*! \file ContourToNodesx.c
|
---|
| 2 | */
|
---|
| 3 |
|
---|
| 4 | #include "./ContourToNodesx.h"
|
---|
| 5 |
|
---|
[11695] | 6 | int ContourToNodesx( Vector** 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: */
|
---|
[11695] | 19 | Vector* flags=NULL;
|
---|
[1105] | 20 |
|
---|
[11695] | 21 | flags=new Vector(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 |
|
---|
| 41 | int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){
|
---|
| 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: */
|
---|
| 54 | Vector* flags=NULL;
|
---|
| 55 |
|
---|
| 56 | flags=new Vector(nods);
|
---|
| 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.