Commit 540caf23 authored by Mathieu Faverge's avatar Mathieu Faverge

Some cleanups

parent 1f990cff
......@@ -487,13 +487,6 @@ bool Core::draw_trace(const string & filename, const int format) {
DrawTrace drawing_ogl;
bool killed=false;
#ifdef WITH_VBO
Render<Render_alternate>render(_render_opengl) ;
#else
Render<Render_opengl> render(_render_opengl) ;
#endif
_render=(void*)&render;
QTime time_elapsed;
ostringstream buf_txt;
int time_buf = 0;
......@@ -526,9 +519,9 @@ bool Core::draw_trace(const string & filename, const int format) {
_trace = new Trace();
// Init of the thread
_finished= new QWaitCondition();
_closed= new QWaitCondition();
_mutex= new QMutex();
_finished = new QWaitCondition();
_closed = new QWaitCondition();
_mutex = new QMutex();
QThread thread;
......@@ -755,10 +748,10 @@ bool Core::draw_trace(const string & filename, const int format) {
if(!_xml_config_file.empty() && _trace->get_view_root_containers()->empty()){//if we have a partial loading, process it here, but only once
launch_action(_DRAW_OPENGL_PARTIAL,NULL);
}
if (_DRAW_OPENGL == format) {
if (_DRAW_OPENGL == format) {
drawing_ogl.build(&render, _trace);
drawing_ogl.build(&_render_opengl, _trace);
_render_opengl->build();
// _render_opengl->updateGL();
_render_opengl->refresh_scroll_bars();
......
This diff is collapsed.
This diff is collapsed.
......@@ -6,13 +6,13 @@
** use, modify and/or redistribute the software under the terms of the
** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
......@@ -23,7 +23,7 @@
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-A license and that you accept its terms.
**
......@@ -37,7 +37,7 @@
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
** - VUCHENER Clément
**
*/
/*!
......@@ -211,7 +211,7 @@ 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 events contained in the Event_ vector
* \param events An event vector.
......@@ -730,7 +730,7 @@ inline void Render_opengl_dl::draw_counter(const Element_pos x, const Element_po
glBegin(GL_LINE_STRIP);/* set of connected verteces */
glColor3d(1.0, 1.0, 1.0);glVertex2d(0.0, y);/* draw the init point */
_counter_last_x = x;
_counter_last_y = y;
_start_new_line = false;
......@@ -822,7 +822,7 @@ inline void Render_opengl_dl::display_container(Element_count , Element_count ){
buf_txt = *it_txt;
glPushMatrix();
{
{
glTranslatef(0.0f, -_y_state_translate, 0.0f);
glScalef((_render_width/_container_x_max)*_x_scale_container_state, _y_state_scale*(_render_height-_ruler_height)/_container_y_max, 0.0f);
......
......@@ -6,13 +6,13 @@
** use, modify and/or redistribute the software under the terms of the
** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
......@@ -23,7 +23,7 @@
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-A license and that you accept its terms.
**
......@@ -37,7 +37,7 @@
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
** - VUCHENER Clément
**
*/
/*!
......@@ -52,10 +52,10 @@
* \brief This class provides an interface for render classes like OpenGL or SVG.
*/
class Render_template
{
{
public:
/*!
* \brief Proceeds with the initialization of draw functions.
*/
......@@ -70,7 +70,7 @@ public:
* \brief Called when all container draws are finished.
*/
virtual void end_draw_containers() = 0;
/*!
* \brief Proceeds with the initialization of state draw functions.
*/
......@@ -95,7 +95,7 @@ public:
* \brief Proceeds with the initialization of counter draw functions.
*/
virtual void start_draw_counter() = 0;
/*!
* \brief Called when all counter draws are finished.
*/
......@@ -105,12 +105,12 @@ public:
* \brief Called before ruler drawing.
*/
virtual void start_ruler() = 0;
/*!
* \brief Called after ruler drawing.
*/
virtual void end_ruler() = 0;
/*!
* \brief Called when all draws are finished.
*/
......@@ -120,7 +120,7 @@ public:
* \brief Set the color for the further drawings.
* \param r the red value. Within [0 ; 1].
* \param g the green value. Within [0 ; 1].
* \param b the blue value. Within [0 ; 1].
* \param b the blue value. Within [0 ; 1].
*/
virtual void set_color(float r, float g, float b) = 0;
......
......@@ -263,8 +263,9 @@ public:
*
**********************************/
/*
* \fn browse_container_tree(T* draw_object, Trace* trace, Container::Vector container)
* \brief Function that browses the containers of the trace argument that are in the set container and make them painted with a T object
* \fn browse_container_tree
* \brief Function that browses the containers of the trace argument that
* are in the set container and make them painted with a T object
*/
template<class T>
inline void browse_container_tree(T* draw_object, Trace* trace, std::vector<const Container *> *container){
......@@ -272,32 +273,39 @@ public:
int position = 0;
const Container::Vector *root_containers = trace->get_view_root_containers();
if(root_containers->empty())root_containers= trace->get_root_containers();
if (root_containers->empty())
root_containers = trace->get_root_containers();
if (root_containers->empty()) {
*Message::get_instance() << QObject::tr("There is no container. The trace can not be drawn.").toStdString() << Message::endw;
}
else
else {
for (Container::VectorIt i = root_containers->begin();
i != root_containers->end();
i++)
// Use the fact a container is selected implies all his ancestors are
i != root_containers->end();
i++)
// Use the fact that if a container is selected, then it implies that all his ancestors are
if(is_in_set(*i,container))
position += browse_container(draw_object, *i, position, 0,container);
}
}/* end browse_container_tree */
/*
* \fn browse_container(T* draw_object, const Container *container, int position, int depth, Container::Vector set_container)
* \brief Recursive function that browse a container to draw it if it is in the set of container with a T painting object in position, knowing the current depth in the tree
* \fn browse_container
* \brief Recursive function that browse a container to draw it if it is in
* the set of container with a T painting object in position, knowing the
* current depth in the tree
*/
template<class T>
int browse_container(T* draw_object, const Container *container, int position, int depth, std::vector<const Container *> *set_container) {
int browse_container(T* draw_object, const Container *container, int position, int depth,
std::vector<const Container *> *set_container) {
int size = 0;
// Draw children
const Container::Vector *children = container->get_view_children();//we want to display only children meant to be displayed
if(children->empty())children = container->get_children();
// Draw children:
// we want to display only children meant to be displayed
const Container::Vector *children = container->get_view_children();
if( children->empty() )
children = container->get_children();
for (Container::VectorIt i = children->begin();
i != children->end();
......@@ -308,15 +316,17 @@ public:
// Use one line for states and events
#ifdef USE_ITC
if ((container->get_states()!=NULL && !container->get_states()->empty() )|| (container->get_events()!=NULL && !container->get_events()->empty())) {
if ( (container->get_states() != NULL && !container->get_states()->empty()) ||
(container->get_events() != NULL && !container->get_events()->empty()) )
#else
if ((!container->get_states()->empty() )|| (!container->get_events()->empty())) {
if ( !container->get_states()->empty() ||
!container->get_events()->empty() )
#endif
size++;
{
size++;
_entity_containers.push_back(container);
}
// Store the position to draw links
_container_positions[container] = position; // First line after children
_container_sizes[container] = size; // First line after children
......@@ -350,12 +360,13 @@ public:
*/
template<class T>
inline void draw_container(T* draw_object, int position, int size, int depth, const std::string &text) {
Element_pos x = depth*(_container_width+_container_h_space) + _container_h_space/2;
Element_pos y = position*(_container_height+_container_v_space) + _container_v_space/2;
Element_pos height = size*(_container_height+_container_v_space) - _container_v_space;
Element_pos x = depth *(_container_width +_container_h_space) + _container_h_space/2;
Element_pos y = position*(_container_height+_container_v_space) + _container_v_space/2;
Element_pos height = size *(_container_height+_container_v_space) - _container_v_space;
draw_object->draw_container(x, y, _container_width, height);
draw_object->draw_container_text(x, y+height/2, text);
}
/*!
* \brief Browse the states list and draw them
*/
......
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