Commit 52f8d538 authored by Clément Vuchener's avatar Clément Vuchener

Affichage evenements (presque)

parent aff3d465
......@@ -21,7 +21,7 @@ class DrawTrace
protected:
// Interface_graphic* _window;
std::stack<const list<State *> *> _stack_states;
std::stack<const Container *> _leaf_containers;
/*!
* \brief The default height for containers.
......@@ -122,7 +122,7 @@ public:
draw_object->end_draw_containers();
draw_object->start_draw_states();
browse_state_tree(draw_object);
browse_entities(draw_object);
draw_object->end_draw_states();
draw_object->end_draw();
......@@ -209,8 +209,8 @@ public:
height_stack.push(y_buf);
y += y_buf;
/* Then, we store the list of entity */
_stack_states.push(container->get_states());
/* Then, we store the container */
_leaf_containers.push(container);
height_buf = _container_height;
......@@ -280,31 +280,46 @@ public:
/*!
* \brief Browse the states list and draw them
*/
inline void browse_state_tree(T* draw_object) {
const list<State *> *buf_list;
State* buf_entity;
inline void browse_entities(T* draw_object) {
const Container *container;
const list<State *> *state_list;
State* state;
const list<Event *> *event_list;
Event* event;
Element_count i;/* for the level (y axis) of the states */
i=0;
while (!_stack_states.empty()){
buf_list = _stack_states.top();
for (list<State *>::const_iterator it = buf_list->begin();
it != buf_list->end();
i = 0;
while (!_leaf_containers.empty()){
container = _leaf_containers.top();
// Browse states
state_list = container->get_states();
for (list<State *>::const_iterator it = state_list->begin();
it != state_list->end();
it++) {
buf_entity = *it;
state = *it;
Element_pos base = ((Element_pos)i)*_container_height+((Element_pos)i)*_container_v_space+_container_v_space;
/* Call the object state drawing function */
draw_object->draw_state(buf_entity->get_start_time().get_value(), buf_entity->get_end_time().get_value(), base, _state_height, 0.7, 0.7, 0.75);
draw_object->draw_state(state->get_start_time().get_value(), state->get_end_time().get_value(), base, _state_height, 0.7, 0.7, 0.75);
}/* end for */
// Browse events
event_list = container->get_events();
for (list<Event *>::const_iterator it = event_list->begin();
it != event_list->end();
it++) {
event = *it;
Element_pos base = ((Element_pos)i)*_container_height+((Element_pos)i)*_container_v_space+_container_v_space;
/* Call the object state drawing function */
draw_object->draw_event(event->get_time().get_value(), base, _state_height);
}/* end for */
/* next container */
_leaf_containers.pop();
i++;
/* pop the top of the stack */
_stack_states.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