00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00017 #ifndef RM3_GLOBAL_H
00018 #define RM3_GLOBAL_H
00019
00020 #if !defined(ROOT_INCL_ID)
00021 #define ROOT_INCL_ID 34010
00022 #endif
00023
00024
00025 #include <string>
00026 #include <GDT/gdtarray.h>
00027 #include <GDT/gdtlist.h>
00028 #include <GDT/gdtmap.h>
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 #define GDT_NONSTANDARD_DECL
00051 #define GDT_NONSTANDARD_DECL_FUNCTION
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 #ifdef INFINITE
00063 #undef INFINITE
00064 #endif
00065 extern const int INFINITE;
00066 extern const int BOUND_ON_NODES;
00067
00068 #define gdt_minimum(a,b) ((a)>(b) ? (b) : (a))
00069 #define gdt_maximum(a,b) ((a)>(b) ? (a) : (b))
00070
00071 #define safe_delete(a) {delete(a); a = NULL;}
00072
00073
00074
00075
00076
00077
00078
00079
00080 typedef enum
00081 {
00082 DEFAULT_ALGORITHM,
00083
00084 PLAN_ORTH_QUICK,
00085 PLAN_ORTH_OPTIMAL,
00086 PLAN_ORTH_SLOW,
00087 PLAN_ORTH_UPWA_STRAIGHT_MIDDLE,
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098 ORTH_SIMPLE_PT00,
00099
00100
00101
00102 ORTH_FROM_VISIBILITY,
00103 ORTH_FROM_VISIBILITY_COMPACTED,
00104
00105 TREE_DRAW_CENTERSONS,
00106 TREE_DRAW_CENTERSUBTREE,
00107
00108 VISIBILITY,
00109 VISIBILITY_COMPACTED,
00110 VISIBILITY_REGULAR,
00111 VISIBILITY_REGULAR_COMPACTED,
00112
00113 POLYLINE,
00114 POLYLINE_COMPACTED,
00115 POLYLINE_REGULAR,
00116 POLYLINE_REGULAR_COMPACTED,
00117
00118 PLAN_UPWARD_OPTIMAL,
00119 PLAN_UPWARD_SLOW,
00120 PLAN_UPWARD_EMBEDDING,
00121 PLAN_UPWARD_EMBEDDING_REGULAR,
00122
00123 FAST_COMPACTION,
00124 FAST_COMPACTION_REFINED,
00125 SLOW_COMPACTION,
00126 SLOW_COMPACTION_REFINED,
00127 FAST_REGULAR_COMPACTION_1,
00128 SLOW_REGULAR_COMPACTION_1,
00129 FAST_REGULAR_COMPACTION_2,
00130 SLOW_REGULAR_COMPACTION_2,
00131 FAST_REGULAR_COMPACTION_1_REFINED,
00132 SLOW_REGULAR_COMPACTION_1_REFINED,
00133 FAST_REGULAR_COMPACTION_2_REFINED,
00134 SLOW_REGULAR_COMPACTION_2_REFINED
00135 }
00136 algorithm_type;
00137
00138
00139
00140
00141
00142
00143 typedef struct
00144 {
00145 int number_of_total_nodes;
00146 int number_of_cut_nodes;
00147 int number_of_visited_nodes;
00148 int number_of_cuts;
00149 gdt::gdtmap<int,int> N;
00150 }
00151 BB_tree_parameters;
00152
00153
00154
00155
00156
00157
00158 GDT_NONSTANDARD_DECL_FUNCTION int random (int a, int b);
00159 GDT_NONSTANDARD_DECL_FUNCTION int fact (int n);
00160
00161 GDT_NONSTANDARD_DECL_FUNCTION gdt::gdtarray< gdt::gdtlist<int> > find_all_permutations (int n);
00162
00163
00164
00165
00166
00167
00168
00169 typedef enum
00170 {
00171 RM3_UNDEFINED_MARKER,
00172 RM3_REPLACES_A_BEND,
00173 RM3_ADDED_BY_RECTANGULARIZATION,
00174 RM3_CROSS_ON_REAL_EDGE,
00175 RM3_DD_CROSS_ON_FACE,
00176 RM3_DD_CROSS_ON_REAL_EDGE,
00177 RM3_DD_CROSS_ON_DUMMY_EDGE,
00178 RM3_DD_WALK_ALONG_DUMMY_EDGE,
00179 RM3_DD_WALK_ALONG_REAL_EDGE,
00180 RM3_DD_WALK_AND_TURN_LEFT_ALONG_DUMMY_EDGE,
00181 RM3_DD_WALK_AND_TURN_RIGHT_ALONG_DUMMY_EDGE,
00182 RM3_DD_WALK_AND_TURN_LEFT_ALONG_REAL_EDGE,
00183 RM3_DD_WALK_AND_TURN_RIGHT_ALONG_REAL_EDGE,
00184 RM3_DD_WALK_AND_TURN_LEFT_ALONG_EAGLE_BOUNDARY_EDGE,
00185 RM3_DD_WALK_AND_TURN_RIGHT_ALONG_EAGLE_BOUNDARY_EDGE,
00186 RM3_DD_TURN_LEFT_AND_WALK_ALONG_DUMMY_EDGE,
00187 RM3_DD_TURN_RIGHT_AND_WALK_ALONG_DUMMY_EDGE,
00188 RM3_DD_TURN_LEFT_AND_WALK_ALONG_REAL_EDGE,
00189 RM3_DD_TURN_RIGHT_AND_WALK_ALONG_REAL_EDGE,
00190 RM3_DD_TURN_LEFT_AND_WALK_ALONG_EAGLE_BOUNDARY_EDGE,
00191 RM3_DD_TURN_RIGHT_AND_WALK_ALONG_EAGLE_BOUNDARY_EDGE,
00192 RM3_DD_ACROSS_A_NODE,
00193 RM3_DD_ACROSS_A_REPLACES_A_BEND_BETWEEN_FRONT_AND_LEFT_REAL_EDGES,
00194 RM3_DD_ACROSS_A_REPLACES_A_BEND_BETWEEN_FRONT_AND_RIGHT_REAL_EDGES,
00195 RM3_DD_ACROSS_A_REPLACES_A_BEND_BETWEEN_BACK_AND_LEFT_REAL_EDGES,
00196 RM3_DD_ACROSS_A_REPLACES_A_BEND_BETWEEN_BACK_AND_RIGHT_REAL_EDGES,
00197 RM3_DD_TURN_LEFT_ON_NODE,
00198 RM3_DD_TURN_RIGHT_ON_NODE,
00199 RM3_DD_TURN_LEFT_ON_NODE_FROM_DUMMY_TO_REAL,
00200 RM3_DD_TURN_RIGHT_ON_NODE_FROM_DUMMY_TO_REAL,
00201 RM3_DD_TURN_LEFT_ON_NODE_FROM_REAL_TO_DUMMY,
00202 RM3_DD_TURN_RIGHT_ON_NODE_FROM_REAL_TO_DUMMY,
00203
00204
00205 RM3_DD_CROSS_ON_DUMMY_NODE_BETWEEN_REAL_EDGES,
00206 RM3_DD_CROSS_ON_DUMMY_NODE_BETWEEN_DUMMY_EDGES,
00207 RM3_ADDED_BY_MAKE_UPWARD,
00208 RM3_ADDED_BY_MAKE_ST,
00209 RM3_ADDED_BY_MAKE_SIMPLE,
00210 RM3_ADDED_BY_MAKE_CONNECTED,
00211 RM3_ADDED_BY_EXPAND,
00212 RM3_BEND_NODE,
00213 RM3_ANY_BEND,
00214 RM3_NONE_BEND,
00215 RM3_MINIMAL_BEND,
00216 RM3_PLANARIZATION_GADGET_NODE,
00217 RM3_PLANARIZATION_GADGET_EDGE,
00218 RM3_ADDED_BY_REGULARIZATION,
00219 RM3_NODE_IN_SUPER_NODE,
00220 RM3_CENTER_OF_WHEEL
00221 }
00222 marker_type;
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233 typedef enum
00234 {
00235 _000=0,
00236 _090=1,
00237 _180=2,
00238 _270=3,
00239 _360=4
00240 }
00241 angle_type;
00242
00243
00244
00245
00246 inline std::ostream& operator <<(std::ostream& out,const marker_type x)
00247 {out << *((unsigned int *)((void *)&x)) ;return(out);}
00248 inline std::istream& operator >>(std::istream& in,marker_type& x)
00249 {in >> *((unsigned int *)((void *)&x)) ;return(in); }
00250
00251
00252
00253
00254 class undi_graph;
00255 class struct_gdtnode;
00256 class struct_gdtedge;
00257
00258 typedef struct_gdtnode *gdtnode;
00259 typedef struct_gdtedge *gdtedge;
00260
00261
00262
00264
00266
00267
00268 std::string
00269 replace_all(std::string s,std::string s1, std::string s2);
00270
00271 std::string
00272 gdt_itoa
00273 (
00274 int n
00275 );
00276
00277
00278
00280
00282
00283
00284 bool
00285 check_date();
00286
00287
00288
00289 #endif