1997-05-16 15:58:23 +00:00
|
|
|
/**************************************************************************
|
|
|
|
* mesh.h -- data structures and routines for processing terrain meshes
|
|
|
|
*
|
|
|
|
* Written by Curtis Olson, started May 1997.
|
|
|
|
*
|
1997-05-23 15:40:04 +00:00
|
|
|
* Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
|
|
|
*
|
|
|
|
* This program 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 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program 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, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*
|
1997-05-16 15:58:23 +00:00
|
|
|
* $Id$
|
|
|
|
* (Log is kept at end of this file)
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef MESH_H
|
|
|
|
#define MESH_H
|
|
|
|
|
|
|
|
|
|
|
|
struct mesh {
|
|
|
|
/* start coordinates (in arc seconds) */
|
|
|
|
double originx, originy;
|
|
|
|
|
|
|
|
/* number of rows and columns */
|
|
|
|
int rows, cols;
|
|
|
|
|
|
|
|
/* Distance between row and column data points (in arc seconds) */
|
|
|
|
double row_step, col_step;
|
|
|
|
|
|
|
|
/* pointer to the actual mesh data dynamically allocated */
|
|
|
|
float *mesh_data;
|
|
|
|
|
|
|
|
/* a temporary values for the parser to use */
|
|
|
|
char option_name[32];
|
1997-06-22 21:44:40 +00:00
|
|
|
int do_data;
|
1997-05-16 15:58:23 +00:00
|
|
|
int cur_row, cur_col;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* return a pointer to a new mesh structure (no data array allocated yet) */
|
|
|
|
struct mesh *(new_mesh)();
|
|
|
|
|
1997-06-22 21:44:40 +00:00
|
|
|
/* initialize the non-array mesh values */
|
|
|
|
void mesh_init(struct mesh *m);
|
|
|
|
|
1997-05-16 15:58:23 +00:00
|
|
|
/* return a pointer to a dynamically allocated array */
|
|
|
|
float *(new_mesh_data)(int nrows, int ncols);
|
|
|
|
|
|
|
|
/* set the option name in the mesh data structure */
|
|
|
|
void mesh_set_option_name(struct mesh *m, char *name);
|
|
|
|
|
|
|
|
/* set an option value in the mesh data structure */
|
|
|
|
void mesh_set_option_value(struct mesh *m, char *value);
|
|
|
|
|
1997-06-22 21:44:40 +00:00
|
|
|
/* do whatever needs to be done with the mesh now that it's been
|
1997-07-08 18:20:11 +00:00
|
|
|
* loaded, such as generating the OpenGL call list. */
|
1997-06-22 21:44:40 +00:00
|
|
|
void mesh_do_it(struct mesh *m);
|
|
|
|
|
1997-07-08 18:20:11 +00:00
|
|
|
/* return the current altitude based on mesh data. We should rewrite
|
|
|
|
* this to interpolate exact values, but for now this is good enough */
|
|
|
|
double mesh_altitude(double lon, double lat);
|
|
|
|
|
1997-06-22 21:44:40 +00:00
|
|
|
|
1997-07-23 21:52:10 +00:00
|
|
|
#endif /* MESH_H */
|
1997-05-16 15:58:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* $Log$
|
1997-07-23 21:52:10 +00:00
|
|
|
/* Revision 1.5 1997/07/23 21:52:25 curt
|
|
|
|
/* Put comments around the text after an #endif for increased portability.
|
1997-05-16 15:58:23 +00:00
|
|
|
/*
|
1997-07-23 21:52:10 +00:00
|
|
|
* Revision 1.4 1997/07/08 18:20:14 curt
|
|
|
|
* Working on establishing a hard ground.
|
|
|
|
*
|
1997-07-08 18:20:11 +00:00
|
|
|
* Revision 1.3 1997/06/22 21:44:41 curt
|
|
|
|
* Working on intergrating the VRML (subset) parser.
|
|
|
|
*
|
1997-06-22 21:44:40 +00:00
|
|
|
* Revision 1.2 1997/05/23 15:40:42 curt
|
|
|
|
* Added GNU copyright headers.
|
|
|
|
*
|
1997-05-23 15:40:04 +00:00
|
|
|
* Revision 1.1 1997/05/16 16:07:05 curt
|
|
|
|
* Initial revision.
|
|
|
|
*
|
1997-05-16 15:58:23 +00:00
|
|
|
*/
|