Commit b2c0afcc authored by Mathieu Faverge's avatar Mathieu Faverge

Whitespaces

parent 31c7856f
......@@ -129,7 +129,7 @@ SET(VITE_HDRS
plugin/Command_window.hpp
plugin/Plugin_window.hpp
plugin/Plugin.hpp
)
)
SET(VITE_UIS
interface/info_window.ui
......@@ -141,7 +141,7 @@ SET(VITE_UIS
interface/list_of_counter_to_export.ui
interface/node_select.ui
interface/interval_select.ui
)
)
SET(VITE_SRCS
# Messages & Errors
......@@ -381,25 +381,25 @@ IF(USE_QT5)
QT5_WRAP_CPP(VITE_MOC ${VITE_UIS_H} ${VITE_MOC_HDRS})
QT5_ADD_RESOURCES(VITE_RCC_SRCS ${VITE_RCCS})
ADD_DEFINITIONS(-DQT_NO_DEBUG)
#############################################
# QT4
#############################################
#############################################
# QT4
#############################################
ELSE(USE_QT5)
QT4_AUTOMOC(${VITE_SRCS})
FOREACH(_hdrs_file ${VITE_HDRS})
GET_FILENAME_COMPONENT(_abs_file ${_hdrs_file} ABSOLUTE)
FILE(READ ${_abs_file} _contents)
STRING(REGEX MATCHALL "Q_OBJECT" _match "${_contents}")
IF(_match)
SET(VITE_MOC_HDRS ${VITE_MOC_HDRS} ${_hdrs_file})
ENDIF(_match)
ENDFOREACH(_hdrs_file ${VITE_HDRS})
QT4_WRAP_UI(VITE_UIS_H ${VITE_UIS})
QT4_WRAP_CPP(VITE_MOC ${VITE_UIS_H} ${VITE_MOC_HDRS})
QT4_ADD_RESOURCES(VITE_RCC_SRCS ${VITE_RCCS})
ADD_DEFINITIONS(-DQT_NO_DEBUG)
QT4_AUTOMOC(${VITE_SRCS})
FOREACH(_hdrs_file ${VITE_HDRS})
GET_FILENAME_COMPONENT(_abs_file ${_hdrs_file} ABSOLUTE)
FILE(READ ${_abs_file} _contents)
STRING(REGEX MATCHALL "Q_OBJECT" _match "${_contents}")
IF(_match)
SET(VITE_MOC_HDRS ${VITE_MOC_HDRS} ${_hdrs_file})
ENDIF(_match)
ENDFOREACH(_hdrs_file ${VITE_HDRS})
QT4_WRAP_UI(VITE_UIS_H ${VITE_UIS})
QT4_WRAP_CPP(VITE_MOC ${VITE_UIS_H} ${VITE_MOC_HDRS})
QT4_ADD_RESOURCES(VITE_RCC_SRCS ${VITE_RCCS})
ADD_DEFINITIONS(-DQT_NO_DEBUG)
ENDIF(USE_QT5)
#############################################
......@@ -408,7 +408,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${QTCOLORPICKERDIR}
)
)
#ADD_LIBRARY(vite2 SHARED ${VITE_SRCS} ${VITE_MOC} ${VITE_RCC_SRCS})
IF( VITE_ENABLE_OTF )
......@@ -422,14 +422,14 @@ if( APPLE )
set_source_files_properties(${OSX_ICON_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
ADD_EXECUTABLE(vite MACOSX_BUNDLE ${VITE_SRCS} ${VITE_MOC} ${VITE_RCC_SRCS} ${OSX_ICON_FILES})
SET_TARGET_PROPERTIES(vite PROPERTIES
MACOSX_BUNDLE_INFO_STRING "ViTE"
MACOSX_BUNDLE_ICON_FILE "mac_logo.icns"
MACOSX_BUNDLE_LONG_VERSION_STRING "Visual Trace Explorer - version ${VITE_VERSION_MAJOR}.${VITE_VERSION_MINOR}"
MACOSX_BUNDLE_BUNDLE_NAME "Vite-MacOSX"
MACOSX_BUNDLE_SHORT_VERSION_STRING "ViTE-${VITE_VERSION_MAJOR}.${VITE_VERSION_MINOR}"
MACOSX_BUNDLE_BUNDLE_VERSION "1.0"
MACOSX_BUNDLE_COPYRIGHT "INRIA 2006-2012"
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/vite-info.plist.in)
MACOSX_BUNDLE_INFO_STRING "ViTE"
MACOSX_BUNDLE_ICON_FILE "mac_logo.icns"
MACOSX_BUNDLE_LONG_VERSION_STRING "Visual Trace Explorer - version ${VITE_VERSION_MAJOR}.${VITE_VERSION_MINOR}"
MACOSX_BUNDLE_BUNDLE_NAME "Vite-MacOSX"
MACOSX_BUNDLE_SHORT_VERSION_STRING "ViTE-${VITE_VERSION_MAJOR}.${VITE_VERSION_MINOR}"
MACOSX_BUNDLE_BUNDLE_VERSION "1.0"
MACOSX_BUNDLE_COPYRIGHT "INRIA 2006-2012"
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/vite-info.plist.in)
else( APPLE )
ADD_EXECUTABLE(vite ${VITE_SRCS} ${VITE_MOC} ${VITE_RCC_SRCS})
endif( APPLE )
......@@ -449,8 +449,8 @@ TARGET_LINK_LIBRARIES(vite
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
TARGET_LINK_LIBRARIES(vite
rt
)
rt
)
ADD_DEFINITIONS("-DBOOST_GZIP")
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
......
/*
** This file is part of the ViTE project.
**
** This software is governed by the CeCILL-A license under French law
** and abiding by the rules of distribution of free software. You can
** 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,
** that may mean that it is complicated to manipulate, and that also
** therefore means that it is reserved for developers and experienced
** professionals having in-depth computer knowledge. Users are therefore
** encouraged to load and test the software's suitability as regards
** 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.
**
**
** ViTE developers are (for version 0.* to 1.0):
**
** - COULOMB Kevin
** - FAVERGE Mathieu
** - JAZEIX Johnny
** - LAGRASSE Olivier
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
**
*/
** This file is part of the ViTE project.
**
** This software is governed by the CeCILL-A license under French law
** and abiding by the rules of distribution of free software. You can
** 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,
** that may mean that it is complicated to manipulate, and that also
** therefore means that it is reserved for developers and experienced
** professionals having in-depth computer knowledge. Users are therefore
** encouraged to load and test the software's suitability as regards
** 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.
**
**
** ViTE developers are (for version 0.* to 1.0):
**
** - COULOMB Kevin
** - FAVERGE Mathieu
** - JAZEIX Johnny
** - LAGRASSE Olivier
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
**
*/
/*!
*\file Core.cpp
*\brief This is the console interface C source code.
......@@ -153,8 +153,8 @@ using namespace std;
Core::Core(int &argc, char ** argv)
{
/*
* graphic_app is used if a graphical interface is used
/*
* graphic_app is used if a graphical interface is used
* console_app is used if we only care about the console interface
*/
graphic_app = NULL;
......@@ -165,7 +165,7 @@ Core::Core(int &argc, char ** argv)
QTextCodec::setCodecForCStrings(QTextCodec::codecForLocale());
#endif
/*
* Store application name and current directory
* Store application name and current directory
*/
_run_env[0] = new QString(QDir::currentPath().toStdString().c_str());
_run_env[1] = new QString(argv[0]);
......@@ -186,8 +186,8 @@ Core::Core(int &argc, char ** argv)
Message::set_interface(this);
/* Set the options according to the parameters given
* Warning: Work on a copy of argv to keep parameter
* that could be usefull to boost or Qt, as psn
* Warning: Work on a copy of argv to keep parameter
* that could be usefull to boost or Qt, as psn
* on Mac for example */
_state = get_options(argc, argv);
......@@ -196,7 +196,7 @@ Core::Core(int &argc, char ** argv)
#endif
/* Create the Qt application */
if ( (_state != _STATE_SPLITTING ) &&
if ( (_state != _STATE_SPLITTING ) &&
(_state != _STATE_EXPORT_FILE) ) {
graphic_app = new QApplication(argc, argv);
}
......@@ -240,15 +240,15 @@ Core::~Core(){
#if defined(HAVE_GETOPT_LONG)
static struct option long_options[] =
{
{"interval", required_argument, 0, 't'},
{"export", required_argument, 0, 'e'},
{"load_containers_config", required_argument, 0, 'c'},
{"input", required_argument, 0, 'i'},
{"split", required_argument, 0, 's'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
{
{"interval", required_argument, 0, 't'},
{"export", required_argument, 0, 'e'},
{"load_containers_config", required_argument, 0, 'c'},
{"input", required_argument, 0, 'i'},
{"split", required_argument, 0, 's'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
#endif
int Core::get_options(int &argc, char **argv)
......@@ -258,7 +258,7 @@ int Core::get_options(int &argc, char **argv)
int c;
int largc;
char **largv;
/* Ignore any -psn_%d_%d argument, which is Mac OS specific */
largc = 0;
largv = (char**)calloc(argc+1, sizeof(char**));
......@@ -274,82 +274,82 @@ int Core::get_options(int &argc, char **argv)
}
do
{
{
#if defined(HAVE_GETOPT_LONG)
c = getopt_long_only(largc, largv, "",
long_options, &opt);
c = getopt_long_only(largc, largv, "",
long_options, &opt);
#else
c = getopt(largc, largv, GETOPT_STRING);
(void) opt;
c = getopt(largc, largv, GETOPT_STRING);
(void) opt;
#endif // defined(HAVE_GETOPT_LONG)
switch(c) {
case 't' :
double t1, t2;
// Only the end
if( optarg[0] == ':' ) {
if ( sscanf( optarg, ":%lf", &t2) == 1 ) {
_time_end = t2;
} else {
cerr << QObject::tr("Interval is not in the correct format [%d:%d]").toStdString() << endl;
state=_STATE_DISPLAY_HELP;
goto cleanup;
}
switch(c) {
case 't' :
double t1, t2;
// Only the end
if( optarg[0] == ':' ) {
if ( sscanf( optarg, ":%lf", &t2) == 1 ) {
_time_end = t2;
} else {
int ret = sscanf( optarg, "%lf:%lf", &t1, &t2);
switch( ret ) {
case 2:
_time_end = t2;
case 1 :
_time_start = t1;
break;
case 0:
cerr << QObject::tr("Interval is not in the correct format [%d:%d]").toStdString() << endl;
state=_STATE_DISPLAY_HELP;
goto cleanup;
}
cerr << QObject::tr("Interval is not in the correct format [%d:%d]").toStdString() << endl;
state=_STATE_DISPLAY_HELP;
goto cleanup;
}
//cerr << "Interval: from " << _time_start << " to " << _time_end << endl;
break;
} else {
int ret = sscanf( optarg, "%lf:%lf", &t1, &t2);
switch( ret ) {
case 2:
_time_end = t2;
case 1 :
_time_start = t1;
break;
case 0:
cerr << QObject::tr("Interval is not in the correct format [%d:%d]").toStdString() << endl;
state=_STATE_DISPLAY_HELP;
goto cleanup;
}
}
//cerr << "Interval: from " << _time_start << " to " << _time_end << endl;
break;
case 'e' :
_path_to_export = optarg;
state = _STATE_EXPORT_FILE;
//cerr << "Export in file: " << _path_to_export << endl;
break;
case 'e' :
_path_to_export = optarg;
state = _STATE_EXPORT_FILE;
//cerr << "Export in file: " << _path_to_export << endl;
break;
case 'i' :
_file_opened = optarg;
if (state == 0) state = _STATE_OPEN_FILE;
//cerr << "Open file: " << _file_opened << endl;
break;
case 'i' :
_file_opened = optarg;
if (state == 0) state = _STATE_OPEN_FILE;
//cerr << "Open file: " << _file_opened << endl;
break;
case 's' :
// We want to split the file and save its parts
_file_opened = optarg;
Info::Splitter::split=true;
if (state == 0) state = _STATE_SPLITTING ;
break;
case 's' :
// We want to split the file and save its parts
_file_opened = optarg;
Info::Splitter::split=true;
if (state == 0) state = _STATE_SPLITTING ;
break;
case 'h' :
state=_STATE_DISPLAY_HELP;
goto cleanup;
case 'h' :
state=_STATE_DISPLAY_HELP;
goto cleanup;
case 'c' :
_xml_config_file = optarg;
//cerr << "Export in file: " << _path_to_export << endl;
break;
case 'c' :
_xml_config_file = optarg;
//cerr << "Export in file: " << _path_to_export << endl;
break;
default:
continue;
}
} while(-1 != c);
default:
continue;
}
} while(-1 != c);
if(optind < argc)
{
_file_opened = largv[optind];
if (state == 0) state = _STATE_OPEN_FILE;
}
{
_file_opened = largv[optind];
if (state == 0) state = _STATE_OPEN_FILE;
}
// This is here where we put new options !! (for filters for example)
......@@ -466,7 +466,7 @@ int Core::get_options(int &argc, char **argv)
// state = _STATE_OPEN_FILE;
// }
cleanup:
cleanup:
free(largv);
return state;
}
......@@ -930,66 +930,66 @@ void Core::launch_action(int state, void* arg) {
break;
case _STATE_RELEASE_RENDER_AREA:
{
/*if(parser!=NULL ){
parser->set_canceled();
//locks the mutex and automatically unlocks it when going out of scope
QMutexLocker locker(_mutex);
emit build_finished(false);
emit close_windows();
while(parser!=NULL)
_closed->wait(_mutex,100);
}*/
if (_render_opengl->unbuild()==false)
message << "Close file : an error occured with trace releasing." << Message::ende;
_file_opened.clear();
if (false == _is_trace_loaded) {
*Message::get_instance() << "Try to release a render area whereas no file was loaded" << Message::ende;
} else {
_is_trace_loaded = false;
}
if (NULL == _trace) {
*Message::get_instance() << "Try to release a render area whereas no trace is loaded" << Message::ende;
} else {
delete _trace;
_trace = NULL;
}
_render_opengl->updateGL();
{
/*if(parser!=NULL ){
parser->set_canceled();
//locks the mutex and automatically unlocks it when going out of scope
QMutexLocker locker(_mutex);
emit build_finished(false);
emit close_windows();
while(parser!=NULL)
_closed->wait(_mutex,100);
}*/
if (_render_opengl->unbuild()==false)
message << "Close file : an error occured with trace releasing." << Message::ende;
_file_opened.clear();
if (false == _is_trace_loaded) {
*Message::get_instance() << "Try to release a render area whereas no file was loaded" << Message::ende;
} else {
_is_trace_loaded = false;
}
/* Release all data */
Info::release_all();
if (NULL == _trace) {
*Message::get_instance() << "Try to release a render area whereas no trace is loaded" << Message::ende;
} else {
delete _trace;
_trace = NULL;
}
break;
_render_opengl->updateGL();
/* Release all data */
Info::release_all();
}
break;
case _STATE_EXPORT_FILE:
case _STATE_EXPORT_FILE_IN_INTERVAL:
{
if (_file_opened.empty()) {
*Message::get_instance() << "Please to previously open a trace." << Message::endw;
return;
}
cout << "export of " << _file_opened << " to " << _path_to_export << " between ";
if(_time_start == 0){
cout << "the beginning of the trace to ";
}
else{
cout << _time_start << " seconds to ";
}
if(_time_end != 0){
cout << _time_end << " seconds." << endl;
}
else{
cout << "the end of the trace." << endl;
}
{
if (_file_opened.empty()) {
*Message::get_instance() << "Please to previously open a trace." << Message::endw;
return;
}
draw_trace(_file_opened, _DRAW_SVG);
cout << "export of " << _file_opened << " to " << _path_to_export << " between ";
if(_time_start == 0){
cout << "the beginning of the trace to ";
}
else{
cout << _time_start << " seconds to ";
}
if(_time_end != 0){
cout << _time_end << " seconds." << endl;
}
else{
cout << "the end of the trace." << endl;
}
break;
draw_trace(_file_opened, _DRAW_SVG);
}
break;
case _STATE_RENDER_AREA_CHANGE_TRANSLATE:
_render_opengl->change_translate( *((int*)arg) );
......@@ -1048,151 +1048,151 @@ void Core::launch_action(int state, void* arg) {
break;
case _STATE_CLEAN_RENDER_AREA:
{
Info::Render::_x_min_visible = 0.0;
Info::Render::_x_max_visible = 0.0;
if (_render_opengl->unbuild() == false)
message << "Close file : an error occured while cleaning the render." << Message::ende;
_render_opengl->release();
_render_opengl->updateGL();
}
break;
{
Info::Render::_x_min_visible = 0.0;
Info::Render::_x_max_visible = 0.0;
if (_render_opengl->unbuild() == false)
message << "Close file : an error occured while cleaning the render." << Message::ende;
_render_opengl->release();
_render_opengl->updateGL();
}
break;
case _STATE_RENDER_SHOW_MINIMAP:
_render_opengl->show_minimap();
break;
case _STATE_SWITCH_CONTAINERS:
{
Element_pos yr = ((Element_pos*)arg)[0];
Element_pos yr2 = ((Element_pos*)arg)[1];
const Container* container=NULL;
const Container* container2=NULL;
const Container::Vector *root_containers = _trace->get_view_root_containers();
if(root_containers->empty())root_containers= _trace->get_root_containers();
if (!root_containers->empty()){
for (Container::VectorIt i = root_containers->begin();
i != root_containers->end();
i++)
if ((container = buf.search_container_by_position(*i, yr)))
break;
for (Container::VectorIt i = root_containers->begin();
i != root_containers->end();
i++)
if ((container2 = buf.search_container_by_position(*i, yr2)))
break;
{
Element_pos yr = ((Element_pos*)arg)[0];
Element_pos yr2 = ((Element_pos*)arg)[1];
const Container* container=NULL;
const Container* container2=NULL;
const Container::Vector *root_containers = _trace->get_view_root_containers();
if(root_containers->empty())root_containers= _trace->get_root_containers();
if (!root_containers->empty()){
for (Container::VectorIt i = root_containers->begin();
i != root_containers->end();
i++)
if ((container = buf.search_container_by_position(*i, yr)))
break;
for (Container::VectorIt i = root_containers->begin();
i != root_containers->end();
i++)
if ((container2 = buf.search_container_by_position(*i, yr2)))
break;
}
}
// If the clic is out
if (!container)
return;
if (!container2)
return;
// If the clic is out
if (!container)
return;
if (!container2)
return;
//we found the two children containers, we have to know the depth
Element_pos xr = ((Element_pos*)arg)[2] * (_trace->get_depth()+1);
if(xr<0)return;
//we found the two children containers, we have to know the depth
Element_pos xr = ((Element_pos*)arg)[2] * (_trace->get_depth()+1);
if(xr<0)return;
Element_pos xr2 = ((Element_pos*)arg)[3] * (_trace->get_depth()+1);
if(xr2<0)return;
for(int i=0; i < (const_cast<Container*>(container)->get_depth() - xr); i++){
container= container->get_parent();
}
Element_pos xr2 = ((Element_pos*)arg)[3] * (_trace->get_depth()+1);
if(xr2<0)return;
for(int i=0; i < (const_cast<Container*>(container)->get_depth() - xr); i++){
container= container->get_parent();
}
for(int i=0; i < (const_cast<Container*>(container2)->get_depth() - xr2); i++){
container2=container2->get_parent();
}
for(int i=0; i < (const_cast<Container*>(container2)->get_depth() - xr2); i++){
container2=container2->get_parent();
}
//we cannot switch when containers' parents are not the same
if( container->get_parent() != container2->get_parent() )
return;
//we cannot switch when containers' parents are not the same
if( container->get_parent() != container2->get_parent() )
return;
if( container == container2 )
return;
if( container == container2 )