OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
vpfview.h
Go to the documentation of this file.
1 /* VPFVIEW.H */
2 
3 #ifndef __VPFVIEW_H__
4 #define __VPFVIEW_H__
5 
6 #include <stdlib.h> /* to pick up min/max... */
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 #include <ossim/vpfutil/set.h>
13 #ifdef __MSDOS__
14 # include "gui.h"
15 #endif
16 #include <ossim/vpfutil/vpftable.h>
17 #include <ossim/vpfutil/linklist.h>
18 
19 #ifdef __MSDOS__
20 typedef unsigned char VPF_BOOLEAN;
21 #else
22 typedef unsigned VPF_BOOLEAN;
23 #if (!defined(_MSC_VER))
24 # ifndef stricmp
25 # define stricmp(a,b) ossim_strcasecmp(a,b)
26 # endif
27 # ifndef strcmpi
28 # define strcmpi(a,b) ossim_strcasecmp(a, b)
29 # endif
30 # ifndef strncmpi
31 # define strncmpi(a,b,c) ossim_strncasecmp(a,b,c)
32 # endif
33 # ifndef ltoa
34 # define ltoa(l,s,len) sprintf(s,"%d",l)
35 # endif
36 # ifndef itoa
37 # define itoa(i,s,len) sprintf(s,"%d",i)
38 # endif
39 #endif
40 
41 #endif
42 
43 typedef char color_type;
44 
45 
46 /* Degree-minutes-seconds type */
47 typedef struct {
48  int degrees;
49  int minutes;
50  float seconds;
51 } dms_type;
52 
53 
54 /* Geographic extent */
55 typedef struct {
56  float x1, y1, x2, y2;
57 } extent_type;
58 
59 /* Currently supported VPF versions */
60 typedef enum { VPF_0_7, VPF_0_8 } vpf_version_type;
61 
62 
63 /* VPF database internal structure */
64 typedef struct {
65  char name[9]; /* Name of the VPF database */
66  char *path; /* DOS path name to the database */
67  char **library; /* Array of library names within the database */
68  int nlibraries; /* Number of libraries in the database */
69  char *producer; /* Producer of the database - from header table */
70  vpf_version_type version; /* VPF Version of the database */
71  int byte_order; /* Byte order of the database */
73 
74 
75 /* VPF coverage internal structure */
76 typedef struct {
77  char name[9]; /* Name of the coverage */
78  char *description; /* Description of the coverage */
79  char *path; /* DOS path name to the coverage */
80  int topolevel; /* Topology level of the coverage */
82 
83 
84 /* VPF feature types */
86 
87 /* VPF primitive types */
90 
91 
92 /* Units of measure */
95 
96 
97 /* VPF feature class internal structure */
98 typedef struct {
99  char name[40]; /* Name of the feature class */
100  char *description; /* Description of the feature class */
101  int coverage; /* Containing coverage number */
102  char *table; /* Feature table name */
103  vpf_primitive_type primclass; /* Primitive class */
104  char cprim[6]; /* Array of primclasses if primclass=COMPLEX */
105  set_type view_set; /* Themes of the view in this feature class */
107 
108 
109 /* VPF library internal structure */
110 typedef struct {
111  char name[9]; /* Name of the library */
112  char database[9]; /* Name of the containing database */
113  char *path; /* DOS path name to the library */
114  char *description; /* Library description */
115  extent_type extent; /* Map extent of the library */
116  char security[15]; /* Security classification of the library */
117  coverage_type *cover; /* Coverages within the library */
118  int ncover; /* Number of coverages in the library */
119  feature_class_type *fc; /* Feature classes within the library */
120  int nfc; /* Number of feature classes in the library */
121  long int ntiles; /* Number of tiles in the library */
122  set_type tile_set; /* Set of 'active' tiles in the library */
123  double tileheight; /* 'Height' of tile 1 in the library */
124  VPF_BOOLEAN dec_degrees; /* Coordinates in decimal degrees? */
125  char *prjname; /* Projection name (if not dec_degrees) */
126  units_type units; /* Units of measure (if not dec_degrees) */
127  vpf_version_type version; /* VPF Version of the database */
128 } library_type;
129 
130 
131 /* A theme is a single entry for a view of the database. It can be */
132 /* thought of as a stored query with a description and symbology. */
133 /* Each theme is associated with a feature class. */
134 typedef struct {
135  char *description; /* Description of the theme */
136  char *fc; /* Feature class name for the theme */
137  int fcnum; /* Theme's feature class number */
138  int primclass; /* Primitive class of the theme */
139  char *text_col; /* Column to be displayed as text */
140  char *expression; /* Query expression */
141  int point_color, point_symbol; /* Point color and symbol */
142  int line_color, line_symbol; /* Line color and symbol */
143  int area_color, area_symbol; /* Area color and symbol */
144  int text_color, text_symbol; /* Text color and symbol */
145 } theme_type;
146 
147 
148 /* View structure. Each view is associated with a particular database */
149 /* and a particular library within that datbase. */
150 typedef struct {
151  char database[9]; /* Database name */
152  char library[9]; /* Library name */
153  char name[9]; /* View name */
154  int nthemes; /* Number of themes in the view */
155  theme_type *theme; /* Array of themes */
156  set_type selected; /* Set of themes selected for display */
157  set_type displayed; /* Set of displayed themes */
158  linked_list_type sellist; /* List of selected themes (ordered) */
159 } view_type;
160 
161 
162 /* Map environment information */
163 typedef struct {
164  extent_type mapextent; /* Current map extent */
165  VPF_BOOLEAN mapchanged; /* Flag - has anything changed? */
166  VPF_BOOLEAN mapdisplayed; /* Flag - has the map been displayed? */
167  VPF_BOOLEAN user_escape; /* Flag - has the user hit escape? */
168  VPF_BOOLEAN study_area_selected; /* Flag - study area selected? */
169  VPF_BOOLEAN latlongrid; /* Flag - lat-lon grid to be displayed?*/
170  VPF_BOOLEAN scale_bar; /* Flag - scale bar to be displayed? */
171 #ifdef __MSDOS__
172  window_type scale_bar_window; /* Window containing the scale bar */
173 #endif
174  int maptop; /* Top y location of the map */
175  int mapbottom; /* Bottom y location of the map */
176  int projection; /* Current projection number */
177 #ifdef __MSDOS__
178  void far (*forward_proj)(); /* Forward projection function pointer*/
179  void far (*inverse_proj)(); /* Inverse projection function pointer*/
180 #endif
182 
183 
184 /* Output devices */
185 #define SCREEN 1
186 #define POSTSCRIPT 2 /* Black and white */
187 #define COLORPS 3
188 #define PRINTER 4
189 
190 
191 /* Functions: */
192 
193 #include <ossim/vpfutil/vpfmisc.h>
194 
195 set_type query_table( char *query, vpf_table_type table );
196 #ifdef __cplusplus
197 }
198 #endif
199 
200 #endif
char * prjname
Definition: vpfview.h:125
char * description
Definition: vpfview.h:135
char * path
Definition: vpfview.h:66
units_type units
Definition: vpfview.h:126
float seconds
Definition: vpfview.h:50
units_type
Definition: vpfview.h:93
char * path
Definition: vpfview.h:113
double tileheight
Definition: vpfview.h:123
VPF_BOOLEAN latlongrid
Definition: vpfview.h:169
unsigned VPF_BOOLEAN
Definition: vpfview.h:22
linked_list_type sellist
Definition: vpfview.h:158
int fcnum
Definition: vpfview.h:137
int point_symbol
Definition: vpfview.h:141
int ncover
Definition: vpfview.h:118
long int ntiles
Definition: vpfview.h:121
int byte_order
Definition: vpfview.h:71
vpf_primitive_type primclass
Definition: vpfview.h:103
extent_type extent
Definition: vpfview.h:115
coverage_type * cover
Definition: vpfview.h:117
int nthemes
Definition: vpfview.h:154
extent_type mapextent
Definition: vpfview.h:164
char * path
Definition: vpfview.h:79
int line_symbol
Definition: vpfview.h:142
VPF_BOOLEAN mapchanged
Definition: vpfview.h:165
VPF_BOOLEAN dec_degrees
Definition: vpfview.h:124
char * expression
Definition: vpfview.h:140
set_type selected
Definition: vpfview.h:156
vpf_primitive_type
Definition: vpfview.h:88
char * description
Definition: vpfview.h:114
set_type tile_set
Definition: vpfview.h:122
#define far
Definition: mapgraph.h:24
char ** library
Definition: vpfview.h:67
set_type view_set
Definition: vpfview.h:105
theme_type * theme
Definition: vpfview.h:155
feature_class_type * fc
Definition: vpfview.h:119
float y2
Definition: vpfview.h:56
set_type displayed
Definition: vpfview.h:157
vpf_version_type
Definition: vpfview.h:60
int primclass
Definition: vpfview.h:138
Definition: set.h:14
vpf_version_type version
Definition: vpfview.h:127
char * description
Definition: vpfview.h:100
char * fc
Definition: vpfview.h:136
int nlibraries
Definition: vpfview.h:68
vpf_version_type version
Definition: vpfview.h:70
int text_symbol
Definition: vpfview.h:144
int minutes
Definition: vpfview.h:49
int topolevel
Definition: vpfview.h:80
int area_symbol
Definition: vpfview.h:143
char * producer
Definition: vpfview.h:69
VPF_BOOLEAN mapdisplayed
Definition: vpfview.h:166
int degrees
Definition: vpfview.h:48
set_type query_table(char *query, vpf_table_type table)
VPF_BOOLEAN user_escape
Definition: vpfview.h:167
vpf_feature_type
Definition: vpfview.h:85
char * description
Definition: vpfview.h:78
char color_type
Definition: vpfview.h:43
char * text_col
Definition: vpfview.h:139
VPF_BOOLEAN scale_bar
Definition: vpfview.h:170
VPF_BOOLEAN study_area_selected
Definition: vpfview.h:168