KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
layer.h
Go to the documentation of this file.
1 
13 /*
14  * $Id: layer.h 17606 2014-09-26 01:09:51Z predoehl $
15  */
16 
17 #ifndef LAYER_H_INCLUDED_UOFARIZONAVISION
18 #define LAYER_H_INCLUDED_UOFARIZONAVISION
19 
20 namespace kjb
21 {
22 
24 namespace TopoFusion
25 {
26 
27 const size_t MAX_TRACKSTRING = 255;
28 const int NO_ELEV = -1;
29 
30 const size_t LAYER_FN_SIZE = 2048;
31 
32 
34 typedef struct
35 {
36  double x;
37  double y;
38  char zone;
39  double ele;
40 } pt;
41 
43 inline
44 pt make_pt( double eee, double nnn, char zzz, double elev = NO_ELEV )
45 {
46  pt p;
47  p.x = eee;
48  p.y = nnn;
49  p.zone = zzz;
50  p.ele = elev;
51  return p;
52 }
53 
55 typedef struct
56 {
57  int numPoints;
59 
60  mutable double length;
61 } seg;
62 
63 
65 typedef struct
66 {
67  char name[MAX_TRACKSTRING];
68  seg s;
69 } track;
70 
71 
73 typedef struct
74 {
75  char name[MAX_TRACKSTRING];
77 } waypoint;
78 
79 
80 
82 typedef struct
83 {
86 
87  char filename[ LAYER_FN_SIZE ];
88 
89  int numTracks;
91 } layer;
92 
93 
94 double dist(const pt a, const pt b);
95 
96 double segmentLength( const seg *s );
97 
98 void initLayer (layer *l);
99 
100 void destroyLayer( layer *l );
101 
102 void initTrack (track *t);
103 
104 void initWaypoint (waypoint *w);
105 
106 } // end namespace TopoFusion
107 } // end namespace kjb
108 
109 #endif /* LAYER_H_INCLUDED_UOFARIZONAVISION */
110 
double x
easting of a location, meters
Definition: layer.h:36
seg s
sequence of points in the track
Definition: layer.h:68
track * tracks
array of tracks for the layer
Definition: layer.h:90
old TopoFusion data structure for a sequence of pt structures
Definition: layer.h:55
const size_t LAYER_FN_SIZE
max length of a layer's filename field
Definition: layer.h:30
char zone
utm zone number of a location
Definition: layer.h:38
const int NO_ELEV
sentinel value for "blank" pt::ele
Definition: layer.h:28
double y
northing of a location, meters
Definition: layer.h:37
int numWaypoints
number of waypoints in this layer
Definition: layer.h:84
void initLayer(layer *l)
clear all the fields of a layer (pointers assumed to be dangling)
Definition: layer.cpp:89
pt make_pt(double eee, double nnn, char zzz, double elev=NO_ELEV)
construct a point from its parameters but not as a ctor.
Definition: layer.h:44
double segmentLength(const seg *s)
computes the length of a segment
Definition: layer.cpp:60
double length
polygonal path length of the seg
Definition: layer.h:60
double dist(const pt a, const pt b)
compute approx. Great Circle distance between two UTM points
Definition: layer.cpp:45
pt point
UTM location of this waypoint.
Definition: layer.h:76
void destroyLayer(layer *l)
release memory in the layer's tracks and waypoints arrays
Definition: layer.cpp:105
definition used for layer
Definition: layer.h:82
const size_t MAX_TRACKSTRING
max len of string field in track, etc
Definition: layer.h:27
pt * points
array of pt objects
Definition: layer.h:58
void initTrack(track *t)
clear the fields of a track (like a default constructor)
Definition: layer.cpp:119
definition used for waypoint
Definition: layer.h:73
int numTracks
number of tracks for the layer
Definition: layer.h:89
int numPoints
number of pt objects in the points array
Definition: layer.h:57
void initWaypoint(waypoint *w)
clear the point.ele field of a waypoint (and that's all).
Definition: layer.cpp:140
waypoint * waypoints
array of waypoints for the layer
Definition: layer.h:85
double ele
elevation of a location, meters
Definition: layer.h:39
definition for a TopoFusion pt
Definition: layer.h:34
old TopoFusion data structure: metadata for a seg
Definition: layer.h:65