Ice Sheet System Model  4.18
Code documentation
Functions
ContourToNodesx.h File Reference
#include "../../shared/shared.h"
#include "../../classes/classes.h"

Go to the source code of this file.

Functions

int ContourToNodesx (IssmPDouble **pflags, double *x, double *y, int nods, Contour< IssmPDouble > **contours, int numcontours, int edgevalue)
 
int ContourToNodesx (IssmPDouble **pflags, double *x, double *y, int nods, Contours *contours, int edgevalue)
 

Function Documentation

◆ ContourToNodesx() [1/2]

int ContourToNodesx ( IssmPDouble **  pflags,
double *  x,
double *  y,
int  nods,
Contour< IssmPDouble > **  contours,
int  numcontours,
int  edgevalue 
)

Definition at line 6 of file ContourToNodesx.cpp.

6  {
7 
8  int i;
9 
10  /*Contour:*/
11  Contour<IssmPDouble>* contouri=NULL;
12  int numnodes;
13  double* xc=NULL;
14  double* yc=NULL;
15 
16  /*output: */
17  IssmPDouble* flags=NULL;
18  flags=xNew<IssmPDouble>(nods);
19 
20  /*Loop through all contours: */
21  for (i=0;i<numcontours;i++){
22  contouri=*(contours+i);
23  numnodes=contouri->nods;
24  xc=contouri->x;
25  yc=contouri->y;
26  IsInPoly(flags,xc,yc,numnodes,x,y,0,nods,edgevalue);
27  }
28 
29  /*Assign output pointers: */
30  *pflags=flags;
31  return 1;
32 }

◆ ContourToNodesx() [2/2]

int ContourToNodesx ( IssmPDouble **  pflags,
double *  x,
double *  y,
int  nods,
Contours contours,
int  edgevalue 
)

Definition at line 34 of file ContourToNodesx.cpp.

34  {
35 
36  /*output: */
37  IssmPDouble* flags=NULL;
38  flags=xNewZeroInit<IssmPDouble>(nods);
39 
40  /*Loop through all contours: */
41  if(contours){
42  for(int i=0;i<contours->Size();i++){
44  IsInPoly(flags,contour->x,contour->y,contour->nods,x,y,0,nods,edgevalue);
45  }
46  }
47 
48  /*Assign output pointers: */
49  *pflags=flags;
50  return 1;
51 }
DataSet::Size
int Size()
Definition: DataSet.cpp:399
Contour
Definition: Contour.h:15
Contour::nods
int nods
Definition: Contour.h:20
Contour::y
doubletype * y
Definition: Contour.h:22
DataSet::GetObjectByOffset
Object * GetObjectByOffset(int offset)
Definition: DataSet.cpp:334
Contour::x
doubletype * x
Definition: Contour.h:21
IssmPDouble
IssmDouble IssmPDouble
Definition: types.h:38
IsInPoly
int IsInPoly(doubletype *in, double *xc, double *yc, int numvertices, double *x, double *y, int i0, int i1, int edgevalue)
Definition: exp.h:17