00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00017 #ifndef DRAW_UNDI_GRAPH_H
00018 #define DRAW_UNDI_GRAPH_H
00019
00020
00021
00022 #include <fstream>
00023 #include <GDT/rm3_undi_graph.h>
00024 #include <GDT/rm3_plan_undi_graph.h>
00025 #include <GDT/rm3_upwa_plan_undi_graph.h>
00026 #include <GDT/rm3_orth_plan_undi_graph.h>
00027 #include <GDT/rm3_dime_orth_plan_undi_graph.h>
00028 #include <GDT/rm3_tree.h>
00029 #include <GDT/rm3_SPQR_tree.h>
00030 #include <GDT/rel_coord_orth.h>
00031 #include <GDT/gdtcolor.h>
00032
00033
00034
00035 #include <set>
00036
00037 struct ltpt
00038 {
00039 bool operator()(const gdt::gdtpoint p1, const gdt::gdtpoint p2) const
00040 {
00041 bool p1ltp2 = true;
00042 double epsilon = 0.0005;
00043 if (gdt_maximum(p1.xcoord() - p2.xcoord(), p2.xcoord() - p1.xcoord()) < epsilon)
00044 {
00045 if (gdt_maximum(p1.ycoord() - p2.ycoord(), p2.ycoord() - p1.ycoord()) < epsilon) p1ltp2 = false;
00046 else if (p1.ycoord() > p2.ycoord()) p1ltp2 = false;
00047 }
00048 else
00049 if (p1.xcoord() > p2.xcoord()) p1ltp2 = false;
00050 return p1ltp2;
00051 }
00052 };
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 const double
00063 PI=3.1415926535897932385;
00064
00065
00066
00067
00068
00069
00075 typedef enum
00076 {
00077 ELLIPSE,
00078 RECTANGLE,
00079 TRIANGLE
00080 }
00081 node_shape_type;
00082
00083
00084
00091 typedef enum
00092 {
00093 NORMAL,
00094 DASHED,
00095 DOTTED
00096 }
00097 edge_shape_type;
00098
00099
00105 typedef enum
00106 {
00107 LEFT,
00108 RIGHT,
00109 UP,
00110 DOWN
00111 }
00112 direction_type;
00113
00114
00122 class GDT_NONSTANDARD_DECL
00123 struct_node_defaults
00124 {
00125 friend class draw_undi_graph;
00126 private:
00127 double width;
00128 double height;
00129 double altitude;
00130 color body_color;
00131 color border_color;
00132 color label_color;
00133 node_shape_type shape;
00134 public:
00135
00136 struct_node_defaults
00137 (
00138 );
00139 };
00140
00147 class GDT_NONSTANDARD_DECL
00148 struct_edge_defaults
00149 {
00150 friend class draw_undi_graph;
00151 private:
00152 gdt::gdtpoint anchor;
00153 color body_color;
00154 color label_color;
00155 edge_shape_type shape;
00156 public:
00157
00158 struct_edge_defaults
00159 (
00160 );
00161 };
00162
00170 class GDT_NONSTANDARD_DECL
00171 struct_draw_info
00172 {
00173 friend class draw_undi_graph;
00174 private:
00175 double scale;
00176 double bend_radius;
00177 double edge_sensivity;
00178 color shadow_color;
00179 bool shadows_are_visible;
00180 bool node_labels_are_visible;
00181 bool edge_labels_are_visible;
00182 public:
00183
00184 struct_draw_info
00185 (
00186 );
00187 };
00188
00189
00190
00197 class GDT_NONSTANDARD_DECL
00198 struct_draw_node_info
00199 {
00200 friend class draw_undi_graph;
00201 private:
00202 gdt::gdtpoint center;
00203 node_shape_type shape;
00204 double width;
00205 double height;
00206 double altitude;
00207 color internal_col;
00208 color border_col;
00209 color label_col;
00210 std::string label;
00211 gdt::gdtpoint label_pos;
00212 };
00213
00214
00215
00222 class GDT_NONSTANDARD_DECL
00223 struct_draw_edge_info
00224 {
00225 friend class draw_undi_graph;
00226 private:
00227 gdt::gdtlist<gdt::gdtpoint> bends;
00228 gdt::gdtpoint anchor_source;
00229 gdt::gdtpoint anchor_target;
00230 color col;
00231 color label_col;
00232 std::string label;
00233 gdt::gdtpoint label_pos;
00234 edge_shape_type shape;
00235 };
00236
00237
00238
00239 inline std::istream& operator >>(std::istream& in,struct_draw_edge_info& x)
00240 {in >> *((int *)((void *)&x));return(in); }
00241
00242
00243
00244
00245
00246
00247 inline std::ostream& operator <<(std::ostream& out,const struct_draw_edge_info& x)
00248 {out << *((unsigned int *)((void *)&x));return(out); }
00249
00250
00251 #ifdef __linux__
00252 inline std::ostream& operator <<(std::ostream& out,struct_draw_edge_info& x)
00253 {out << *((unsigned int *)((void *)&x));return(out); }
00254 #endif
00255
00256
00257
00258
00259
00260 inline std::istream& operator >>(std::istream& in,struct_draw_node_info& x)
00261 {in >> *((int *)((void *)&x));return(in); }
00262
00263
00264
00294 class GDT_NONSTANDARD_DECL
00295 draw_undi_graph : public undi_graph
00296 {
00297 private:
00298
00299
00300
00301
00302 struct_draw_info* draw_curr;
00303 struct_draw_info* draw_defs;
00304 struct_node_defaults* node_defs;
00305 struct_edge_defaults* edge_defs;
00306
00307 gdt::gdtnode_map<struct_draw_node_info>* node_info;
00308 gdt::gdtedge_map<struct_draw_edge_info>* edge_info;
00309
00310
00311
00312
00313
00314 void local_new ();
00315 void local_del ();
00316 void local_renew();
00317
00318
00319 void local_init
00320 (
00321 const undi_graph&,
00322 bool remove_crosses = true
00323 );
00324
00325 void local_init
00326 (
00327 const plan_undi_graph&,
00328 algorithm_type=DEFAULT_ALGORITHM,
00329 face=NULL_FACE,
00330 bool remove_crosses=true,
00331 gdt::gdtedge_array<int>* cp = NULL,
00332 int min_switches = 0
00333 );
00334
00335 void local_init
00336 (
00337 const dime_orth_plan_undi_graph&,
00338 bool refine_compaction = true,
00339 bool = true,
00340 bool remove_crosses = true
00341 );
00342
00343
00344 void local_init
00345 (
00346 int details,
00347 const dime_orth_plan_undi_graph&
00348 );
00349
00350
00351 void local_init
00352 (
00353 const tree&,
00354 algorithm_type alg=DEFAULT_ALGORITHM,
00355 bool remove_crosses = true
00356 );
00357
00358 void local_init
00359 (
00360 const upwa_plan_undi_graph&,
00361 algorithm_type alg=DEFAULT_ALGORITHM,
00362 bool remove_crosses = true
00363 );
00364
00365 void local_init
00366 (
00367 const draw_undi_graph&,
00368 bool remove_crosses = true
00369 );
00370
00371
00372 void local_init_for_dimensioned_nodes
00373 (
00374 const dime_orth_plan_undi_graph& dopug,
00375 const dime_orth_plan_undi_graph& dopug1,
00376 const gdt::gdtnode_map<gdtnode>& super_node,
00377 const gdt::gdtnode_array<int>& w,
00378 const gdt::gdtnode_array<int>& h,
00379 bool remove_creosses = true
00380 );
00381
00382
00383
00384 void remove_bend_nodes(dime_orth_plan_undi_graph& dopug);
00385
00386
00387
00388
00389
00390 void remove_bend_nodes_for_dimensioned_nodes
00391 (
00392 const dime_orth_plan_undi_graph& dopug,
00393 const dime_orth_plan_undi_graph& dopug1,
00394 const gdt::gdtnode_array<int>& w,
00395 const gdt::gdtnode_array<int>& h,
00396 const gdt::gdtnode_map<gdtnode>& super_node
00397 );
00398
00399
00400 void normalize_coordinates ();
00401 void denormalize_coordinates ();
00402
00403
00404
00405
00406
00407
00408
00409 double refine_orth_compaction (std::set<gdt::gdtpoint,ltpt>& P);
00410
00411
00412
00413 direction_type direction_of_edge (gdtedge e, gdtnode v);
00414 direction_type direction_of_second_segment_of_edge (gdtedge e, gdtnode v);
00415 gdt::gdtlist<gdtedge> edges_in_direction (gdtnode v, direction_type d);
00416
00417 bool contract_bridge_with_one_bend
00418 (
00419 gdtedge e,
00420 gdtnode n,
00421 gdt::gdtpoint p,
00422 direction_type s,
00423 direction_type d,
00424 std::set<gdt::gdtpoint,ltpt>& C,
00425 int& first
00426 );
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442 bool contract_bridge_with_no_bends
00443 (
00444 gdtnode n,
00445 gdt::gdtpoint p,
00446 direction_type s,
00447 int mlfs,
00448 std::set<gdt::gdtpoint,ltpt>& C
00449 );
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466 bool position_is_compatible
00467 (
00468 gdt::gdtpoint d,
00469 gdtnode n,
00470 gdtedge e,
00471 direction_type d2,
00472 std::set<gdt::gdtpoint,ltpt>& C,
00473 int k,
00474 int j,
00475 int& j_start
00476 );
00477
00478 gdtnode node_with_center (gdt::gdtpoint p);
00479 gdtedge find_orthogonal_edge (gdt::gdtpoint p) const;
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491 void set_scale (double);
00492
00493 gdt::gdtlist<gdt::gdtpoint> fragment_polyline (const gdt::gdtlist<gdt::gdtpoint>& bl, double c);
00494 gdt::gdtlist<gdt::gdtpoint> fragment_segment (gdt::gdtpoint p1, gdt::gdtpoint p2, double c);
00495
00496
00497
00498
00499
00500
00501 void shift_editor_functions (int, gdt::gdtpoint);
00502
00503
00504
00505
00506
00507
00508
00509
00510 void update_embedding_after_node_move (gdtnode u);
00511
00512 gdtedge add_edge_to_embedding (gdtnode v, gdtnode w, gdt::gdtlist<gdt::gdtpoint>& bend_points);
00513 gdtedge add_edge_to_embedding (gdtnode v, gdtnode w, struct_draw_edge_info, gdtnode s);
00514
00515
00516 gdtnode add_node_to_embedding (gdt::gdtpoint p);
00517 gdtnode add_node_to_embedding (struct_draw_node_info ni);
00518
00519 gdtedge find_prev_adj_edge (gdtnode u, gdt::gdtpoint p, bool& ae) const;
00520
00521 gdtnode new_node ( struct_draw_node_info ni);
00522 gdtedge new_edge (gdtnode v1, gdtnode v2, struct_draw_edge_info ei);
00523 gdtedge new_edge (gdtnode v1, gdtedge e1, gdtnode v2, struct_draw_edge_info ei, int dir=gdt::after);
00524
00525 gdtedge new_edge (gdtnode v1, gdtedge e1, gdtnode v2, gdtedge e2, struct_draw_edge_info ei, int dir=gdt::after);
00526
00527
00528
00529
00530
00531
00532
00533 void construct_draw_undi_graph
00534 (
00535 const orth_plan_undi_graph& opug,
00536 heading_type dir,
00537 algorithm_type alg = DEFAULT_ALGORITHM,
00538 bool remove_crosses = true
00539 );
00540
00541
00542 public:
00543
00544
00545
00546
00547
00548
00553 draw_undi_graph
00554 (
00555 );
00556
00557
00562 ~draw_undi_graph
00563 (
00564 );
00565
00566
00576 draw_undi_graph
00577 (
00578 const undi_graph& ug,
00579 bool remove_crosses = true
00580 );
00581
00582
00630 draw_undi_graph
00631 (
00632 const plan_undi_graph& pug,
00633 algorithm_type alg=DEFAULT_ALGORITHM,
00634 face ef = NULL_FACE,
00635 bool remove_crosses = true,
00636 gdt::gdtedge_array<int>* cp = NULL,
00637 int min_switches = 0
00638 );
00639
00640
00713 draw_undi_graph
00714 (
00715 const orth_plan_undi_graph& opug,
00716 algorithm_type alg = DEFAULT_ALGORITHM,
00717 bool remove_crosses = true
00718 );
00719
00720
00721
00797 draw_undi_graph
00798 (
00799 const orth_plan_undi_graph& opug,
00800 heading_type dir,
00801 algorithm_type alg = DEFAULT_ALGORITHM,
00802 bool remove_crosses = true
00803 );
00804
00805
00816 draw_undi_graph
00817 (
00818 const dime_orth_plan_undi_graph& dopug,
00819 bool refine_compaction = true,
00820 bool remove_crosses = true
00821 );
00822
00823
00834 draw_undi_graph
00835 (
00836 const gdt::gdtnode_array<int>& w,
00837 const gdt::gdtnode_array<int>& h,
00838 const dime_orth_plan_undi_graph& dopug,
00839 bool edges_centered = false
00840 );
00841
00842
00855 draw_undi_graph
00856 (
00857 int details,
00858 const dime_orth_plan_undi_graph& dopug
00859 );
00860
00861
00881 draw_undi_graph
00882 (
00883 const tree& tr,
00884 algorithm_type alg=DEFAULT_ALGORITHM,
00885 bool remove_crosses = true
00886 );
00887
00888
00921 draw_undi_graph
00922 (
00923 const upwa_plan_undi_graph& upug,
00924 algorithm_type alg=DEFAULT_ALGORITHM,
00925 bool remove_crosses = true
00926 );
00927
00928
00936 draw_undi_graph
00937 (
00938 rel_coord_orth& rco,
00939 bool replace_dummy_nodes = true
00940 );
00941
00942
00948 draw_undi_graph
00949 (
00950 const draw_undi_graph& dug,
00951 bool remove_crosses = true
00952 );
00953
00954
00955
00956
00957
00958
00959
00964 draw_undi_graph&
00965 operator =
00966 (
00967 const undi_graph& ug
00968 );
00969
00970
00975 draw_undi_graph&
00976 operator =
00977 (
00978 const plan_undi_graph& pug
00979 );
00980
00981
00986 draw_undi_graph&
00987 operator =
00988 (
00989 const orth_plan_undi_graph& opug
00990 );
00991
00992
00997 draw_undi_graph&
00998 operator =
00999 (
01000 const dime_orth_plan_undi_graph& dopug0
01001 );
01002
01003
01008 draw_undi_graph&
01009 operator =
01010 (
01011 const tree& tr
01012 );
01013
01014
01019 draw_undi_graph&
01020 operator =
01021 (
01022 const upwa_plan_undi_graph& upug
01023 );
01024
01025
01030 draw_undi_graph&
01031 operator =
01032 (
01033 const draw_undi_graph& dug
01034 );
01035
01036
01037
01038
01039
01040
01041
01042
01043
01048 double
01049 scale
01050 (
01051 ) const;
01052
01053
01058 double
01059 width
01060 (
01061 ) const;
01062
01063
01068 double
01069 width
01070 (
01071 gdtnode v
01072 ) const;
01073
01074
01079 double
01080 height
01081 (
01082 ) const;
01083
01084
01089 double
01090 height
01091 (
01092 gdtnode v
01093 ) const;
01094
01095
01100 double
01101 area
01102 (
01103 ) const;
01104
01105
01110 double
01111 area
01112 (
01113 gdtnode v
01114 ) const;
01115
01116
01121 double
01122 length
01123 (
01124 gdtedge e
01125 ) const;
01126
01127
01128
01129
01130
01131
01132
01137 gdt::gdtpoint
01138 center
01139 (
01140 ) const;
01141
01142
01147 gdt::gdtpoint
01148 center
01149 (
01150 gdtnode v
01151 ) const;
01152
01153
01158 gdt::gdtpoint
01159 label_position
01160 (
01161 gdtnode v
01162 ) const;
01163
01164
01169 gdt::gdtpoint
01170 label_position
01171 (
01172 gdtedge e
01173 ) const;
01174
01175
01180 gdt::gdtpoint
01181 anchor_source
01182 (
01183 gdtedge e
01184 ) const;
01185
01186
01191 gdt::gdtpoint
01192 anchor_target
01193 (
01194 gdtedge e
01195 ) const;
01196
01197
01202 gdt::gdtpoint
01203 anchor_source_point
01204 (
01205 gdtedge e
01206 ) const;
01207
01208
01213 gdt::gdtpoint
01214 anchor_target_point
01215 (
01216 gdtedge e
01217 ) const;
01218
01219
01224 gdt::gdtpoint
01225 anchor
01226 (
01227 gdtedge e,
01228 gdtnode v
01229 ) const;
01230
01231
01236 gdt::gdtpoint
01237 anchor_point
01238 (
01239 gdtedge e,
01240 gdtnode v
01241 ) const;
01242
01243
01248 gdt::gdtpoint
01249 intersection_edge_node
01250 (
01251 gdtedge e,
01252 gdtnode v
01253 ) const;
01254
01255
01260 gdt::gdtlist<gdt::gdtpoint>
01261 intersection_edge_edge
01262 (
01263 gdtedge e1,
01264 gdtedge e2
01265 ) const;
01266
01267
01272 gdt::gdtlist<gdt::gdtpoint>
01273 bends
01274 (
01275 gdtedge e
01276 ) const;
01277
01278
01283 gdt::gdtlist<gdt::gdtpoint>
01284 bends
01285 (
01286 gdtedge e,
01287 gdtnode v
01288 ) const;
01289
01290
01295 gdt::gdtlist<gdt::gdtpoint>
01296 crosses
01297 (
01298 ) const;
01299
01300
01305 double
01306 altitude
01307 (
01308 gdtnode v
01309 ) const;
01310
01311
01312
01317 bool
01318 node_contains_point
01319 (
01320 gdtnode v,
01321 gdt::gdtpoint p
01322 ) const;
01323
01324
01329 bool
01330 edge_contains_point
01331 (
01332 gdtedge e,
01333 gdt::gdtpoint p
01334 ) const;
01335
01336
01337
01338
01339
01340
01341
01342
01343
01348 double
01349 recommended_scale
01350 (
01351 ) const;
01352
01353
01358 gdt::gdtpoint
01359 recommended_label_position
01360 (
01361 gdtnode v
01362 ) const;
01363
01364
01369 gdt::gdtpoint
01370 recommended_label_position
01371 (
01372 gdtedge e
01373 ) const;
01374
01375
01376
01377
01378
01379
01380
01381
01382
01387 color
01388 body_color
01389 (
01390 gdtnode v
01391 ) const;
01392
01393
01398 color
01399 border_color
01400 (
01401 gdtnode v
01402 ) const;
01403
01404
01409 color
01410 body_color
01411 (
01412 gdtedge e
01413 ) const;
01414
01415
01420 color
01421 label_color
01422 (
01423 gdtnode v
01424 ) const;
01425
01426
01431 color
01432 label_color
01433 (
01434 gdtedge e
01435 ) const;
01436
01437
01438
01439
01440
01441
01442
01443
01444
01449 node_shape_type
01450 shape
01451 (
01452 gdtnode v
01453 ) const;
01454
01455
01460 edge_shape_type
01461 shape
01462 (
01463 gdtedge e
01464 ) const;
01465
01466
01467
01468
01469
01470
01471
01476 std::string
01477 label
01478 (
01479 gdtnode v
01480 ) const;
01481
01482
01487 std::string
01488 label
01489 (
01490 gdtedge e
01491 ) const;
01492
01493
01494
01495
01496
01497
01498
01503 bool
01504 shadows_are_visible
01505 (
01506 ) const;
01507
01508
01513 bool
01514 node_labels_are_visible
01515 (
01516 ) const;
01517
01518
01523 bool
01524 edge_labels_are_visible
01525 (
01526 ) const;
01527
01528
01529
01530
01531
01532
01533
01538 gdtnode
01539 find_node
01540 (
01541 int id
01542 ) const;
01543
01544
01549 gdtedge
01550 find_edge
01551 (
01552 int id
01553 ) const;
01554
01555
01561 gdtnode
01562 find_node
01563 (
01564 gdt::gdtpoint p
01565 ) const;
01566
01567
01573 gdtedge
01574 find_edge
01575 (
01576 gdt::gdtpoint p
01577 ) const;
01578
01579
01585 gdt::list_item
01586 find_bend
01587 (
01588 gdt::gdtpoint p,
01589 gdtedge& e
01590 ) const;
01591
01592
01593
01594
01595
01596
01597
01602 int
01603 number_of_bends
01604 (
01605 ) const;
01606
01607
01612 int
01613 number_of_bends
01614 (
01615 gdtedge e
01616 ) const;
01617
01618
01623 int
01624 number_of_bends
01625 (
01626 gdt::gdtlist<gdtedge> l
01627 ) const;
01628
01629
01634 int
01635 number_of_bends_max
01636 (
01637 ) const;
01638
01639
01644 double
01645 number_of_bends_avg
01646 (
01647 ) const;
01648
01649
01654 double
01655 number_of_bends_sdv
01656 (
01657 ) const;
01658
01659
01664 double
01665 edge_length_sum
01666 (
01667 ) const;
01668
01669
01674 double
01675 edge_length_max
01676 (
01677 ) const;
01678
01679
01684 double
01685 edge_length_avg
01686 (
01687 ) const;
01688
01689
01694 double
01695 edge_length_sdv
01696 (
01697 ) const;
01698
01699
01705 double
01706 screen_ratio_sdv
01707 (
01708 ) const;
01709
01710
01711
01712
01713
01714
01715
01716
01717
01722 struct_draw_info
01723 draw_defaults
01724 (
01725 ) const;
01726
01727
01732 struct_node_defaults
01733 node_defaults
01734 (
01735 ) const;
01736
01737
01742 struct_edge_defaults
01743 edge_defaults
01744 (
01745 ) const;
01746
01747
01748
01749
01750
01751
01752
01753
01754
01759 struct_draw_info
01760 draw_status
01761 (
01762 ) const;
01763
01764
01769 struct_draw_node_info
01770 node_status
01771 (
01772 gdtnode v
01773 ) const;
01774
01775
01780 struct_draw_edge_info
01781 edge_status
01782 (
01783 gdtedge e
01784 ) const;
01785
01786
01791 void
01792 calc_bounding_box
01793 (
01794 double& x_min,
01795 double& x_max,
01796 double& y_min,
01797 double& y_max
01798 ) const;
01799
01800
01809 void
01810 detect_external_node_and_edge
01811 (
01812 gdtnode& sn,
01813 gdtedge& se
01814 );
01815
01816
01817
01818
01819
01820
01821
01822
01828 void
01829 set_edge_sensivity
01830 (
01831 double k
01832 );
01833
01834
01835
01836
01837
01838
01839
01840
01841
01846 void
01847 set_width
01848 (
01849 gdtnode v,
01850 double l
01851 );
01852
01853
01858 void
01859 set_height
01860 (
01861 gdtnode v,
01862 double l
01863 );
01864
01865
01870 void
01871 set_bend_radius
01872 (
01873 double br
01874 );
01875
01876
01877
01878
01879
01880
01885 void
01886 set_center
01887 (
01888 gdtnode v,
01889 gdt::gdtpoint p
01890 );
01891
01892
01897 void
01898 set_altitude
01899 (
01900 gdtnode v,
01901 double d
01902 );
01903
01904
01905
01910 void
01911 set_label_position
01912 (
01913 gdtnode v,
01914 gdt::gdtpoint p
01915 );
01916
01917
01918
01923 void
01924 set_label_position
01925 (
01926 gdtedge e,
01927 gdt::gdtpoint p
01928 );
01929
01930
01931
01936 void
01937 set_anchor_source
01938 (
01939 gdtedge e,
01940 gdt::gdtpoint p
01941 );
01942
01943
01944
01949 void
01950 set_anchor_target
01951 (
01952 gdtedge e,
01953 gdt::gdtpoint p
01954 );
01955
01956
01957
01962 void
01963 set_anchor_point
01964 (
01965 gdtedge e,
01966 gdtnode v,
01967 gdt::gdtpoint p
01968 );
01969
01970
01975 void
01976 set_bends
01977 (
01978 gdtedge e,
01979 gdt::gdtlist<gdt::gdtpoint> bl
01980 );
01981
01982
01983
01989 void
01990 set_bends
01991 (
01992 gdtedge e,
01993 gdtnode v,
01994 gdt::gdtlist<gdt::gdtpoint> bl
01995 );
01996
01997
02003 int
02004 remove_avoidable_bends
02005 (
02006 gdtedge e
02007 );
02008
02009
02015 int
02016 remove_avoidable_bends
02017 (
02018 );
02019
02020
02038 gdt::gdtlist<gdtnode>
02039 replace_long_edge_with_chain
02040 (
02041 gdtedge e
02042 );
02043
02044
02051 gdt::gdtlist<gdtnode>
02052 replace_long_edges_with_chains
02053 (
02054 );
02055
02056
02065 void
02066 space_overlapping_edges
02067 (
02068 );
02069
02070
02079 void
02080 undo_space_overlapping_edges
02081 (
02082 gdtedge e
02083 );
02084
02085
02092 void
02093 undo_space_overlapping_edges
02094 (
02095 );
02096
02097
02105 gdt::gdtlist<gdtnode>
02106 replace_bends_with_nodes
02107 (
02108 gdtedge e
02109 );
02110
02111
02117 gdt::gdtlist<gdtnode>
02118 replace_bends_with_nodes
02119 (
02120 );
02121
02122
02123
02124
02125
02126
02127
02128
02129
02130
02131
02132
02133
02138 void
02139 set_body_color
02140 (
02141 gdtnode v,
02142 color c
02143 );
02144
02145
02146
02151 void
02152 set_border_color
02153 (
02154 gdtnode v,
02155 color c
02156 );
02157
02158
02159
02164 void
02165 set_body_color
02166 (
02167 gdtedge e,
02168 color c
02169 );
02170
02171
02172
02177 void
02178 set_label_color
02179 (
02180 gdtnode v,
02181 color c
02182 );
02183
02184
02185
02190 void
02191 set_label_color
02192 (
02193 gdtedge e,
02194 color c
02195 );
02196
02197
02198
02199
02200
02201
02202
02203
02204
02205
02210 void
02211 set_shape
02212 (
02213 gdtnode v,
02214 node_shape_type st
02215 );
02216
02217
02218
02224 void
02225 set_shape
02226 (
02227 gdtedge e,
02228 edge_shape_type st
02229 );
02230
02231
02232
02233
02234
02235
02236
02237
02238
02239
02244 void
02245 set_label
02246 (
02247 gdtnode v,
02248 std::string s
02249 );
02250
02251
02252
02257 void
02258 set_label
02259 (
02260 gdtedge e,
02261 std::string s
02262 );
02263
02264
02265
02266
02267
02268
02269
02270
02271
02272
02277 void
02278 show_shadows
02279 (
02280 );
02281
02282
02283
02288 void
02289 show_node_labels
02290 (
02291 );
02292
02293
02294
02299 void
02300 show_edge_labels
02301 (
02302 );
02303
02304
02305
02310 void
02311 hide_shadows
02312 (
02313 );
02314
02315
02316
02321 void
02322 hide_node_labels
02323 (
02324 );
02325
02326
02327
02332 void
02333 hide_edge_labels
02334 (
02335 );
02336
02337
02338
02339
02340
02341
02342
02343
02344
02345
02350 void
02351 apply_defaults
02352 (
02353 );
02354
02355
02356
02361 void
02362 apply_defaults
02363 (
02364 gdtnode v
02365 );
02366
02367
02368
02373 void
02374 apply_defaults
02375 (
02376 gdtedge e
02377 );
02378
02379
02380
02381
02382
02383
02384
02385
02386
02387
02392 void
02393 shift
02394 (
02395 double sh,
02396 direction_type dir
02397 );
02398
02399
02400
02406 void
02407 rotate
02408 (
02409 angle_type angle,
02410 gdt::gdtpoint ref
02411 );
02412
02413
02414
02420 void
02421 flip_horizontally
02422 (
02423 gdt::gdtpoint fulcrum
02424 );
02425
02426
02427
02433 void
02434 flip_vertically
02435 (
02436 gdt::gdtpoint fulcrum
02437 );
02438
02439
02440
02446 void
02447 rescale
02448 (
02449 double k = 0
02450 );
02451
02452
02453
02454
02455
02456
02457
02458
02459
02460
02465 void
02466 set_draw_defaults
02467 (
02468 struct_draw_info dd
02469 );
02470
02471
02472
02477 void
02478 set_node_defaults
02479 (
02480 struct_node_defaults nd
02481 );
02482
02483
02484
02489 void
02490 set_edge_defaults
02491 (
02492 struct_edge_defaults ed
02493 );
02494
02495
02496
02497
02498
02499
02500
02501
02502
02503
02508 void
02509 set_draw_status
02510 (
02511 struct_draw_info ds
02512 );
02513
02514
02515
02521 void
02522 set_node_status
02523 (
02524 gdtnode v,
02525 struct_draw_node_info ni
02526 );
02527
02528
02529
02535 void
02536 set_edge_status
02537 (
02538 gdtedge e,
02539 struct_draw_edge_info ei
02540 );
02541
02542
02543
02549 void
02550 set_node_status_preserving_positions
02551 (
02552 gdtnode v,
02553 struct_draw_node_info ni
02554 );
02555
02556
02557
02563 void
02564 set_edge_status_preserving_positions
02565 (
02566 gdtedge e,
02567 struct_draw_edge_info ei
02568 );
02569
02570
02571
02576 void
02577 update_label_positions_after_movement_of_node
02578 (
02579 gdtnode v
02580 );
02581
02582
02583
02588 void
02589 update_label_position_after_movement_of_bend_along_edge
02590 (
02591 gdtedge e
02592 );
02593
02594
02595
02601 void
02602 update_node_and_bend_positions_according_to
02603 (
02604 dime_orth_plan_undi_graph& dopug
02605 );
02606
02607
02608
02614 void
02615 update_node_and_bend_positions_according_to
02616 (
02617 draw_undi_graph& dug
02618 );
02619
02620
02621
02627 void
02628 set_dummy_nodes_and_edges_status
02629 (
02630 );
02631
02632
02633
02634
02635
02636
02637
02638
02639
02640
02645 void
02646 clear
02647 (
02648 );
02649
02650
02651
02656 gdtnode
02657 new_node
02658 (
02659 gdt::gdtpoint p,
02660 int new_id=AUTO_ID
02661 );
02662
02663
02664
02669 gdtedge
02670 new_edge
02671 (
02672 gdtnode v,
02673 gdtnode w ,
02674 gdt::gdtlist<gdt::gdtpoint> bl,
02675 int new_id=AUTO_ID
02676 );
02677
02678
02679
02685 gdtedge
02686 new_edge
02687 (
02688 gdtnode v,
02689 gdtedge e ,
02690 gdtnode w,
02691 gdt::gdtlist<gdt::gdtpoint> bl,
02692 int new_id=AUTO_ID,
02693 int dir=gdt::after
02694 );
02695
02696
02697
02704 gdtedge
02705 new_edge
02706 (
02707 gdtnode v,
02708 gdtedge ev,
02709 gdtnode w,
02710 gdtedge ew,
02711 gdt::gdtlist<gdt::gdtpoint> bl,
02712 int new_id=AUTO_ID,
02713 int dir=gdt::after
02714 );
02715
02716
02717
02724 void
02725 new_bend
02726 (
02727 gdtedge e,
02728 gdtnode v,
02729 int i,
02730 gdt::gdtpoint p
02731 );
02732
02733
02734
02741 gdtnode
02742 replace_cross_with_node
02743 (
02744 gdtedge e1,
02745 gdtedge e2,
02746 gdt::gdtpoint p
02747 );
02748
02749
02750
02757 gdt::gdtlist<gdtnode>
02758 replace_crosses_with_nodes
02759 (
02760 );
02761
02762
02763
02770 void
02771 remove_cross_node
02772 (
02773 gdtnode v
02774 );
02775
02776
02777
02785 void
02786 remove_cross_nodes
02787 (
02788 gdt::gdtlist<gdtnode> nl
02789 );
02790
02791
02792
02798 std::set<gdt::gdtpoint,ltpt>
02799 remove_cross_nodes
02800 (
02801 );
02802
02803
02804
02816 gdtedge
02817 remove_two_degree_node
02818 (
02819 gdtnode v,
02820 gdt::gdtlist<marker_type>* Lp = NULL
02821 );
02822
02823
02824
02825
02826
02827
02828
02829
02830
02831
02918 bool
02919 draw
02920 (
02921 std::string file_name
02922 );
02923
02924
02925
02926
02927
02928
02929
02934 bool
02935 write
02936 (
02937 std::string file_name
02938 );
02939
02940
02941
02946 bool
02947 read
02948 (
02949 std::string file_name
02950 );
02951
02952
02953
02958 void
02959 append_section_to_fstream
02960 (
02961 std::ofstream& out
02962 );
02963
02964
02965
02970 void
02971 read_section_from_fstream
02972 (
02973 std::ifstream& in
02974 );
02975
02985 void
02986 export_to_fig_file_format
02987 (
02988 bool spline_edge,
02989 double refinement,
02990 double scale_factor,
02991 std::ostream& out = std::cout
02992 );
02993
02994
03001 void
03002 export_to_fig_file_format
03003 (
03004 std::ostream& out = std::cout
03005 );
03006
03007
03017 void
03018 export_to_fig_file_format
03019 (
03020 std::string file_name,
03021 bool spline_edge = false,
03022 float refinement = 0.4,
03023 float scale_factor = 1
03024 );
03025
03026
03027
03039 void
03040 export_to_xml_file_format
03041 (
03042 std::ostream& out = std::cout
03043 );
03044
03045
03056 void
03057 export_to_xml_file_format
03058 (
03059 std::string file_name
03060 );
03061
03062
03068 bool
03069 export_to_graphml_file_format
03070 (
03071 std::string file_name
03072 );
03073
03074
03080 bool
03081 import_from_graphml_file_format
03082 (
03083 std::string file_name
03084 );
03085
03086
03087
03088
03089
03090
03091
03092
03093
03094
03095
03108 };
03109
03110
03111
03112
03113 #endif