Commit 24ff411b authored by Kevin Coulomb's avatar Kevin Coulomb

Modifications for the otf, 2 methods to draw messages added

parent a53de7c3
......@@ -269,6 +269,25 @@ public:
*/
virtual void draw_event(const Element_pos time, const Element_pos height, const Element_pos container_height) =0;
/*!
* \brief Draw an event of sending a message
* \param time time when the event occurs.
* \param height vertical position of the event.
* \param container_height information to draw event. It corresponds to the container height when they are drawn horizontally.
*
* This function stores all the information of the event to display it each time the render area need to be updated.
*/
virtual void draw_event_send_message(const Element_pos time, const Element_pos height, const Element_pos container_height) =0;
/*!
* \brief Draw an event of getting a message
* \param time time when the event occurs.
* \param height vertical position of the event.
* \param container_height information to draw event. It corresponds to the container height when they are drawn horizontally.
*
* This function stores all the information of the event to display it each time the render area need to be updated.
*/
virtual void draw_event_get_message(const Element_pos time, const Element_pos height, const Element_pos container_height) =0;
/*!
* \brief Draw events contained in the Event_ vector
* \param events An event vector.
......
......@@ -209,7 +209,24 @@ public:
* This function stores all the information of the event to display it each time the render area need to be updated.
*/
void draw_event(const Element_pos time, const Element_pos height, const Element_pos container_height);
/*!
* \brief Draw an event of sending a message
* \param time time when the event occurs.
* \param height vertical position of the event.
* \param container_height information to draw event. It corresponds to the container height when they are drawn horizontally.
*
* This function stores all the information of the event to display it each time the render area need to be updated.
*/
void draw_event_send_message(const Element_pos time, const Element_pos height, const Element_pos container_height);
/*!
* \brief Draw an event of getting a message
* \param time time when the event occurs.
* \param height vertical position of the event.
* \param container_height information to draw event. It corresponds to the container height when they are drawn horizontally.
*
* This function stores all the information of the event to display it each time the render area need to be updated.
*/
void draw_event_get_message(const Element_pos time, const Element_pos height, const Element_pos container_height);
/*!
* \brief Draw events contained in the Event_ vector
* \param events An event vector.
......@@ -636,6 +653,14 @@ inline void Render_opengl_dl::draw_event(const Element_pos time, const Element_p
_events.push_back(buf);
}
inline void Render_opengl_dl::draw_event_send_message(const Element_pos time, const Element_pos height, const Element_pos container_height){
return;
}
inline void Render_opengl_dl::draw_event_get_message(const Element_pos time, const Element_pos height, const Element_pos container_height){
return;
}
inline void Render_opengl_dl::draw_stored_events(std::vector<Event_> &events){
......
......@@ -357,6 +357,9 @@ public:
*/
void draw_event(const Element_pos time, const Element_pos height, const Element_pos container_height);
void draw_event_get_message(const Element_pos time, const Element_pos height, const Element_pos container_height);
void draw_event_send_message(const Element_pos time, const Element_pos height, const Element_pos container_height);
/*!
* \brief initialise drawer automaton
......@@ -762,6 +765,28 @@ inline void Svg::draw_event(const Element_pos time, const Element_pos height, c
}
/*!
* \fn void Svg::draw_event_send_message(const Element_pos time, const Element_pos height, const Element_pos container_height)
* \brief Draw the events in the svg
* \param time The time the element occur
* \param height The height of the event
* \param container_height The height of the container that contains it
*/
inline void Svg::draw_event_send_message(const Element_pos time, const Element_pos height, const Element_pos container_height) {
return;
}
/*!
* \fn void Svg::draw_event_get_message(const Element_pos time, const Element_pos height, const Element_pos container_height)
* \brief Draw the events in the svg
* \param time The time the element occur
* \param height The height of the event
* \param container_height The height of the container that contains it
*/
inline void Svg::draw_event_get_message(const Element_pos time, const Element_pos height, const Element_pos container_height) {
return;
}
#endif // RENDER_SVG
......@@ -125,6 +125,24 @@ public:
Element_pos y = _position*(_container_height+_container_v_space) + _container_v_space/2;
_draw_object->draw_event(time, y, _state_height);
}
/*!
* \fn draw_event_send_message(double time)
* \brief Draw an event of sending a message
* \param time Time of the event
*/
inline void draw_event_send_message(double time) {
Element_pos y = _position*(_container_height+_container_v_space) + _container_v_space/2;
_draw_object->draw_event_send_message(time, y, _state_height);
}
/*!
* \fn draw_event_get_message(double time)
* \brief Draw an event of receiving a message
* \param time Time of the event
*/
inline void draw_event_get_message(double time) {
Element_pos y = _position*(_container_height+_container_v_space) + _container_v_space/2;
_draw_object->draw_event_get_message(time, y, _state_height);
}
/*!
* \fn draw_busy(Interval *I)
......@@ -159,7 +177,12 @@ struct DrawNode<D, Event> {
* \brief To draw a node of type Event with a painting object of type D
*/
static void draw_node(DrawTree<D, Event> *draw, Node<Event> *node) {
draw->draw_event(node->get_element()->get_time().get_value());
if(node->get_element()->get_type()->get_name().to_string() == "send")
draw->draw_event_send_message(node->get_element()->get_time().get_value());
else if(node->get_element()->get_type()->get_name().to_string() == "get")
draw->draw_event_get_message(node->get_element()->get_time().get_value());
else
draw->draw_event(node->get_element()->get_time().get_value());
}
};
......
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