Commit 471f7878 authored by Clément Vuchener's avatar Clément Vuchener

Affichage liens (presque aussi)

parent 7bde1d57
......@@ -10,7 +10,6 @@
#include "../interface/render_area.hpp"
/*!
* \brief
*/
......@@ -22,6 +21,8 @@ protected:
// Interface_graphic* _window;
std::stack<const Container *> _leaf_containers;
std::stack<const Container *> _node_containers;
std::map<const Container *, Element_pos, std::less<const Container *> > _container_positions;
/*!
* \brief The default height for containers.
......@@ -211,6 +212,8 @@ public:
/* Then, we store the container */
_leaf_containers.push(container);
// and its position
_container_positions[container] = y;
height_buf = _container_height;
......@@ -246,6 +249,9 @@ public:
draw_object->draw_container_text(x-_container_width+_container_h_space, y- height_buf/2, container->get_name().to_string());
x -= (_container_width + _container_h_space);
/* Then, we store the container */
_node_containers.push(container);
}
......@@ -283,9 +289,11 @@ public:
inline void browse_entities(T* draw_object) {
const Container *container;
const list<State *> *state_list;
State* state;
State *state;
const list<Event *> *event_list;
Event* event;
Event *event;
const list<Link *> *link_list;
Link *link;
Element_count i;/* for the level (y axis) of the states */
i = 0;
......@@ -321,6 +329,26 @@ public:
i++;
}/* end while (!_stack_states.empty()) */
while (!_node_containers.empty()){
container = _node_containers.top();
// Browse links
link_list = container->get_links();
for (list<Link *>::const_iterator it = link_list->begin();
it != link_list->end();
it++) {
link = *it;
Element_pos start = _container_positions[link->get_source()];
Element_pos end = _container_positions[link->get_destination()];
draw_object->draw_arrow(link->get_start_time().get_value(), link->get_end_time().get_value(), start, end);
}/* end for */
/* next container */
_node_containers.pop();
}/* end while (!_stack_states.empty()) */
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment