Commit 23d5a7b0 authored by Pascal Noisette's avatar Pascal Noisette

selection astusieuse : (manque selection des chronogrammes)

parent 0633b3f2
......@@ -57,7 +57,6 @@
#define min(a,b) (a>b?b:a);
/*!
* \brief Trace can be exported on a selected period of time, beginning with _start_interval_time, default 0 and command line changed with -t _start_interval_time _end_interval_time or the static svg::set_interval(Times t1,Times t2)
*/
......@@ -389,7 +388,8 @@ inline void Svg::start_draw_counter(){
}
inline void Svg::draw_counter(const Element_pos x, const Element_pos y){
Element_pos xprime = x*_wide_factor + _container_width_max ;
Element_pos yprime = y* _height_factor + MARGINTOP;
Element_pos switchvalue = _container_width_max;
......@@ -499,17 +499,65 @@ inline void Svg::start_draw_arrows(){
inline void Svg::draw_arrow(const Element_pos start_time, const Element_pos end_time, const Element_pos start_height, const Element_pos end_height){
/*selection*/
/*may be outofrange*/
if (_end_interval_time)
if (start_time>_end_interval_time)
return;
if (end_time<_start_interval_time)
return;
/*line equation y = a*x+b */
Element_pos a = ( 1.0*(end_height - start_height) )/(end_time - start_time);
Element_pos b = start_height - a*(start_time);
Element_pos start_timeprime;
Element_pos end_timeprime;
Element_pos start_heightprime;
Element_pos end_heightprime;
bool trunc = false;
/*begining*/
if (start_time<_start_interval_time)
{
start_timeprime = _start_interval_time ;
start_heightprime = a*start_timeprime+b;
}
else
{
start_timeprime = start_time ;
start_heightprime = start_height;//which stay a*starttimeprime+b
}
/*endding*/
end_timeprime = end_time ;
end_heightprime = end_height;//except :
if (_end_interval_time)
{
if (end_time>_end_interval_time)
{
trunc = true;
end_timeprime = _end_interval_time;
end_heightprime = a*end_timeprime+b;
}
}
Element_pos x1=(start_time )*_wide_factor + _container_width_max ;
Element_pos y1=start_height* _height_factor + MARGINTOP;
Element_pos x2=(end_time)*_wide_factor+ _container_width_max;
Element_pos y2=end_height* _height_factor + MARGINTOP;
Element_pos x1=(start_timeprime )*_wide_factor + _container_width_max ;
Element_pos y1=start_heightprime* _height_factor + MARGINTOP;
Element_pos x2=(end_timeprime)*_wide_factor+ _container_width_max;
Element_pos y2=end_heightprime* _height_factor + MARGINTOP;
Svg::line("arrow",x1 ,y1 ,x2,y2);
Svg::triangle("arrow",x2 ,y2+ARROWSIZE,x2 ,y2-ARROWSIZE,x2+ARROWSIZE,y2);//spike
if (!trunc)
Svg::triangle("arrow",x2 ,y2+ARROWSIZE,x2 ,y2-ARROWSIZE,x2+ARROWSIZE,y2);//spike
}
......@@ -537,13 +585,44 @@ inline void Svg::draw_container(const Element_pos x, const Element_pos y, const
inline void Svg::draw_state(const Element_pos start , const Element_pos end, const Element_pos level, const Element_pos height, const Element_col r, const Element_col g, const Element_col b){
Element_pos w =end*_wide_factor-start*_wide_factor;
Element_pos h = _container_height_min;
Element_pos x = (start )*_wide_factor+ _container_width_max + MARGINSTATE;
Element_pos y = level* _height_factor + MARGINTOP;
Element_pos w;
Element_pos h;
Element_pos x;
Element_pos y;
Element_pos startprime;
Element_pos endprime;
/*selection*/
/*may be outofrange*/
if (_end_interval_time)
if (start>_end_interval_time)
return;
if (end<_start_interval_time)
return;
/*begining*/
if (start<_start_interval_time)
startprime = _start_interval_time ;
else
startprime = start ;
/*endding*/
endprime = end; //except :
if (_end_interval_time)
{
if (end>_end_interval_time)
endprime = _end_interval_time;
}
w = endprime*_wide_factor-startprime*_wide_factor;
h = _container_height_min;
x = (startprime )*_wide_factor + _container_width_max + MARGINSTATE;
y = level* _height_factor + MARGINTOP;
if(w<_epsilon){
......@@ -561,6 +640,15 @@ inline void Svg::draw_state(const Element_pos start , const Element_pos end, con
*/
inline void Svg::draw_event(const Element_pos time, const Element_pos height, const Element_pos container_height){
/*selection*/
if (time<_start_interval_time)
return;
if (_end_interval_time){
if (time>_end_interval_time)
return;
}
Svg::rectangle("event",MARGIN,container_height, time + _container_width_max , height + MARGINTOP, 0x17, 0x60, 0xe7);
}
......
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