TheBoussinesqModel  3.2.1
 All Data Structures Files Functions Variables Typedefs Macros Pages
geometry.h File Reference

Go to the source code of this file.

Data Structures

struct  POINT
 
struct  LINE
 
struct  POLYGON
 
struct  LINEVECTOR
 
struct  POLYGONVECTOR
 
struct  polygon_connection_attributes
 
struct  attribute_point_array
 
struct  attribute_line_array
 
struct  polygon_connection_attribute_array
 

Macros

#define MISSING_ELEMENT   -99
 
#define TRUE   1
 
#define FALSE   0
 

Typedefs

typedef void attribute_point
 
typedef void attribute_line
 
typedef void attribute_polygon
 

Functions

POINTnew_point (long index, double x, double y, double z)
 
LINEnew_line_from_points (long index, POINT *P1, POINT *P2)
 
POLYGONnew_polygon_from_a_linevector (LINEVECTOR *lines, POINT *centroid)
 
LINEVECTORnew_linevector (long nh)
 
POLYGONVECTORnew_polygonvector (long nh)
 

Macro Definition Documentation

#define FALSE   0

Definition at line 28 of file geometry.h.

Referenced by check_3_numbers().

#define MISSING_ELEMENT   -99

Definition at line 26 of file geometry.h.

#define TRUE   1

Definition at line 27 of file geometry.h.

Referenced by check_3_numbers().

Typedef Documentation

typedef void attribute_line

Definition at line 81 of file geometry.h.

typedef void attribute_point

Definition at line 80 of file geometry.h.

typedef void attribute_polygon

Definition at line 82 of file geometry.h.

Function Documentation

LINE* new_line_from_points ( long  index,
POINT P1,
POINT P2 
)
Author
Emanuele Cordano
Date
October 2008

index - (long) line index

Parameters
P1- (POINT *) begin point of the line
P2- (POINT *) end point of the line
Returns
creates a line between two point
Warning
Once allocated the line, the two points P1 and P2 are dellacated!!!

Definition at line 62 of file geometry.c.

References LINE::begin, distance2D(), LINE::end, POINT::index, LINE::index, LINE::length2d, new_point(), t_error(), POINT::x, POINT::y, and POINT::z.

Referenced by extract_linvector_from_linevector(), get_line(), new_horizontal_line_from_raster(), new_line_from_line(), new_vertical_line_from_raster(), and read_linevector().

LINEVECTOR* new_linevector ( long  nh)
Author
Emanuele Cordano
Date
November 2008
Returns
allocates a line vector with nh elements

Definition at line 94 of file geometry.c.

References LINEVECTOR::element, isDynamic, LINEVECTOR::isdynamic, LINEVECTOR::nh, NL, LINEVECTOR::nl, NR_END, and t_error().

Referenced by extract_linvector_from_linevector(), get_linevector(), get_linevector_from_raster_grid(), new_linevector_from_linevector(), and read_linevector().

POINT* new_point ( long  index,
double  x,
double  y,
double  z 
)
BGEOMETRY BUILDS THE MESH FROM A RASTER FOR THE BOUSSINESQ MODEL

KeyPalette Version 0.9375 KMackenzie

file geometry.c

Copyright, 2009 Emanuele Cordano and Riccardo Rigon

This file is part of BGEOMETRY. BGEOMETRY is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

BGEOMETRY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Author
Emanuele Cordano
Date
October 2008
Parameters
index- (long) point index
x- (double) x coordinate
y- (doulbe) y coordinate
z- (double) z coordinate
Returns
cretes a new point with fixed coordinates and index (Point Attributes are not allocated!!)

Definition at line 29 of file geometry.c.

References POINT::index, t_error(), POINT::x, POINT::y, and POINT::z.

Referenced by get_line(), get_polygon(), new_line_from_points(), new_point_from_point(), new_point_from_raster(), new_polygon_from_a_linevector(), read_linevector(), and read_polygon().

POLYGON* new_polygon_from_a_linevector ( LINEVECTOR lines,
POINT centroid 
)
Author
Emanuele Cordano, Davide Giacomelli
Date
October 2008
Parameters
lines- (LINEVECTOR *) a vector of lines
centrod- (POINT *) the centroid of the polygon
Returns
creates a polygon with edges taken by the line vector (Polygon Attributes are not allocated!!)

Definition at line 145 of file geometry.c.

References POLYGON::area2D, area2d(), LINE::begin, POLYGON::centroid, POLYGON::edge_indices, LINEVECTOR::element, LINE::end, free_longvector(), POINT::index, LINE::index, POLYGON::index, new_longvector(), new_point(), LINEVECTOR::nh, LINEVECTOR::nl, query_freq_longvector(), segment_intersection_occurence(), t_error(), POINT::x, POINT::y, and POINT::z.

Referenced by get_polygon(), and new_pixel_from_raster().

POLYGONVECTOR* new_polygonvector ( long  nh)
Author
Emanuele Cordano
Date
November 2008
Returns
allocates a polygon vector with nh elements

Definition at line 119 of file geometry.c.

References POLYGONVECTOR::element, isDynamic, POLYGONVECTOR::isdynamic, POLYGONVECTOR::nh, NL, POLYGONVECTOR::nl, NR_END, and t_error().

Referenced by get_polygonvector(), get_polygonvector_from_raster(), new_polygonvector_from_polygonvector(), and read_polygonvector().