TECA
The Toolkit for Extreme Climate Analysis
teca_geometry::polygon< coord_t > Struct Template Reference

#include <teca_geometry.h>

Collaboration diagram for teca_geometry::polygon< coord_t >:

Public Member Functions

template<typename in_coord_t >
void copy (const in_coord_t *in_vx, const in_coord_t *in_vy, unsigned long in_n_verts)
 deep copy the vertices of the polygon. More...
 
void normalize_coordinates ()
 transforms coordinates to be in [0 360 -90 90] More...
 
bool inside (coord_t px, coord_t py)
 returns true if a point is inside the polygon More...
 
void get_bounds (coord_t *bounds)
 
void to_stream (teca_binary_stream &bs)
 serialize to the given stream More...
 
int from_stream (teca_binary_stream &bs)
 deseriealize from the given stream More...
 

Public Attributes

std::shared_ptr< coord_t > vx
 
std::shared_ptr< coord_t > vy
 
unsigned long n_verts
 

Detailed Description

template<typename coord_t>
struct teca_geometry::polygon< coord_t >

@breif The vertices of a 2D polygon in clockwise order. The first and last point are required to be the same.

Member Function Documentation

◆ copy()

template<typename coord_t >
template<typename in_coord_t >
void teca_geometry::polygon< coord_t >::copy ( const in_coord_t *  in_vx,
const in_coord_t *  in_vy,
unsigned long  in_n_verts 
)

deep copy the vertices of the polygon.

◆ from_stream()

template<typename coord_t >
int teca_geometry::polygon< coord_t >::from_stream ( teca_binary_stream bs)

deseriealize from the given stream

◆ get_bounds()

template<typename coord_t >
void teca_geometry::polygon< coord_t >::get_bounds ( coord_t *  bounds)

compute an axis aligned bounding box around the polygon with the layout [x0 x1 y0 y1].

◆ inside()

template<typename coord_t >
bool teca_geometry::polygon< coord_t >::inside ( coord_t  px,
coord_t  py 
)

returns true if a point is inside the polygon

◆ normalize_coordinates()

template<typename coord_t >
void teca_geometry::polygon< coord_t >::normalize_coordinates

transforms coordinates to be in [0 360 -90 90]

◆ to_stream()

template<typename coord_t >
void teca_geometry::polygon< coord_t >::to_stream ( teca_binary_stream bs)

serialize to the given stream


The documentation for this struct was generated from the following file: