Commit 758bdcae authored by Mathieu Faverge's avatar Mathieu Faverge

Merge branch 'soucarre' into toto

parents 8e0e6ad4 576a0acc
......@@ -6,6 +6,54 @@ set (VITE_VERSION_MAJOR 1)
set (VITE_VERSION_MINOR 2)
set (VITE_VERSION_PATCH 0)
find_package(Subversion)
if(SUBVERSION_FOUND)
# the subversion commands should be executed with the C locale, otherwise
# the message (which are parsed) may be translated, Alex
set(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}")
set(ENV{LC_ALL} C)
execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} info ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE VITE_WC_INFO
ERROR_VARIABLE Subversion_svn_info_error
RESULT_VARIABLE Subversion_svn_info_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT ${Subversion_svn_info_result} EQUAL 0)
set(VITE_WC_REVISION "released")
else()
string(REGEX REPLACE "^(.*\n)?Last Changed Rev: ([^\n]+).*"
"\\2" VITE_WC_REVISION "${VITE_WC_INFO}")
endif()
message(STATUS "Current revision is ${VITE_WC_REVISION}")
# restore the previous LC_ALL
set(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL})
endif()
if (NOT ${VITE_WC_REVISION} STREQUAL "")
set (VITE_VERSION "r${VITE_WC_REVISION}")
else()
set (VITE_VERSION "${VITE_VERSION_MAJOR}.${VITE_VERSION_MINOR}.${VITE_VERSION_PATCH}")
endif()
if(UNIX)
set(_vite_SAVED_LC_ALL "$ENV{LC_ALL}")
set(ENV{LC_ALL} C)
execute_process(COMMAND date +"%B %Y"
OUTPUT_VARIABLE VITE_DATE
ERROR_VARIABLE vite_date_error
RESULT_VARIABLE vite_date_result
OUTPUT_STRIP_TRAILING_WHITESPACE )
# restore the previous LC_ALL
set(ENV{LC_ALL} ${_vite_SAVED_LC_ALL})
else()
set(VITE_DATE "")
endif()
if(COMMAND CMAKE_POLICY)
# CMP0003: add the link paths to the link command as with cmake 2.4
cmake_policy(SET CMP0003 NEW)
......@@ -26,6 +74,8 @@ include (CMakeDetermineSystem)
include (CheckCCompilerFlag)
include (CheckFunctionExists)
include (CheckSymbolExists)
include (CheckIncludeFile)
include (CheckIncludeFileCXX)
include (CheckIncludeFiles)
include (CheckLibraryExists)
include (CMakeDependentOption)
......@@ -33,7 +83,7 @@ include (CMakeDependentOption)
### Required Packages
# Try to find Qt5 : http://forum.openscenegraph.org/viewtopic.php?t=11431
option(USE_QT5
"Use QT5 instead of QT4" OFF)
"Use QT5 instead of QT4" ON)
if (USE_QT5)
# QUIET option disables messages if the package cannot be found.
......@@ -61,14 +111,14 @@ else(USE_QT5) # Try Qt4
endif(USE_QT5)
#find_package(OpenGL)
find_package(GLU)
find_package(OpenGL)
#find_package(GLU)
### Optimization options
option(VITE_ENABLE_SERIALIZATION
"Enable the support of Boost Serialization." OFF)
option(VITE_ENABLE_VBO
"Enable the support of VBO." OFF)
"Enable the support of VBO." ON)
option(VITE_ENABLE_MT_PARSERS
"Enable multi-threading in parsers." OFF)
......@@ -125,7 +175,16 @@ if(VITE_ENABLE_SERIALIZATION)
endif(VITE_ENABLE_SERIALIZATION)
if(VITE_ENABLE_VBO)
find_package(GLEW)
find_package(GLEW REQUIRED)
include_directories(${GLEW_INCLUDE_PATH})
if (GLM_INC)
include_directories(${GLM_INC})
list(APPEND CMAKE_REQUIRED_INCLUDES ${GLM_INC})
endif()
check_include_file_cxx(glm/glm.hpp HAVE_GLM_H)
if (NOT HAVE_GLM_H)
message(FATAL_ERROR "libglm-dev package is required, you might specify the include directory where to find glm/glm.hpp through -DGLM_INC=/path/to/glm")
endif()
endif(VITE_ENABLE_VBO)
if(VITE_ENABLE_OTF)
......@@ -151,7 +210,7 @@ endif()
# Configuration header
configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/src/common/ViteConfig.hpp.in"
"${CMAKE_CURRENT_SOURCE_DIR}/src/common/ViteConfig.hpp")
"${CMAKE_CURRENT_BINARY_DIR}/src/common/ViteConfig.hpp")
add_subdirectory(src)
add_subdirectory(plugins)
......
......@@ -8,7 +8,35 @@ set(CPACK_SOURCE_GENERATOR "TBZ2")
set(CPACK_SOURCE_PACKAGE_FILE_NAME
"${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
SET(CPACK_SOURCE_IGNORE_FILES
if(WIN32)
set(CPACK_NSIS_EXECUTABLES_DIRECTORY "bin")
set(CPACK_PACKAGE_EXECUTABLES "vite" "ViTE")
install(FILES ${GLEW_DLL} DESTINATION bin)
install(FILES ${ZLIB_DLL} DESTINATION bin)
# install Qt dlls
set(QT_DLL_PATH ${Qt5Core_DIR}/../../../bin)
get_target_property(QtCoreDll Qt5::Core "IMPORTED_LOCATION_RELEASE")
get_target_property(QtGuiDll Qt5::Gui "IMPORTED_LOCATION_RELEASE")
get_target_property(QtOpenGLDll Qt5::OpenGL "IMPORTED_LOCATION_RELEASE")
get_target_property(QtWidgetsDll Qt5::Widgets "IMPORTED_LOCATION_RELEASE")
get_target_property(QtXmlDll Qt5::Xml "IMPORTED_LOCATION_RELEASE")
install(FILES ${QtCoreDll} ${QtGuiDll} ${QtOpenGLDll} ${QtWidgetsDll} ${QtXmlDll}
DESTINATION bin)
install(FILES ${QT_DLL_PATH}/../plugins/platforms/qwindows.dll
DESTINATION bin/platforms)
install(FILES ${QT_DLL_PATH}/libgcc_s_dw2-1.dll ${QT_DLL_PATH}/libwinpthread-1.dll ${QT_DLL_PATH}/libstdc++-6.dll ${QT_DLL_PATH}/icudt54.dll ${QT_DLL_PATH}/icuin54.dll ${QT_DLL_PATH}/icuuc54.dll
DESTINATION bin)
endif(WIN32)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "ViTE is a trace explorer. It is a tool to visualize execution traces in Pajé or OTF format for debugging and profiling parallel or distributed applications.")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/licence/Licence_CeCILL_V2-en.txt")
set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README")
set(CPACK_SOURCE_IGNORE_FILES
/\\\\.svn/
~$
CMakeCache\\\\.txt
......
......@@ -9,6 +9,7 @@ option(VITE_PLUGINS_TRACEINFOS
"Enable the TraceInfos plugin." OFF)
include_directories(${CMAKE_SOURCE_DIR}/src)
include_directories(${CMAKE_BINARY_DIR}/src/common)
if( VITE_PLUGINS_DISTRIBUTIONS )
add_subdirectory(Distribution)
......
......@@ -143,7 +143,7 @@ private:
if (st)
{
const std::string name = st->get_value()->get_name().to_string();
const std::string name = st->get_value()->get_name();
/* does the name appear in the set of selected names ? */
std::set<std::string>::const_iterator it = selected_state_types_names.find(name);
......@@ -267,14 +267,14 @@ private:
const State *left_st = node->get_element()->get_left_state();
if (left_st)
{
const std::string name = left_st->get_value()->get_name().to_string();
const std::string name = left_st->get_value()->get_name();
name_set.insert(name);
}
const State *right_st = node->get_element()->get_right_state();
if (right_st)
{
const std::string name = right_st->get_value()->get_name().to_string();
const std::string name = right_st->get_value()->get_name();
name_set.insert(name);
}
......
......@@ -61,13 +61,13 @@ void Trace_infos::get_states_name_rec(Node<StateChange> *parent, set<string> &st
const State *left_state = top_state->get_left_state();
const State *right_state = top_state->get_right_state();
if(left_state && left_state->get_value()) {
state_list.insert(left_state->get_value()->get_name().to_string());
//cout << left_state->get_value()->get_name().to_string() << endl;
state_list.insert(left_state->get_value()->get_name());
//cout << left_state->get_value()->get_name() << endl;
get_states_name_rec(parent->get_left_child(), state_list);
}
if(right_state && right_state->get_value()) {
state_list.insert(right_state->get_value()->get_name().to_string());
//cout << right_state->get_value()->get_name().to_string() << endl;
state_list.insert(right_state->get_value()->get_name());
//cout << right_state->get_value()->get_name() << endl;
get_states_name_rec(parent->get_right_child(), state_list);
}
}
......
......@@ -84,7 +84,7 @@ SET(VITE_HDRS
trace/Trace.hpp
trace/IntervalOfContainer.hpp
# Render headers
render/Render.hpp
render/GanttDiagram.hpp
render/Geometry.hpp
render/Hook_event.hpp
render/Minimap.hpp
......@@ -161,32 +161,32 @@ SET(VITE_SRCS
trace/values/Name.cpp
trace/values/String.cpp
trace/tree/Interval.cpp
trace/EntityValue.cpp
trace/Container.cpp
trace/ContainerType.cpp
trace/Entity.cpp
trace/EntityType.cpp
trace/EntityValue.cpp
trace/Event.cpp
trace/EventType.cpp
trace/StateType.cpp
trace/IntervalOfContainer.cpp
trace/Link.cpp
trace/LinkType.cpp
trace/VariableType.cpp
trace/Entity.cpp
trace/Event.cpp
trace/State.cpp
trace/StateChange.cpp
trace/Link.cpp
trace/Variable.cpp
trace/Container.cpp
trace/StateType.cpp
trace/Trace.cpp
trace/IntervalOfContainer.cpp
trace/Variable.cpp
trace/VariableType.cpp
# Render code files
render/GanttDiagram.hpp
render/Geometry.cpp
render/Hook_event.cpp
render/Render.hpp
render/Minimap.cpp
render/Render_opengl.cpp
render/Render_svg.cpp
render/Ruler.cpp
render/render_stats_opengl.cpp
render/render_stats_svg.cpp
render/Ruler.cpp
# Parser code files
parser/Parser.cpp
parser/ParserFactory.cpp
......@@ -202,16 +202,16 @@ SET(VITE_SRCS
statistics/Statistic.cpp
statistics/Stats_window.cpp
# Interface code files
interface/Settings_window.cpp
interface/Interface_graphic.cpp
interface/Node_select.cpp
interface/viteqtreewidget.cpp
interface/Interval_select.cpp
interface/Node_select.cpp
interface/Settings_window.cpp
interface/qxtspanslider.cpp
interface/viteqtreewidget.cpp
# Plugin code file
plugin/Command_window.cpp
plugin/Plugin_window.cpp
plugin/Plugin.cpp
plugin/Plugin_window.cpp
# Core code files
core/Core.cpp
core/getopt.c
......@@ -249,12 +249,14 @@ IF(VITE_ENABLE_VBO)
SET(VITE_HDRS
${VITE_HDRS}
render/vbo.hpp
render/Shader.hpp
render/Render_alternate.hpp
)
SET(VITE_SRCS
${VITE_SRCS}
render/vbo.cpp
render/Shader.cpp
render/Render_alternate.cpp
)
ENDIF(VITE_ENABLE_VBO)
......@@ -380,7 +382,7 @@ IF(USE_QT5)
QT5_WRAP_UI(VITE_UIS_H ${VITE_UIS})
QT5_WRAP_CPP(VITE_MOC ${VITE_UIS_H} ${VITE_MOC_HDRS})
QT5_ADD_RESOURCES(VITE_RCC_SRCS ${VITE_RCCS})
ADD_DEFINITIONS(-DQT_NO_DEBUG)
#ADD_DEFINITIONS(-DQT_NO_DEBUG)
#############################################
# QT4
#############################################
......@@ -399,12 +401,13 @@ ELSE(USE_QT5)
QT4_WRAP_CPP(VITE_MOC ${VITE_UIS_H} ${VITE_MOC_HDRS})
QT4_ADD_RESOURCES(VITE_RCC_SRCS ${VITE_RCCS})
ADD_DEFINITIONS(-DQT_NO_DEBUG)
#ADD_DEFINITIONS(-DQT_NO_DEBUG)
ENDIF(USE_QT5)
#############################################
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}/common
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${QTCOLORPICKERDIR}
......@@ -415,6 +418,13 @@ IF( VITE_ENABLE_OTF )
LINK_DIRECTORIES( ${OTF_LIBRARY_DIR} )
ENDIF( VITE_ENABLE_OTF )
#resource
IF(WIN32)
set(VITE_RES
"${PROJECT_SOURCE_DIR}/src/interface/icon/logo.ico"
"${PROJECT_SOURCE_DIR}/src/interface/windows_icon.rc"
)
ENDIF(WIN32)
if( APPLE )
INCLUDE_DIRECTORIES(/usr/X11/include)
......@@ -431,7 +441,7 @@ if( APPLE )
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})
ADD_EXECUTABLE(vite ${VITE_SRCS} ${VITE_MOC} ${VITE_RCC_SRCS} ${VITE_RES})
endif( APPLE )
#############################################
......@@ -443,7 +453,8 @@ ENDIF(USE_QT5)
TARGET_LINK_LIBRARIES(vite
${QT_LIBRARIES}
${GLU_LIBRARY}
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
${Boost_LIBRARIES}
)
......@@ -464,6 +475,12 @@ IF(VITE_ENABLE_OTF)
TARGET_LINK_LIBRARIES(vite
${OTF_LIBRARY}
)
# if OTF is compiled with zlib support we need to add it
IF(WIN32)
TARGET_LINK_LIBRARIES(vite
${ZLIB_LIBRARY}
)
ENDIF(WIN32)
ENDIF(VITE_ENABLE_OTF)
IF(VITE_ENABLE_TAU)
......@@ -472,4 +489,9 @@ IF(VITE_ENABLE_TAU)
)
ENDIF(VITE_ENABLE_TAU)
IF(WIN32)
# Remove the console for windows
set_target_properties(vite PROPERTIES LINK_FLAGS -Wl,-subsystem,windows)
ENDIF(WIN32)
INSTALL_TARGETS(/bin vite)
......@@ -76,7 +76,7 @@ Element_pos Info::Render::_x_max = 0.0;
Element_pos Info::Render::_info_x = 0.0;
Element_pos Info::Render::_info_y = 0.0;
Element_pos Info::Render::_info_accurate = 0.0;
int Info::Render::_arrows_shape = 0;
bool Info::Render::_no_arrows = false;
bool Info::Render::_no_events = false;
bool Info::Render::_shaded_states = Session::getSession().get_shaded_states_setting();
......
/*
** 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 Info.hpp
*/
......@@ -174,6 +174,11 @@ public:
*/
static bool _key_ctrl;
/*!
* \brief Specify the shape of arrows heads. 0 is triangle, 1 is a point and 2 is none.
*/
static int _arrows_shape;
/*!
* \brief Prevent arrows to be displayed (used with Display List since it should highly decreased performance).
*/
......@@ -184,17 +189,17 @@ public:
*/
static bool _no_events;
/*!
* \brief Control if the color of State is uniform (value is false) or shaded (value is true). (By default, shaded)
*/
static bool _shaded_states;
/*!
* \brief Control if the color of State is uniform (value is false) or shaded (value is true). (By default, shaded)
*/
static bool _shaded_states;
/*!
* \brief Control if the vertical line is on. (By default, yes)
*/
static bool _vertical_line;
/*!
* \brief Control if the vertical line is on. (By default, yes)
*/
static bool _vertical_line;
/*!
/*!
* \brief Contains the trace minimum visible time.
*/
static Element_pos _x_min_visible;
......@@ -204,7 +209,7 @@ public:
*/
static Element_pos _x_max;
/*!
/*!
* \brief Contains the trace minimum visible time, uncorrected (state width isn't removed)
*/
static Element_pos _x_min;
......@@ -232,7 +237,6 @@ public:
/*!
* \brief To show the x beginning of the trace.
*/
static const int X_TRACE_BEGINNING = 0;
/*!
......@@ -277,48 +281,45 @@ public:
struct Trace{
/*!
* \brief The depth (number of stacked containers) of the data structure.
*/
* \brief The depth (number of stacked containers) of the data structure.
*/
static int depth;
};
struct Splitter{
/*!
* \brief are we splitting ?
*/
* \brief are we splitting ?
*/
static bool split;
/*!
* \brief are we loading from a splitted set of files (needed in core to know which action to initiate)
*/
* \brief are we loading from a splitted set of files (needed in core to know which action to initiate)
*/
static bool load_splitted;
/*!
* \brief are we loadinga preview version of a splitted file (needed in core to know which action to initiate)
*/
* \brief are we loadinga preview version of a splitted file (needed in core to know which action to initiate)
*/
static bool preview;
/*!
* \brief path of the folder to split
*/
* \brief path of the folder to split
*/
static std::string path;
/*!
* \brief filename of the splitted file, used to name the folder
*/
* \brief filename of the splitted file, used to name the folder
*/
static std::string filename;
/*!
* \brief filename of the node selection file, used to select nodes to display in PArserSplitted
*/
* \brief filename of the node selection file, used to select nodes to display in PArserSplitted
*/
static std::string xml_filename;
/*!
* \brief min time we want to load
*/
* \brief min time we want to load
*/
static Element_pos _x_min;
/*!
* \brief max time we want to load
*/
* \brief max time we want to load
*/
static Element_pos _x_max;
};
};
};
#endif
#include <string>
#include <map>
#include <iostream>
/* -- */
#include "trace/values/Value.hpp"
#include "trace/values/Color.hpp"
......@@ -12,7 +13,6 @@ Palette::Palette(const std::string &name) : _name(name) {
}
Palette::~Palette() {
// Delete colors
for(std::map<std::string, Color *>::iterator it = _pairs.begin() ;
it != _pairs.end() ; ++ it) {
Color *c = (*it).second;
......@@ -22,10 +22,11 @@ Palette::~Palette() {
Color *Palette::get_color(const std::string &state_name) {
if(_pairs.find(state_name) != _pairs.end() && is_visible(state_name))
if(_pairs.find(state_name) != _pairs.end())
return _pairs[state_name];
else
else{
return NULL;
}
}
bool Palette::is_visible(const std::string &state_name){
......
......@@ -163,6 +163,9 @@ Session::Session() : QSettings( VITE_ORGANISATION_NAME, VITE_APPLICATION_NAME )
}
Session::~Session() {
delete _palettes_event;
delete _palettes_link;
delete _palettes_state;
delete _mmSettings;
delete _exportSettings;
}
......@@ -283,8 +286,6 @@ void Session::get_palettes_name(const std::string type, QStringList &list) {
}
Palette *Session::get_palette(const std::string type, const std::string &palette_name) {
QMap <QString, QVariant> qmap = S->value(QString::fromStdString(type+"/"+palette_name+"/map")).toMap();
Palette *p, **where_from;
if( type == "palette" ) {
p = _palettes_state;
......@@ -301,6 +302,9 @@ Palette *Session::get_palette(const std::string type, const std::string &palette
if(!p || p->get_name() != palette_name) {
delete p;
QMap <QString, QVariant> qmap = S->value(QString::fromStdString(type+"/"+palette_name+"/map")).toMap();
p = new Palette(string(type+"/"+palette_name));
*where_from = p;
for(QMap<QString, QVariant>::const_iterator it = qmap.begin() ;
......@@ -313,7 +317,6 @@ Palette *Session::get_palette(const std::string type, const std::string &palette
return p;
}
void Session::create_palette(const std::string type, const std::string &name) {
QStringList list = S->value(QString::fromStdString(type+PALETTE_NAMES)).toStringList();
list.append(QString::fromStdString(name));
......@@ -344,18 +347,28 @@ void Session::copy_palette(const std::string type, const std::string &src, const
S->setValue(name_dest, qmap);
}
void Session::add_state_to_palette(const std::string type, const std::string &palette_name, const std::string &state_name, const Color &c, bool visible) {
void
Session::add_state_to_palette(const std::string type,
const std::string &palette_name,
const std::string &state_name,
const Color &c, bool visible)
{
QString name = QString::fromStdString(type+"/"+palette_name+"/map");
QMap <QString, QVariant> qmap = S->value(name).toMap();
qmap[QString::fromStdString(state_name)] = QColor((int)(c.get_red()*255), (int)(c.get_green()*255), (int)(c.get_blue()*255), visible==true?255:0);
qmap[QString::fromStdString(state_name)] = QColor( (int)(c.get_red() *255),
(int)(c.get_green()*255),
(int)(c.get_blue() *255),
visible == true ? 255 : 0 );
S->setValue(name, qmap);
}
void Session::remove_state_to_palette(const std::string type, const std::string &palette_name, const std::string &state_name) {
void
Session::remove_state_to_palette(const std::string type,
const std::string &palette_name,
const std::string &state_name)
{
QString name = QString::fromStdString(type+"/"+palette_name+"/map");
QMap <QString, QVariant> qmap = S->value(name).toMap();
qmap.remove(QString::fromStdString(state_name));
S->setValue(name, qmap);
}
......@@ -193,7 +193,6 @@ public:
static const int _MAX_NB_RECENT_FILES = 10;
static void save_config_file();