1 | /********************************************************************** <BR>
|
---|
2 | This file is part of Crack dot Com's free source code release of
|
---|
3 | Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
|
---|
4 | information about compiling & licensing issues visit this URL</a>
|
---|
5 | <PRE> If that doesn't help, contact Jonathan Clark at
|
---|
6 | golgotha_source@usa.net (Subject should have "GOLG" in it)
|
---|
7 | ***********************************************************************/
|
---|
8 |
|
---|
9 | #error
|
---|
10 |
|
---|
11 | #ifndef CRITICAL_GRAPH_HH
|
---|
12 | #define CRITICAL_GRAPH_HH
|
---|
13 |
|
---|
14 | #include "g1_limits.hh"
|
---|
15 | #include "math/num_type.hh"
|
---|
16 | #include "saver.hh"
|
---|
17 |
|
---|
18 | typedef w8 g1_graph_node;
|
---|
19 |
|
---|
20 | class g1_critical_graph_class
|
---|
21 | {
|
---|
22 | friend class g1_critical_map_maker_class;
|
---|
23 | public:
|
---|
24 | enum { MAX_CRITICALS=256, MAX_CONNECTIONS=100 };
|
---|
25 |
|
---|
26 | class connection_class
|
---|
27 | {
|
---|
28 | public:
|
---|
29 | g1_graph_node ref;
|
---|
30 | i4_float dist;
|
---|
31 | w8 size[G1_GRADE_LEVELS];
|
---|
32 | };
|
---|
33 |
|
---|
34 | class critical_point_class
|
---|
35 | {
|
---|
36 | public:
|
---|
37 | i4_float x,y;
|
---|
38 | connection_class *connection;
|
---|
39 | w8 connections;
|
---|
40 | w8 selected;
|
---|
41 | };
|
---|
42 |
|
---|
43 | protected:
|
---|
44 | connection_class *pool;
|
---|
45 | w32 pool_connections;
|
---|
46 | public:
|
---|
47 | critical_point_class critical[MAX_CRITICALS];
|
---|
48 | // note critical point 0 is used to mark the null
|
---|
49 |
|
---|
50 | w16 criticals;
|
---|
51 |
|
---|
52 | g1_critical_graph_class() : criticals(1), pool(0) {}
|
---|
53 | g1_critical_graph_class(g1_loader_class *f) : pool(0) { load_points(f); }
|
---|
54 | ~g1_critical_graph_class();
|
---|
55 |
|
---|
56 | void clear_critical_graph();
|
---|
57 | void compact_critical_graph();
|
---|
58 | void expand_critical_graph();
|
---|
59 |
|
---|
60 | i4_bool add_critical_point(float x, float y);
|
---|
61 |
|
---|
62 | void save_points(g1_saver_class *f);
|
---|
63 | void save_graph(g1_saver_class *f);
|
---|
64 | void load_points(g1_loader_class *f);
|
---|
65 | void load_graph(g1_loader_class *f);
|
---|
66 | };
|
---|
67 |
|
---|
68 | #endif
|
---|
69 |
|
---|
70 | //{{{ Emacs Locals
|
---|
71 | // Local Variables:
|
---|
72 | // folded-file: t
|
---|
73 | // End:
|
---|
74 | //}}}
|
---|
75 |
|
---|