#include <rm3_draw_undi_graph.h>
Technical details about gdtnode and bends coordinates:
Definition at line 294 of file rm3_draw_undi_graph.h.
draw_undi_graph::draw_undi_graph | ( | ) |
Empty constructor.
draw_undi_graph::~draw_undi_graph | ( | ) |
Destructor.
draw_undi_graph::draw_undi_graph | ( | const undi_graph & | ug, | |
bool | remove_crosses = true | |||
) |
Constructor from the undi_graph class. Graph is drawn as a polyline representation. If remove_crosses is true, dummy cross-nodes are automatically removed.
PRECONDITIONS: graph must be biconnected
draw_undi_graph::draw_undi_graph | ( | const plan_undi_graph & | pug, | |
algorithm_type | alg = DEFAULT_ALGORITHM , |
|||
face | ef = NULL_FACE , |
|||
bool | remove_crosses = true , |
|||
gdt::gdtedge_array< int > * | cp = NULL , |
|||
int | min_switches = 0 | |||
) |
Constructor from the plan_undi_graph class. Graph can be drawn with 5 different algorithms:
PRECONDITIONS: graph must be biconnected
NOTES : if cp == NULL all gdtedge costs are considered equal in _COMPACTED algorithms.
draw_undi_graph::draw_undi_graph | ( | const orth_plan_undi_graph & | opug, | |
algorithm_type | alg = DEFAULT_ALGORITHM , |
|||
bool | remove_crosses = true | |||
) |
Constructor from the orth_plan_undi_graph class. Graph can be drawn with 4 different algorithms:
If remove_crosses is true, dummy cross-nodes are automatically removed.
draw_undi_graph::draw_undi_graph | ( | const orth_plan_undi_graph & | opug, | |
heading_type | dir, | |||
algorithm_type | alg = DEFAULT_ALGORITHM , |
|||
bool | remove_crosses = true | |||
) |
Constructor from the orth_plan_undi_graph class. Graph can be drawn with 4 different algorithms:
If remove_crosses is true, dummy cross-nodes are automatically removed.
The "dir" parameter specifies the direction of the drawing with respect the reference border step of "opug".
draw_undi_graph::draw_undi_graph | ( | const dime_orth_plan_undi_graph & | dopug, | |
bool | refine_compaction = true , |
|||
bool | remove_crosses = true | |||
) |
Constructor from the dime_orth_plan_undi_graph class. A copy of coordinates is executed to initialize the drawing. Also, if refine_compaction = true, improve the drawing by reducing bridge-lengths, if it is possible. If remove_crosses is true, dummy cross-nodes are automatically removed.
draw_undi_graph::draw_undi_graph | ( | const gdt::gdtnode_array< int > & | w, | |
const gdt::gdtnode_array< int > & | h, | |||
const dime_orth_plan_undi_graph & | dopug, | |||
bool | edges_centered = false | |||
) |
Constructor from the dime_orth_plan_undi_graph class. A drawing with the same shape and orientation as "dopug" is computed. The nodes are expanded according to the widths and heights specified by "w" and "h", respectively. These values are defined on the nodes of dopug. If edges_centered is true, then all the edges will leave the sides of their extremal nodes at the center.
draw_undi_graph::draw_undi_graph | ( | int | details, | |
const dime_orth_plan_undi_graph & | dopug | |||
) |
Constructor from the dime_orth_plan_undi_graph class. A copy of coordinates is executed to initialize the drawing. The nodes and edges of the "dopug" that will be visualized in the drawing depend on the "details" value. Namely, the following values are valid for "details":
0 - all nodes and edges are visualized;
1 - all nodes and edges are visualized, but those deriving from linearization, rectangularization, and regularization processes.
draw_undi_graph::draw_undi_graph | ( | const tree & | tr, | |
algorithm_type | alg = DEFAULT_ALGORITHM , |
|||
bool | remove_crosses = true | |||
) |
Constructor from the tree class. Graph can be drawn with 2 different algorithms:
If remove_crosses is true, dummy cross-nodes are automatically removed.
draw_undi_graph::draw_undi_graph | ( | const upwa_plan_undi_graph & | upug, | |
algorithm_type | alg = DEFAULT_ALGORITHM , |
|||
bool | remove_crosses = true | |||
) |
Constructor from the upwa_plan_undi_graph class. Graph can be drawn with 4 different algorithms,
If remove_crosses is true, dummy cross-nodes are automatically removed.
PRECONDITIONS: graph upug must describe an upward drawing, that is the method apply_layout_algorithm() has been already applied to upug.
draw_undi_graph::draw_undi_graph | ( | rel_coord_orth & | rco, | |
bool | replace_dummy_nodes = true | |||
) |
Constructor from the rel_coord_orth class. The boolean specifies if the nodes of the rel_coord_orth composing a box representing a node should be replaced with a single node as large as the whole box.
draw_undi_graph::draw_undi_graph | ( | const draw_undi_graph & | dug, | |
bool | remove_crosses = true | |||
) |
Copy constructor. If remove is true, dummy cross-nodes are automatically removed.
draw_undi_graph& draw_undi_graph::operator= | ( | const undi_graph & | ug | ) |
Equality operator from undi_graph class.
Reimplemented from undi_graph.
draw_undi_graph& draw_undi_graph::operator= | ( | const plan_undi_graph & | pug | ) |
Equality operator from plan_undi_graph class.
draw_undi_graph& draw_undi_graph::operator= | ( | const orth_plan_undi_graph & | opug | ) |
Equality operator from orth_plan_undi_graph class.
draw_undi_graph& draw_undi_graph::operator= | ( | const dime_orth_plan_undi_graph & | dopug0 | ) |
Equality operator from dime_orth_plan_undi_graph class.
draw_undi_graph& draw_undi_graph::operator= | ( | const tree & | tr | ) |
Equality operator from tree class.
draw_undi_graph& draw_undi_graph::operator= | ( | const upwa_plan_undi_graph & | upug | ) |
Equality operator from upa_plan_undi_graph class.
draw_undi_graph& draw_undi_graph::operator= | ( | const draw_undi_graph & | dug | ) |
Copy equality operator.
double draw_undi_graph::scale | ( | ) | const |
Return the drawing scale.
double draw_undi_graph::width | ( | ) | const |
Return the width of the smallest rectangle covering the drawing.
double draw_undi_graph::width | ( | gdtnode | v | ) | const |
Return the width of the smallest rectangle covering gdtnode v.
double draw_undi_graph::height | ( | ) | const |
Return height of the smallest rectangle covering the drawing.
double draw_undi_graph::height | ( | gdtnode | v | ) | const |
Return the height of the smallest rectangle covering gdtnode v.
double draw_undi_graph::area | ( | ) | const |
Return the area of the smallest rectangle covering the drawing.
double draw_undi_graph::area | ( | gdtnode | v | ) | const |
Return the area of the smallest rectangle covering gdtnode v.
double draw_undi_graph::length | ( | gdtedge | e | ) | const |
Return the length of gdtedge e.
gdt::gdtpoint draw_undi_graph::center | ( | ) | const |
Return the center of the smallest rectangle covering the drawin.
gdt::gdtpoint draw_undi_graph::center | ( | gdtnode | v | ) | const |
Return the center of gdtnode v.
gdt::gdtpoint draw_undi_graph::label_position | ( | gdtnode | v | ) | const |
Return the label position of gdtnode v.
gdt::gdtpoint draw_undi_graph::label_position | ( | gdtedge | e | ) | const |
Return the label position of gdtedge e.
gdt::gdtpoint draw_undi_graph::anchor_source | ( | gdtedge | e | ) | const |
Return the anchor-source distance of gdtedge e.
gdt::gdtpoint draw_undi_graph::anchor_target | ( | gdtedge | e | ) | const |
Return the anchor-target distance of gdtedge e.
gdt::gdtpoint draw_undi_graph::anchor_source_point | ( | gdtedge | e | ) | const |
Return the anchor-source point of gdtedge e.
gdt::gdtpoint draw_undi_graph::anchor_target_point | ( | gdtedge | e | ) | const |
Return the anchor-target point of gdtedge e.
gdt::gdtpoint draw_undi_graph::anchor | ( | gdtedge | e, | |
gdtnode | v | |||
) | const |
Return the anchor-v distance of gdtedge e.
gdt::gdtpoint draw_undi_graph::anchor_point | ( | gdtedge | e, | |
gdtnode | v | |||
) | const |
Return the anchor-v point of gdtedge e.
gdt::gdtpoint draw_undi_graph::intersection_edge_node | ( | gdtedge | e, | |
gdtnode | v | |||
) | const |
Return the intersection point between gdtedge e and border of gdtnode v.
gdt::gdtlist<gdt::gdtpoint> draw_undi_graph::intersection_edge_edge | ( | gdtedge | e1, | |
gdtedge | e2 | |||
) | const |
Return the intersection points between gdtedge e1 and gdtedge e2.
gdt::gdtlist<gdt::gdtpoint> draw_undi_graph::bends | ( | gdtedge | e | ) | const |
Return the bend positions on gdtedge e, from source(e) to target(e).
gdt::gdtlist<gdt::gdtpoint> draw_undi_graph::bends | ( | gdtedge | e, | |
gdtnode | v | |||
) | const |
Return the bend positions on gdtedge e, from v to opposite(e,v);
gdt::gdtlist<gdt::gdtpoint> draw_undi_graph::crosses | ( | ) | const |
Return all the drawing cross points.
double draw_undi_graph::altitude | ( | gdtnode | v | ) | const |
Return the altitude (i.e. shadow depth) of gdtnode v.
bool draw_undi_graph::node_contains_point | ( | gdtnode | v, | |
gdt::gdtpoint | p | |||
) | const |
Return true if the gdtnode v contains p.
bool draw_undi_graph::edge_contains_point | ( | gdtedge | e, | |
gdt::gdtpoint | p | |||
) | const |
Return true if the gdtedge e contains p.
double draw_undi_graph::recommended_scale | ( | ) | const |
Return a recommended scale of drawing.
gdt::gdtpoint draw_undi_graph::recommended_label_position | ( | gdtnode | v | ) | const |
Return a recommended position for label of gdtnode v.
gdt::gdtpoint draw_undi_graph::recommended_label_position | ( | gdtedge | e | ) | const |
Return a recommended position for label of gdtedge e.
node_shape_type draw_undi_graph::shape | ( | gdtnode | v | ) | const |
Return the shape of gdtnode v.
edge_shape_type draw_undi_graph::shape | ( | gdtedge | e | ) | const |
Return the shape of gdtedge e.
std::string draw_undi_graph::label | ( | gdtnode | v | ) | const |
Return the label of gdtnode v.
std::string draw_undi_graph::label | ( | gdtedge | e | ) | const |
Return the label of gdtedge e.
bool draw_undi_graph::shadows_are_visible | ( | ) | const |
Return true if shadows are visible.
bool draw_undi_graph::node_labels_are_visible | ( | ) | const |
Return true if gdtnode-labels are visible.
bool draw_undi_graph::edge_labels_are_visible | ( | ) | const |
Return true if gdtedge-labels are visible.
Make visible the same method from undi_graph.
Reimplemented from undi_graph.
Make visible the same method from undi_graph.
Reimplemented from undi_graph.
gdtnode draw_undi_graph::find_node | ( | gdt::gdtpoint | p | ) | const |
Return a gdtnode v containing the point p. NULL_NODE if there is not any such a gdtnode.
gdtedge draw_undi_graph::find_edge | ( | gdt::gdtpoint | p | ) | const |
Return an gdtedge e containing the point p. NULL_EDGE if there is not any such an gdtedge.
gdt::list_item draw_undi_graph::find_bend | ( | gdt::gdtpoint | p, | |
gdtedge & | e | |||
) | const |
Return the gdt::list_item of a bend on point p if there is anyone. In this case put in e the gdtedge containing such a bend
int draw_undi_graph::number_of_bends | ( | ) | const |
Return the total number of bends in the drawing.
Return the number of bends along gdtedge e.
int draw_undi_graph::number_of_bends | ( | gdt::gdtlist< gdtedge > | l | ) | const |
Return the total number of bends along the edges in list l.
int draw_undi_graph::number_of_bends_max | ( | ) | const |
Return the maximum number of bends along an gdtedge in the drawing.
double draw_undi_graph::number_of_bends_avg | ( | ) | const |
Return the average number of bends along an gdtedge in the drawing.
double draw_undi_graph::number_of_bends_sdv | ( | ) | const |
Return the standard deviation of the number of bends along the edges.
double draw_undi_graph::edge_length_sum | ( | ) | const |
Return the total length obtained summing the lenght of each gdtedge.
double draw_undi_graph::edge_length_max | ( | ) | const |
Return the length of the longest gdtedge.
double draw_undi_graph::edge_length_avg | ( | ) | const |
Return the average of edges length.
double draw_undi_graph::edge_length_sdv | ( | ) | const |
Return the standard deviation of edges length.
double draw_undi_graph::screen_ratio_sdv | ( | ) | const |
Return the standard deviation of drawing ratio with respect to 4/3 screen ratio.
struct_draw_info draw_undi_graph::draw_defaults | ( | ) | const |
Return the draw_defaults internal structure.
struct_node_defaults draw_undi_graph::node_defaults | ( | ) | const |
Return the draw_node_defaults internal structure.
struct_edge_defaults draw_undi_graph::edge_defaults | ( | ) | const |
Return the draw_edge_defaults internal structure.
struct_draw_info draw_undi_graph::draw_status | ( | ) | const |
Return the draw_current internal status of drawing.
struct_draw_node_info draw_undi_graph::node_status | ( | gdtnode | v | ) | const |
Return the draw_current internal status of gdtnode.
struct_draw_edge_info draw_undi_graph::edge_status | ( | gdtedge | e | ) | const |
Return the draw_current internal status of gdtedge.
void draw_undi_graph::calc_bounding_box | ( | double & | x_min, | |
double & | x_max, | |||
double & | y_min, | |||
double & | y_max | |||
) | const |
Return the vertices of the bounding_box of the drawing.
Find a gdtnode "sn" and an gdtedge "se", such that the right face of gdtedge "se" starting form "sn" is the external face of the drawing. This detection if possible by using the drawing information (nodes and bends coordinates).
void draw_undi_graph::set_edge_sensivity | ( | double | k | ) |
Set the sensivity of the edges to the mouse click (default is 1).
void draw_undi_graph::set_width | ( | gdtnode | v, | |
double | l | |||
) |
Set the width of gdtnode with double.
void draw_undi_graph::set_height | ( | gdtnode | v, | |
double | l | |||
) |
Set the height of gdtnode with double.
void draw_undi_graph::set_bend_radius | ( | double | br | ) |
Set the bend radius (bend dimension).
void draw_undi_graph::set_center | ( | gdtnode | v, | |
gdt::gdtpoint | p | |||
) |
Set center of gdtnode at point.
void draw_undi_graph::set_altitude | ( | gdtnode | v, | |
double | d | |||
) |
Set altitude of gdtnode with double.
void draw_undi_graph::set_label_position | ( | gdtnode | v, | |
gdt::gdtpoint | p | |||
) |
Set the label position of gdtnode at point.
void draw_undi_graph::set_label_position | ( | gdtedge | e, | |
gdt::gdtpoint | p | |||
) |
Set the label position of gdtedge at point.
void draw_undi_graph::set_anchor_source | ( | gdtedge | e, | |
gdt::gdtpoint | p | |||
) |
Set the anchor-source distance of gdtedge with point.
void draw_undi_graph::set_anchor_target | ( | gdtedge | e, | |
gdt::gdtpoint | p | |||
) |
Set the anchor-target distance of gdtedge with point.
void draw_undi_graph::set_anchor_point | ( | gdtedge | e, | |
gdtnode | v, | |||
gdt::gdtpoint | p | |||
) |
Set the anchor-point of gdtedge at gdtnode with point.
void draw_undi_graph::set_bends | ( | gdtedge | e, | |
gdt::gdtlist< gdt::gdtpoint > | bl | |||
) |
Set bends of gdtedge with gdt::gdtlist<point>, starting from source(e).
void draw_undi_graph::set_bends | ( | gdtedge | e, | |
gdtnode | v, | |||
gdt::gdtlist< gdt::gdtpoint > | bl | |||
) |
Set bends of gdtedge with gdt::gdtlist<point>, starting from gdtnode. PRECONDITIONS: gdtnode belongs to gdtedge
Remove from gdtedge e the bends that are avoidable. Return the number of bends removed.
int draw_undi_graph::remove_avoidable_bends | ( | ) |
Remove from all edges the bends that are avoidable. Return the number of bends removed.
gdt::gdtlist<gdtnode> draw_undi_graph::replace_long_edge_with_chain | ( | gdtedge | e | ) |
If gdtedge e is longer than 10 units (which is the standard gdt distance between grid lines), replace e with a path. Return the list of introduced nodes.
Preconditions: (1) all edges are straight-line segments; (2) each edge is either parallel to the x or to the y axis (3) the distance between the starting point and the ending point of the edge is a multiple of 10 (gdt standard distance between grid lines). Observe that: (a) Due to precondition (1) you may have to run replace_bends_with_nodes() first. (b) Due to precondition (2) you may have to run undo_space_overlapping_edges() before running replace_bends_with_nodes().
gdt::gdtlist<gdtnode> draw_undi_graph::replace_long_edges_with_chains | ( | ) |
Replace each edge longer than 10 units with a path. Return the list of introduced nodes. All preconditions of method replace_long_edge_with_chain apply.
void draw_undi_graph::space_overlapping_edges | ( | ) |
Assumes that the edges of *this enter each node overlapping at the same point. Distributes edges putting a small space between each one of them. This method is meant to be used with orthogonal drawings where edges enter the sides of the nodes perpendicular to the border of the node.
void draw_undi_graph::undo_space_overlapping_edges | ( | gdtedge | e | ) |
If gdtedge e has been modified by method space_overlapping_edges, return it to its previous state. Assumes that only the first (and last) bend of the edge has been modified by space_overlapping_edges. Attention: this method does not change the anchor point of the edge
void draw_undi_graph::undo_space_overlapping_edges | ( | ) |
If *this e has been modified by method space_overlapping_edges, return it to its previous state. All assumptions and caveats of undo_space_overlapping_edges(gdtedge e) apply.
gdt::gdtlist<gdtnode> draw_undi_graph::replace_bends_with_nodes | ( | gdtedge | e | ) |
If gdtedge e has no bends, then it remains unchanged. If gdtedge e has at least one bend, then it is removed and is replaced with a path. Return the list of the inserted nodes.
gdt::gdtlist<gdtnode> draw_undi_graph::replace_bends_with_nodes | ( | ) |
Replace all bends with dummy vertices and return the list of the dummy vertices introduced.
Set border-color of gdtnode with color.
void draw_undi_graph::set_shape | ( | gdtnode | v, | |
node_shape_type | st | |||
) |
Set shape of gdtnode with node_shape_type.
void draw_undi_graph::set_shape | ( | gdtedge | e, | |
edge_shape_type | st | |||
) |
Set shape of gdtedge with edge_shape_type (currently only NORMAL is available).
void draw_undi_graph::set_label | ( | gdtnode | v, | |
std::string | s | |||
) |
Set label of gdtnode with string.
Referenced by gdt::PQ_tree< T >::PQ_tree_into_undi_graph().
void draw_undi_graph::set_label | ( | gdtedge | e, | |
std::string | s | |||
) |
Set label of gdtedge with string.
void draw_undi_graph::show_shadows | ( | ) |
Enable showing of shadows.
void draw_undi_graph::show_node_labels | ( | ) |
Enable showing of gdtnode labels.
void draw_undi_graph::show_edge_labels | ( | ) |
Enable showing of gdtedge labels.
void draw_undi_graph::hide_shadows | ( | ) |
Disable showing of shadows.
void draw_undi_graph::hide_node_labels | ( | ) |
Disable showing of gdtnode labels.
void draw_undi_graph::hide_edge_labels | ( | ) |
Disable showing of gdtedge labels.
void draw_undi_graph::apply_defaults | ( | ) |
Apply defaults internal values to general draw_info.
void draw_undi_graph::apply_defaults | ( | gdtnode | v | ) |
Apply defaults internal values to draw_node_info of nod
void draw_undi_graph::apply_defaults | ( | gdtedge | e | ) |
Apply defaults internal values to draw_edge_info of gdtedge
void draw_undi_graph::shift | ( | double | sh, | |
direction_type | dir | |||
) |
Execute a shifting of double distance in direction_type
void draw_undi_graph::rotate | ( | angle_type | angle, | |
gdt::gdtpoint | ref | |||
) |
Execute a rotation of angle_type angle around point ref. Possible values for parameter angle are _000, _090, _180, _270
void draw_undi_graph::flip_horizontally | ( | gdt::gdtpoint | fulcrum | ) |
Execute a flipping of the drawing, with respect to a vertical line passing for point.
void draw_undi_graph::flip_vertically | ( | gdt::gdtpoint | fulcrum | ) |
Execute a flipping of the drawing, with respect to a horizontal line passing for point.
void draw_undi_graph::rescale | ( | double | k = 0 |
) |
Set the scale as k and update all coordinates. If k is not specified, it is assumed as recommended_scale.
void draw_undi_graph::set_draw_defaults | ( | struct_draw_info | dd | ) |
Set the draw_info defaults.
void draw_undi_graph::set_node_defaults | ( | struct_node_defaults | nd | ) |
Set the draw_node_info defaults.
void draw_undi_graph::set_edge_defaults | ( | struct_edge_defaults | ed | ) |
Set the draw_edge_info defaults.
void draw_undi_graph::set_draw_status | ( | struct_draw_info | ds | ) |
Set the draw_current internal status with struct_draw_info.
void draw_undi_graph::set_node_status | ( | gdtnode | v, | |
struct_draw_node_info | ni | |||
) |
Set the draw_current internal status of gdtnode with struct_draw_node_info.
void draw_undi_graph::set_edge_status | ( | gdtedge | e, | |
struct_draw_edge_info | ei | |||
) |
Set the draw_current internal status of gdtedge with struct_draw_edge_info.
void draw_undi_graph::set_node_status_preserving_positions | ( | gdtnode | v, | |
struct_draw_node_info | ni | |||
) |
Set the draw_current internal status of gdtnode with struct_draw_node_info, but do not change center coordinates.
void draw_undi_graph::set_edge_status_preserving_positions | ( | gdtedge | e, | |
struct_draw_edge_info | ei | |||
) |
Set the draw_current internal status of gdtedge with struct_draw_edge_info, but do not change bends coordinates.
void draw_undi_graph::update_label_positions_after_movement_of_node | ( | gdtnode | v | ) |
Update label-position of gdtnode and of each gdtedge adjacent gdtnode.
void draw_undi_graph::update_label_position_after_movement_of_bend_along_edge | ( | gdtedge | e | ) |
Update label-position of gdtedge.
void draw_undi_graph::update_node_and_bend_positions_according_to | ( | dime_orth_plan_undi_graph & | dopug | ) |
Update gdtnode and bend coordinates according to the dopug ones. PRECONDITIONS: dopug have the same set of nodes, edges and bends as *this
void draw_undi_graph::update_node_and_bend_positions_according_to | ( | draw_undi_graph & | dug | ) |
Update gdtnode and bend coordinates according to the dopug ones.
PRECONDITIONS: dug have the same set of nodes, edges and bends as *this
void draw_undi_graph::set_dummy_nodes_and_edges_status | ( | ) |
Set the internal status of nodes and edges marked as RM3_ADDED_BY_RECTANGULARIZATION and RM3_REPLACE_A_BEND.
void draw_undi_graph::clear | ( | ) |
Delete all nodes and edges.
Reimplemented from undi_graph.
gdtnode draw_undi_graph::new_node | ( | gdt::gdtpoint | p, | |
int | new_id = AUTO_ID | |||
) |
Insert a new gdtnode with center in point p, and return it.
gdtedge draw_undi_graph::new_edge | ( | gdtnode | v, | |
gdtnode | w, | |||
gdt::gdtlist< gdt::gdtpoint > | bl, | |||
int | new_id = AUTO_ID | |||
) |
Insert a new gdtedge (v,w) with bends bl from v to w, and return it.
gdtedge draw_undi_graph::new_edge | ( | gdtnode | v, | |
gdtedge | e, | |||
gdtnode | w, | |||
gdt::gdtlist< gdt::gdtpoint > | bl, | |||
int | new_id = AUTO_ID , |
|||
int | dir = gdt::after | |||
) |
Insert a new gdtedge (v,w) with bends bl from v to w, and return it. Topologically, the new gdtedge is put after/before gdtedge e around v.
gdtedge draw_undi_graph::new_edge | ( | gdtnode | v, | |
gdtedge | ev, | |||
gdtnode | w, | |||
gdtedge | ew, | |||
gdt::gdtlist< gdt::gdtpoint > | bl, | |||
int | new_id = AUTO_ID , |
|||
int | dir = gdt::after | |||
) |
Insert a new gdtedge (v,w) with bends bl from v to w, and return it. Topologically, the new gdtedge is put after/before gdtedge ev around v and after/before gdtedge ew around w.
void draw_undi_graph::new_bend | ( | gdtedge | e, | |
gdtnode | v, | |||
int | i, | |||
gdt::gdtpoint | p | |||
) |
Insert a new bend on gdtedge e, at position i into the bend list of e, starting from v, and in point p. PRECONDITIONS: gdtedge e has at least i-1 bends
gdtnode draw_undi_graph::replace_cross_with_node | ( | gdtedge | e1, | |
gdtedge | e2, | |||
gdt::gdtpoint | p | |||
) |
Insert and return a new gdtnode with center p, by splitting the two edges e1 and e2. The new gdtnode is marked as RM3_CROSS_ON_REAL_EDGE. PRECONDITIONS: p is an intersection-point between e1 and e2
gdt::gdtlist<gdtnode> draw_undi_graph::replace_crosses_with_nodes | ( | ) |
Replace all cross-points of the drawing with dummy nodes, and return the list of these dummy nodes. All added nodes are marked as RM3_CROSS_ON_REAL_EDGE.
void draw_undi_graph::remove_cross_node | ( | gdtnode | v | ) |
Remove a cross gdtnode v, by merging the adjacent edges appropriately. PRECONDITIONS: v was marked as RM3_CROSS_ON_REAL_EDGE by a replace_cross.. method
void draw_undi_graph::remove_cross_nodes | ( | gdt::gdtlist< gdtnode > | nl | ) |
Remove a list nl of cross nodes, by merging the adjacent edges appropriately. PRECONDITIONS: each gdtnode in nl was marked as RM3_CROSS_ON_REAL_EDGE by a replace_cross.. method
std::set<gdt::gdtpoint,ltpt> draw_undi_graph::remove_cross_nodes | ( | ) |
Remove all nodes marked as RM3_CROSS_ON_REAL_EDGE by a replace_cross.. method, and return the set of center-point of nodes removed (cross-points).
gdtedge draw_undi_graph::remove_two_degree_node | ( | gdtnode | v, | |
gdt::gdtlist< marker_type > * | Lp = NULL | |||
) |
Remove v and merge its two adjacent edges e1=(v1,v), e2=(v2,v) into a new gdtedge e=(v1,v2), then return e. If Lp is specified, the direction of e is chosen as the direction of either e1 or e2 if v1 or v2 has not any marker in Lp, respectively. Else, the direction of e is chosen randomly among e1 or e2 ones.
bool draw_undi_graph::draw | ( | std::string | file_name | ) |
Draw all nodes and edges into the window W. If curve=true edges is drawn as a bezier-curve.
void draw ( window& W, bool curve = false, int ref1 = 300, double ref2 = 0.4 ); Draw the gdtnode v into the window W.
void draw ( gdtnode v, window& W ); Draw the gdtedge e into the window W. If curve=true gdtedge is drawn as a bezier-curve.
void draw ( gdtedge e, window& W, bool curve = false, int ref1 = 300, double ref2 = 0.4 ); Draw the gdtnode v and all the edges around it into the window W.
void draw_around ( gdtnode v, window& W ); Print on file the main properties of the drawing, with the following conventions:
1 - each gdtnode is represented by a rectangular box of dimension w x h;
2 - each gdtedge is represented by a polygonal line p1 -- p2 -- ... -- pk
3 - file format is the following:
<NODELIST>
<NODE> id (cx,cy) w h </NODE>
...
</NODELIST>
<EDGELIST>
<EDGE> id <DIRECTION> -> <BEND> (x1,y1) <BEND> (x2,y2) ... <BEND> (xk,yk)
</EDGE>
...
</EDGELIST>
where: id = gdtnode/gdtedge identifier;
cx cy = coordinates of the center of gdtnode;
w, h = width and height of the gdtnode;
xj yj = coordinates of the point pj defining the polygonal line
'->' '<-' '--' = indicate the direction of the gdtedge moving from (x1,y1) to (xk,yk)
if an error occured while opening the file, false is returned.
bool draw_undi_graph::write | ( | std::string | file_name | ) |
Write the draw in a file file_name.
Reimplemented from undi_graph.
Referenced by gdt::PQ_tree< T >::PQ_tree_into_undi_graph().
bool draw_undi_graph::read | ( | std::string | file_name | ) |
Read the draw from the file file_name.
Reimplemented from undi_graph.
void draw_undi_graph::append_section_to_fstream | ( | std::ofstream & | out | ) |
Append the draw_undi_graph section to ofstream out.
Reimplemented from undi_graph.
void draw_undi_graph::read_section_from_fstream | ( | std::ifstream & | in | ) |
Read the draw_undi_graph section to ifstream in.
Reimplemented from undi_graph.
void draw_undi_graph::export_to_fig_file_format | ( | bool | spline_edge, | |
double | refinement, | |||
double | scale_factor, | |||
std::ostream & | out = std::cout | |||
) |
Export the draw_undi_graph object into the "fig" file format (version 3.2) and append the output to the specified ofstream (cout for default): "spline_edge" = gdtedge approximated with spline if true (default=false); "refinement" = a factor for variate the number of control points of the spline; "scale_factor" = indicates a zoom-factor for the drawing in xfig (default = 1 = normal dimension) "out" = ostream (default = cout)
void draw_undi_graph::export_to_fig_file_format | ( | std::ostream & | out = std::cout |
) |
Export the draw_undi_graph object into the "fig" file format (version 3.2) and append the output to the specified ofstream (cout for default): "out" = ostream (default = cout)
void draw_undi_graph::export_to_fig_file_format | ( | std::string | file_name, | |
bool | spline_edge = false , |
|||
float | refinement = 0.4 , |
|||
float | scale_factor = 1 | |||
) |
Export the draw_undi_graph object into the "fig" file format (version 3.2) and put it in a file named "file_name". "spline_edge" = gdtedge approximated with spline if true (default=false); "scale_factor" = indicates a zoom-factor for the drawing in xfig (default = 1 = normal dimension) "refinement" = a factor for variate the number of control points of the spline; "file_name" = name of the output file
void draw_undi_graph::export_to_xml_file_format | ( | std::ostream & | out = std::cout |
) |
Export the draw_undi_graph object to an "xml" file format and append the output to the specified ofstream (cout for default): "out" = ostream (default = cout). The DTD of the xml document is defined in the file itself, and it is simple to understand. It is based on the description of the attributes given by the "draw (string file_name)" method.
Note: currently the xml file only describes the geometry of the drawing
void draw_undi_graph::export_to_xml_file_format | ( | std::string | file_name | ) |
Export the draw_undi_graph object to an "xml" file format and put it in a file named "file_name". The DTD of the xml document is defined in the file itself, and it is simple to understand. It is based on the description of the attributes given by the "draw (string file_name)" method.
Note: currently the xml file only describes the geometry of the drawing
bool draw_undi_graph::export_to_graphml_file_format | ( | std::string | file_name | ) |
Export the draw_undi_graph object to JGraph Builder file format and put it in a file named "file_name".
bool draw_undi_graph::import_from_graphml_file_format | ( | std::string | file_name | ) |
Initialize a draw_undi_graph object from a file named "file_name" in JGraph Builder format.