|
TheBoussinesqModel
3.2.1
|
#include "turtle.h"#include "geometry.h"#include "additional_read_functions.h"#include "geometry_utilities.h"#include "geometry_io.h"#include "geometry_freememory.h"Go to the source code of this file.
Macros | |
| #define | DELIMITERS ";" |
| #define | MAX_POINTS 20 |
| #define | NULL_VALUE -99 |
| #define | NO_ELEVATION 0.0 |
| #define | NO_COLS_LINEVECTOR_DOUBLEMATRIX 8 |
Functions | |
| LINE * | get_line (DOUBLEVECTOR *vertex_x_coord, DOUBLEVECTOR *vertex_y_coord, long line_index, char *number_strings, short print) |
| LINEVECTOR * | get_linevector (DOUBLEVECTOR *vertex_x_coord, DOUBLEVECTOR *vertex_y_coord, STRINGBIN *line_strings, short print) |
| LINEVECTOR * | extract_linvector_from_linevector (LONGVECTOR *nlines, LINEVECTOR *lines) |
| POLYGON * | get_polygon (long index, double x, double y, double z, char *edge_index_string, LINEVECTOR *all_lines, short print) |
| POLYGONVECTOR * | get_polygonvector (DOUBLEVECTOR *centroid_x_coord, DOUBLEVECTOR *centroid_y_coord, STRINGBIN *polygon_strings, LINEVECTOR *all_lines, short print) |
| int | write_linevector (char *filename, LINEVECTOR *lines) |
| int | write_polygonvector (char *filename, POLYGONVECTOR *polygons) |
| int | fprint_linevector (char *filename, LINEVECTOR *lines) |
| int | fprint_polygonvector (char *filename, POLYGONVECTOR *polygons) |
| #define DELIMITERS ";" |
BGEOMETRY BUILDS THE MESH FROM A RASTER FOR THE BOUSSINESQ MODEL
KeyPalette Version 0.9375 KMackenzie
file geometry_io.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/.
Definition at line 32 of file geometry_io.c.
Referenced by get_line(), and get_polygon().
| #define MAX_POINTS 20 |
Definition at line 33 of file geometry_io.c.
Referenced by get_line(), and get_polygon().
| #define NO_COLS_LINEVECTOR_DOUBLEMATRIX 8 |
Definition at line 37 of file geometry_io.c.
Referenced by write_linevector().
| #define NO_ELEVATION 0.0 |
Definition at line 35 of file geometry_io.c.
Referenced by get_line(), and get_polygonvector().
| #define NULL_VALUE -99 |
Definition at line 34 of file geometry_io.c.
Referenced by fprint_polygonvector(), and write_polygonvector().
| LINEVECTOR* extract_linvector_from_linevector | ( | LONGVECTOR * | nlines, |
| LINEVECTOR * | lines | ||
| ) |
| nlines | - (LONGVECTOR *) numbers of lines to be extracted |
| lines | - (LINEVECTOR *) vector of all lines |
Definition at line 125 of file geometry_io.c.
References LINE::begin, LINEVECTOR::element, LINE::end, new_line_from_points(), new_linevector(), LONGVECTOR::nh, and LINEVECTOR::nl.
Referenced by get_polygon(), and new_pixel_from_raster().
| int fprint_linevector | ( | char * | filename, |
| LINEVECTOR * | lines | ||
| ) |
| name | - (char *)name of file where to write the linevector properties |
| linevector | - (LINEVECTOR *) the linevector to be printed |
Definition at line 341 of file geometry_io.c.
References LINE::begin, LINEVECTOR::element, LINE::end, LINE::index, LINE::length2d, LINEVECTOR::nl, POINT::x, and POINT::y.
| int fprint_polygonvector | ( | char * | filename, |
| POLYGONVECTOR * | polygons | ||
| ) |
| name | - (char *)name of file where to write the linevector properties |
| polygons | - (POLYGONVECTOR *) the polygonvector to be printed |
PRINT HEADER
end print header
Definition at line 392 of file geometry_io.c.
References POLYGON::area2D, POLYGON::centroid, POLYGON::edge_indices, POLYGONVECTOR::element, POLYGON::index, LONGVECTOR::nh, NL, POLYGONVECTOR::nl, LONGVECTOR::nl, NULL_VALUE, POINT::x, and POINT::y.
| LINE* get_line | ( | DOUBLEVECTOR * | vertex_x_coord, |
| DOUBLEVECTOR * | vertex_y_coord, | ||
| long | line_index, | ||
| char * | number_strings, | ||
| short | |||
| ) |
| vertex_x_coord | - (DOUBLEVECTOR *) vector of x coordinates |
| vertex_y_coord | - (DOUBLEVECTOR *) vector of y coordinates |
| line_index | - (long int) index of the line |
| number_string | - (char *) string containing the number of two vertex points |
| - (short) if activated it prints error or warning messages |
Definition at line 39 of file geometry_io.c.
References DELIMITERS, free_longvector(), free_point(), POINT::index, MAX_POINTS, new_line_from_points(), new_point(), LONGVECTOR::nh, DOUBLEVECTOR::nh, LONGVECTOR::nl, NO_ELEVATION, read_longarray_from_string(), POINT::x, and POINT::y.
Referenced by get_linevector().
| LINEVECTOR* get_linevector | ( | DOUBLEVECTOR * | vertex_x_coord, |
| DOUBLEVECTOR * | vertex_y_coord, | ||
| STRINGBIN * | line_strings, | ||
| short | |||
| ) |
| vertex_x_coord | - (DOUBLEVECTOR *) vector of x coordinates |
| vertex_y_coord | - (DOUBLEVECTOR *) vector of y coordinates |
| line_strings | - (STRINGBIN *) string array containing line information |
| - (short int) |
Definition at line 90 of file geometry_io.c.
References LINEVECTOR::element, get_line(), st::index, new_linevector(), LONGVECTOR::nh, and LINEVECTOR::nl.
| POLYGON* get_polygon | ( | long | index, |
| double | x, | ||
| double | y, | ||
| double | z, | ||
| char * | edge_index_string, | ||
| LINEVECTOR * | all_lines, | ||
| short | |||
| ) |
| index | - (long) index of the centroid and the polygons |
| x | - (double) x of the centroid |
| y | - (double) y of the centroid |
| z | - (double) z of the centroid |
| edge_line_index | - (char *) string containing the edge indices |
| all_lines | - (LINEVECTOR *) vector of all lines |
| - (short) |
Definition at line 153 of file geometry_io.c.
References DELIMITERS, extract_linvector_from_linevector(), free_linevector(), free_longvector(), free_point(), MAX_POINTS, new_point(), new_polygon_from_a_linevector(), and read_longarray_from_string().
Referenced by get_polygonvector().
| POLYGONVECTOR* get_polygonvector | ( | DOUBLEVECTOR * | centroid_x_coord, |
| DOUBLEVECTOR * | centroid_y_coord, | ||
| STRINGBIN * | polygon_strings, | ||
| LINEVECTOR * | all_lines, | ||
| short | |||
| ) |
| centroid_x_coord | - (DOUBLEVECTOR*) vector of centroid x coordinates |
| centroid_y_coord | - (DOUBLEVECTOR*) vector of centroid y coordinates |
| polygon_strings | - (STRINGBIN *) string containing polygon information |
| lines | - (LINEVECTOR *) vector containing all the lines |
| - (short) |
Definition at line 191 of file geometry_io.c.
References POLYGONVECTOR::element, get_polygon(), st::index, new_polygonvector(), LONGVECTOR::nh, DOUBLEVECTOR::nh, POLYGONVECTOR::nl, and NO_ELEVATION.
| int write_linevector | ( | char * | filename, |
| LINEVECTOR * | lines | ||
| ) |
| name | - (char *)name of file where to write the linevector properties |
| linevector | - (LINEVECTOR *) the linevector to be printed |
write a linevecto in a fluidturtle formalism.
Definition at line 219 of file geometry_io.c.
References LINE::begin, LINEVECTOR::element, LINE::end, LINE::index, LINE::length2d, LINEVECTOR::nh, LINEVECTOR::nl, NO_COLS_LINEVECTOR_DOUBLEMATRIX, POINT::x, and POINT::y.
Referenced by write_grid().
| int write_polygonvector | ( | char * | filename, |
| POLYGONVECTOR * | polygons | ||
| ) |
| name | - (char *)name of file where to write the linevector properties |
| polygons | - (POLYGONVECTOR *) the polygonvector to be printed |
This functions writes a polygonvector in an ascii files with fluidturle formalism
PRINT HEADER
end print header
Definition at line 271 of file geometry_io.c.
References POLYGON::area2D, POLYGON::centroid, POLYGON::edge_indices, POLYGONVECTOR::element, POLYGON::index, POLYGONVECTOR::nh, LONGVECTOR::nh, NL, POLYGONVECTOR::nl, LONGVECTOR::nl, NULL_VALUE, POINT::x, and POINT::y.
Referenced by write_grid().