source: issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp@ 12121

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
Line 
1/*! \file ContourToNodesx.c
2 */
3
4#include "./ContourToNodesx.h"
5
6int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue){
7
8 int i;
9 int m,n;
10
11 /*Contour:*/
12 Contour* contouri=NULL;
13 int numnodes;
14 double* xc=NULL;
15 double* yc=NULL;
16 double value;
17
18 /*output: */
19 Vector* flags=NULL;
20
21 flags=new Vector(nods);
22
23 /*Loop through all contours: */
24 for (i=0;i<numcontours;i++){
25 contouri=*(contours+i);
26 numnodes=contouri->nods;
27 xc=contouri->x;
28 yc=contouri->y;
29 IsInPoly(flags,xc,yc,numnodes,x,y,0,nods,edgevalue);
30 }
31
32 /*Assemble vector: */
33 flags->Assemble();
34
35 /*Assign output pointers: */
36 *pflags=flags;
37
38 return 1;
39}
40
41int 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.