1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
/*
* Written by the GRASS Team, 02/16/90, -mh .
*/
/******************
* INCLUDES: *
*******************/
#include <stdio.h>
/******************
* DEFINES: *
*******************/
#define MIN_COOR 4
#define MAX_COOR 1000
/* return status for setup_transform() and the transform library */
#define ALL_OK 1
#define POINTS_NOT_SPREAD -1
#define NEED_MORE_POINTS -2
#define TRANS_MATRIX 0
#define TRANS_SHIFT 1
/******************
* GLOBALS: *
*******************/
/**
* The coordinates of the points from the map that is to be converted
* are placed in ax[] and ay[].
* Those cooresponding points in the other coordinate system
* are placed in bx[], by[].
*
* The use[] contains a true if that point is to be used by the transform
* library or a false (0) if it is not to be used.
* The residuals each set of points contributes is placed in residuals[].
*
* Yah, I made them global. So shoot me.
**/
#ifdef MAIN
#define GLOBAL
#else
#define GLOBAL extern
#endif
GLOBAL double ax[MAX_COOR] ; /* current map */
GLOBAL double ay[MAX_COOR] ;
GLOBAL double bx[MAX_COOR] ; /* map we are going to */
GLOBAL double by[MAX_COOR] ;
GLOBAL int use[MAX_COOR] ; /* where the coordinate came from */
GLOBAL double residuals[MAX_COOR] ;
GLOBAL double rms ;
/* this may be used in the future */
GLOBAL int reg_cnt ; /* count of registered points */
/******************
* STRUCTS: *
*******************/
/* For GRASS data files */
struct file_info
{
FILE *fp ;
char *mapset ;
char name[80] ;
char full_name[256] ;
} ;
/* general flags that get set from the command line */
struct command_flags
{
int verbose ; /* do we print residual info */
int usage ;
};
#include "libtrans.h"
|