BG_Flood  0.8
Documentation (Work-in-progress)
Poly.h File Reference
#include "General.h"
#include "Param.h"
#include "Input.h"
#include "Write_txtlog.h"
#include "Util_CPU.h"
#include "Forcing.h"
#include "Arrays.h"
#include "MemManagement.h"
Include dependency graph for Poly.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<class T >
bool blockinpoly (T xo, T yo, T dx, int blkwidth, Polygon Poly)
 check whether a block is inside or intersectin a polygon More...
 
template<class T >
int wn_PnPoly (T Px, T Py, Polygon Poly)
 winding number test for a point in a polygon More...
 
Polygon CounterCWPoly (Polygon Poly)
 check polygon handedness and reverse if necessary. More...
 

Function Documentation

◆ blockinpoly()

template<class T >
bool blockinpoly ( xo,
yo,
dx,
int  blkwidth,
Polygon  Poly 
)

check whether a block is inside or intersectin a polygon

Description

Check whether a block is inside or intersectin a polygon

◆ CounterCWPoly()

Polygon CounterCWPoly ( Polygon  Poly)

check polygon handedness and reverse if necessary.

Description

check polygon handedness and enforce left-handesness (Counter-clockwise). This function is used to ensure the right polygon handedness for the winding number inpoly (using the isleft())

◆ wn_PnPoly()

template<class T >
int wn_PnPoly ( Px,
Py,
Polygon  Poly 
)

winding number test for a point in a polygon

Description

wn_PnPoly(): winding number test for a point in a polygon Input: P = a point, V[] = vertex points of a polygon V[n+1] with V[n]=V[0] Return: wn = the winding number (=0 only when P is outside)

Where does this come from:

Copyright 2000 softSurfer, 2012 Dan Sunday

Original Licence

This code may be freely used and modified for any purpose providing that this copyright notice is included with it. SoftSurfer makes no warranty for this code, and cannot be held liable for any real or imagined damage resulting from its use. Users of this code must verify correctness for their application. Code modified to fit the use in DisperGPU