Commit 8d771e17 authored by Sylvain Thery's avatar Sylvain Thery

Merge icube-forge.unistra.fr:cgogn/cgogn

parents b9808b7c e50b4eb7
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
project(CGoGN) project(CGoGN)
#cmake_policy(SET CMP0042 NEW) # rpath new policy
#SET ( CMAKE_VERBOSE_MAKEFILE 1 ) #SET ( CMAKE_VERBOSE_MAKEFILE 1 )
...@@ -9,7 +10,30 @@ SET ( CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR} ) ...@@ -9,7 +10,30 @@ SET ( CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR} )
SET ( CMAKE_MODULE_PATH ${CGoGN_ROOT_DIR}/cmake_modules/ ) SET ( CMAKE_MODULE_PATH ${CGoGN_ROOT_DIR}/cmake_modules/ )
# ====== Check GCC VERSION FOR C++11 ======
if(CMAKE_COMPILER_IS_GNUCXX)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
if (GCC_VERSION VERSION_LESS 4.8)
message(FATAL_ERROR "Full support of C++11 needed. Therefore a gcc/g++ compiler with a version at least 4.8 is needed.")
endif()
endif()
# ====== Check CLANG VERSION FOR C++11 ======
if (APPLE)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE CLANG_VERSION)
if (CLANG_VERSION VERSION_LESS 3.1)
message(FATAL_ERROR "Full support of C++11 needed. Therefore a clang compiler with a version at least 3.1 is needed !!")
endif()
endif()
# ====== Check MSVC VERSION FOR C++11 ======
if(WIN32)
if(MSVC_VERSION LESS 1800)
message(FATAL_ERROR "Full support of C++11 needed. Therefore a microsoft compiler with a version at least 12 is needed.")
endif()
endif()
# ======== Check Build Type =============
IF (NOT (${CMAKE_BUILD_TYPE} MATCHES "Debug|Release")) IF (NOT (${CMAKE_BUILD_TYPE} MATCHES "Debug|Release"))
IF (${CMAKE_CURRENT_BINARY_DIR} MATCHES "(.*)Debug|(.*)debug|(.*)DEBUG") IF (${CMAKE_CURRENT_BINARY_DIR} MATCHES "(.*)Debug|(.*)debug|(.*)DEBUG")
SET(CMAKE_BUILD_TYPE "Debug") SET(CMAKE_BUILD_TYPE "Debug")
...@@ -18,8 +42,16 @@ IF (NOT (${CMAKE_BUILD_TYPE} MATCHES "Debug|Release")) ...@@ -18,8 +42,16 @@ IF (NOT (${CMAKE_BUILD_TYPE} MATCHES "Debug|Release"))
ENDIF() ENDIF()
ENDIF() ENDIF()
# for shared or not shared
SET ( BUILD_SHARED_LIBS OFF CACHE BOOL "if used all library are build as shared type (.so/.dylib/.dll)" ) # for shared or not shared (default except on windows)
if(WIN32)
SET ( BUILD_SHARED_LIBS OFF CACHE BOOL "if used all library are build as shared type (.so/.dylib/.dll)" )
else()
SET ( BUILD_SHARED_LIBS ON CACHE BOOL "if used all library are build as shared type (.so/.dylib/.dll)" )
endif()
#IF(EXISTS "${CGoGN_ROOT_DIR}/ThirdParty/include/Assimp") #IF(EXISTS "${CGoGN_ROOT_DIR}/ThirdParty/include/Assimp")
IF(EXISTS "${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE}/*assimp*") IF(EXISTS "${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE}/*assimp*")
...@@ -44,9 +76,10 @@ SET ( COMPILE_BENCHES ON CACHE BOOL "compile benches" ) ...@@ -44,9 +76,10 @@ SET ( COMPILE_BENCHES ON CACHE BOOL "compile benches" )
SET ( COMPILE_SANDBOX ON CACHE BOOL "compile all in sandbox" ) SET ( COMPILE_SANDBOX ON CACHE BOOL "compile all in sandbox" )
#create one big lib #create one big lib
SET ( ONELIB OFF CACHE BOOL "build CGoGN in one lib" ) SET ( ONELIB OFF CACHE BOOL "build CGoGN in one lib" )
SET ( WITH_GLEWMX OFF CACHE BOOL "use multi-contex GLEW" ) SET ( WITH_GLEWMX OFF CACHE BOOL "use multi-contex GLEW" )
SET( USE_OGL_CORE_PROFILE OFF CACHE BOOL "use OpenGL 3.3 core profile (do not work on mac)" ) SET( USE_OGL_CORE_PROFILE OFF CACHE BOOL "use OpenGL 3.3 core profile (do not work on mac)" )
...@@ -58,8 +91,6 @@ ENDIF(WIN32) ...@@ -58,8 +91,6 @@ ENDIF(WIN32)
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
find_package(Boost COMPONENTS regex REQUIRED) find_package(Boost COMPONENTS regex REQUIRED)
find_package(ZLIB REQUIRED) find_package(ZLIB REQUIRED)
#find_package(LibXml2 REQUIRED)
find_package(TinyXml2 REQUIRED)
find_package(GLEW REQUIRED) find_package(GLEW REQUIRED)
# MESSAGE HERE FOR MORE EASY USER READING # MESSAGE HERE FOR MORE EASY USER READING
...@@ -99,7 +130,6 @@ SET (CGoGN_EXT_INCLUDES ...@@ -99,7 +130,6 @@ SET (CGoGN_EXT_INCLUDES
${OPENGL_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}
${GLEW_INCLUDE_DIRS} ${GLEW_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS}
${TINYXML2_INCLUDE_DIR}
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
) )
...@@ -109,8 +139,8 @@ SET (CGoGN_EXT_LIBS ...@@ -109,8 +139,8 @@ SET (CGoGN_EXT_LIBS
${OPENGL_LIBRARY} ${OPENGL_LIBRARY}
${GLEW_LIBRARIES} ${GLEW_LIBRARIES}
${ZLIB_LIBRARIES} ${ZLIB_LIBRARIES}
${TINYXML2_LIBRARY}
${Boost_REGEX_LIBRARY} ${Boost_REGEX_LIBRARY}
tinyxml2
) )
IF(WIN32) IF(WIN32)
...@@ -173,11 +203,8 @@ ELSE() ...@@ -173,11 +203,8 @@ ELSE()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Woverride-init -fPIC") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Woverride-init -fPIC")
# remove the 60000+ "no unused local typedefs" warnings with GCC4.8+ # remove the 60000+ "no unused local typedefs" warnings with GCC4.8+
if(CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_COMPILER_IS_GNUCXX)
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs")
if (GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-local-typedefs")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-local-typedefs")
endif(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
endif() endif()
ENDIF() ENDIF()
......
...@@ -23,7 +23,6 @@ SET( USE_OGL_CORE_PROFILE OFF CACHE BOOL "use OpenGL 3.3 core profile (do not wo ...@@ -23,7 +23,6 @@ SET( USE_OGL_CORE_PROFILE OFF CACHE BOOL "use OpenGL 3.3 core profile (do not wo
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
find_package(Boost COMPONENTS regex system REQUIRED) find_package(Boost COMPONENTS regex system REQUIRED)
find_package(ZLIB REQUIRED) find_package(ZLIB REQUIRED)
find_package(LibXml2 REQUIRED)
find_package(GLEW REQUIRED) find_package(GLEW REQUIRED)
find_package(Qt4 REQUIRED) find_package(Qt4 REQUIRED)
find_package(QGLViewer REQUIRED) find_package(QGLViewer REQUIRED)
...@@ -73,7 +72,6 @@ SET (EXT_INCLUDES ...@@ -73,7 +72,6 @@ SET (EXT_INCLUDES
${OPENGL_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}
${GLEW_INCLUDE_DIRS} ${GLEW_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS}
${LIBXML2_INCLUDE_DIR}
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
${QT_INCLUDE_DIR} ${QT_INCLUDE_DIR}
${QGLVIEWER_INCLUDE_DIR} ${QGLVIEWER_INCLUDE_DIR}
...@@ -86,17 +84,17 @@ SET (EXT_INCLUDES ...@@ -86,17 +84,17 @@ SET (EXT_INCLUDES
SET (EXT_LIBS SET (EXT_LIBS
PythonQt PythonQt
nl nl
${QGLVIEWER_LIBRARIES}
${OPENGL_LIBRARY} ${OPENGL_LIBRARY}
${GLEW_LIBRARIES} ${GLEW_LIBRARIES}
${ZLIB_LIBRARIES} ${ZLIB_LIBRARIES}
${LIBXML2_LIBRARIES}
${Boost_SYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}
${Boost_REGEX_LIBRARY} ${Boost_REGEX_LIBRARY}
${QT_LIBRARIES} ${QT_LIBRARIES}
${QGLVIEWER_LIBRARIES}
${PYTHON_LIBRARIES} ${PYTHON_LIBRARIES}
${SUITESPARSE_LIBRARIES} ${SUITESPARSE_LIBRARIES}
# ${SUPERLU_LIBRARIES} # ${SUPERLU_LIBRARIES}
tinyxml2
) )
......
...@@ -11,6 +11,7 @@ ADD_SUBDIRECTORY(surface_selection) ...@@ -11,6 +11,7 @@ ADD_SUBDIRECTORY(surface_selection)
ADD_SUBDIRECTORY(surface_deformation) ADD_SUBDIRECTORY(surface_deformation)
ADD_SUBDIRECTORY(surface_modelisation) ADD_SUBDIRECTORY(surface_modelisation)
#ADD_SUBDIRECTORY(surface_tilings) #ADD_SUBDIRECTORY(surface_tilings)
ADD_SUBDIRECTORY(surface_distance)
ADD_SUBDIRECTORY(volume_import) ADD_SUBDIRECTORY(volume_import)
#ADD_SUBDIRECTORY(volume_render) #ADD_SUBDIRECTORY(volume_render)
cmake_minimum_required(VERSION 2.8)
SET( PLUGIN_NAME Surface_Distance )
SET( PLUGIN_ROOT_DIR ${SCHNApps_ROOT_DIR}/Plugins/surface_distance )
INCLUDE_DIRECTORIES(
${PLUGIN_ROOT_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}
)
file(
GLOB_RECURSE
PLUGIN_FILES
${PLUGIN_ROOT_DIR}/src/*.cpp
${PLUGIN_ROOT_DIR}/include/*.h
${PLUGIN_ROOT_DIR}/include/*.hpp
)
file(
GLOB_RECURSE
PLUGIN_UI_FILES
${PLUGIN_ROOT_DIR}/forms/*.ui
)
SET(
PLUGIN_QOBJECT_FILES
${PLUGIN_ROOT_DIR}/include/surface_distance.h
${PLUGIN_ROOT_DIR}/include/dialog_computeDistance.h
)
include( ${SCHNApps_ROOT_DIR}/Plugins/plugins_cmake.txt )
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog_ComputeDistance</class>
<widget class="QDialog" name="Dialog_ComputeDistance">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>607</width>
<height>359</height>
</rect>
</property>
<property name="windowTitle">
<string>Compute Distance</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QListWidget" name="list_maps_1"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Position attribute :</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="combo_positionAttribute_1">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Distance attribute</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Existing attribute :</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="combo_distanceAttribute_1">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>New attribute :</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="distanceAttributeName_1"/>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QListWidget" name="list_maps_2"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Position attribute :</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="combo_positionAttribute_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Distance attribute</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Existing attribute :</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="combo_distanceAttribute_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>New attribute :</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="distanceAttributeName_2"/>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="enableVBO">
<property name="text">
<string>Create VBOs</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QPushButton" name="button_cancel">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="button_apply">
<property name="text">
<string>Apply</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="button_ok">
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>button_ok</sender>
<signal>clicked()</signal>
<receiver>Dialog_ComputeDistance</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>232</x>
<y>283</y>
</hint>
<hint type="destinationlabel">
<x>140</x>
<y>156</y>
</hint>
</hints>
</connection>
<connection>
<sender>button_cancel</sender>
<signal>clicked()</signal>
<receiver>Dialog_ComputeDistance</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>52</x>
<y>283</y>
</hint>
<hint type="destinationlabel">
<x>140</x>
<y>156</y>
</hint>
</hints>
</connection>
</connections>
</ui>
#ifndef _DIALOG_COMPUTEDISTANCE_H_
#define _DIALOG_COMPUTEDISTANCE_H_
#include "ui_dialog_computeDistance.h"
namespace CGoGN
{
namespace SCHNApps
{
class SCHNApps;
class MapHandlerGen;
class Dialog_ComputeDistance : public QDialog, public Ui::Dialog_ComputeDistance
{
Q_OBJECT
public:
Dialog_ComputeDistance(SCHNApps* s);
private:
SCHNApps* m_schnapps;
MapHandlerGen* m_selectedMap1;
MapHandlerGen* m_selectedMap2;
public slots:
void selectedMap1Changed();
void selectedMap2Changed();
void addMapToList(MapHandlerGen* map);
void removeMapFromList(MapHandlerGen* map);
void addAttributeToList1(unsigned int orbit, const QString& nameAttr);
void addAttributeToList2(unsigned int orbit, const QString& nameAttr);
};
} // namespace SCHNApps
} // namespace CGoGN
#endif
#ifndef _SURFACE_DISTANCE_PLUGIN_H_
#define _SURFACE_DISTANCE_PLUGIN_H_
#include "plugin_processing.h"
#include "dialog_computeDistance.h"
namespace CGoGN
{
namespace SCHNApps
{
class Surface_Distance_Plugin : public PluginProcessing
{
Q_OBJECT
Q_INTERFACES(CGoGN::SCHNApps::Plugin)
public:
Surface_Distance_Plugin()
{}
~Surface_Distance_Plugin()
{}
virtual bool enable();
virtual void disable();
private slots:
void openComputeDistanceDialog();
void computeDistanceFromDialog();
void appsFinished();
public slots:
void computeDistance(
const QString& mapName1,
const QString& positionAttributeName1,
const QString& distanceAttributeName1,
const QString& mapName2,
const QString& positionAttributeName2,
const QString& distanceAttributeName2
);
private:
Dialog_ComputeDistance* m_computeDistanceDialog;
QAction* m_computeDistanceAction;
};
} // namespace SCHNApps
} // namespace CGoGN
#endif
#include "dialog_computeDistance.h"
#include "surface_distance.h"
#include "schnapps.h"
#include "mapHandler.h"
namespace CGoGN
{
namespace SCHNApps
{
Dialog_ComputeDistance::Dialog_ComputeDistance(SCHNApps* s) :
m_schnapps(s),
m_selectedMap1(NULL),
m_selectedMap2(NULL)
{
setupUi(this);
distanceAttributeName_1->setText("distance");
distanceAttributeName_2->setText("distance");
connect(m_schnapps, SIGNAL(mapAdded(MapHandlerGen*)), this, SLOT(addMapToList(MapHandlerGen*)));
connect(m_schnapps, SIGNAL(mapRemoved(MapHandlerGen*)), this, SLOT(removeMapFromList(MapHandlerGen*)));
connect(list_maps_1, SIGNAL(itemSelectionChanged()), this, SLOT(selectedMap1Changed()));
connect(list_maps_2, SIGNAL(itemSelectionChanged()), this, SLOT(selectedMap2Changed()));
foreach(MapHandlerGen* map, m_schnapps->getMapSet().values())
{
QListWidgetItem* item1 = new QListWidgetItem(map->getName(), list_maps_1);
QListWidgetItem* item2 = new QListWidgetItem(map->getName(), list_maps_2);
}
}
void Dialog_ComputeDistance::selectedMap1Changed()
{
if(m_selectedMap1)
disconnect(m_selectedMap1, SIGNAL(attributeAdded(unsigned int, const QString&)), this, SLOT(addAttributeToList1(unsigned int, const QString&)));
QList<QListWidgetItem*> currentItems = list_maps_1->selectedItems();
if(!currentItems.empty())
{
combo_positionAttribute_1->clear();
combo_distanceAttribute_1->clear();
const QString& mapname = currentItems[0]->text();
MapHandlerGen* mh = m_schnapps->getMap(mapname);
QString vec3TypeName = QString::fromStdString(nameOfType(PFP2::VEC3()));
QString realTypeName = QString::fromStdString(nameOfType(PFP2::REAL()));
const AttributeSet& attribs = mh->getAttributeSet(VERTEX);
for(AttributeSet::const_iterator i = attribs.constBegin(); i != attribs.constEnd(); ++i)
{
if(i.value() == vec3TypeName)
{
combo_positionAttribute_1->addItem(i.key());
}
if(i.value() == realTypeName)
{
combo_distanceAttribute_1->addItem(i.key());
}
}
m_selectedMap1 = mh;
connect(m_selectedMap1, SIGNAL(attributeAdded(unsigned int, const QString&)), this, SLOT(addAttributeToList1(unsigned int, const QString&)));
}
else
m_selectedMap1 = NULL;
}
void Dialog_ComputeDistance::selectedMap2Changed()
{
if(m_selectedMap2)
disconnect(m_selectedMap2, SIGNAL(attributeAdded(unsigned int, const QString&)), this, SLOT(addAttributeToList2(unsigned int, const QString&)));
QList<QListWidgetItem*> currentItems = list_maps_2->selectedItems();
if(!currentItems.empty())
{
combo_positionAttribute_2->clear();
combo_distanceAttribute_2->clear();
const QString& mapname = currentItems[0]->text();
MapHandlerGen* mh = m_schnapps->getMap(mapname);
QString vec3TypeName = QString::fromStdString(nameOfType(PFP2::VEC3()));
QString realTypeName = QString::fromStdString(nameOfType(PFP2::REAL()));
const AttributeSet& attribs = mh->getAttributeSet(VERTEX);
for(AttributeSet::const_iterator i = attribs.constBegin(); i != attribs.constEnd(); ++i)
{
if(i.value() == vec3TypeName)
{
combo_positionAttribute_2->addItem(i.key());
}
if(i.value() == realTypeName)
{
combo_distanceAttribute_2->addItem(i.key());
}
}
m_selectedMap2 = mh;
connect(m_selectedMap2, SIGNAL(attributeAdded(unsigned int, const QString&)), this, SLOT(addAttributeToList2(unsigned int, const QString&)));
}
else
m_selectedMap2 = NULL;
}
void Dialog_ComputeDistance::addMapToList(MapHandlerGen* map)
{
QListWidgetItem* item1 = new QListWidgetItem(map->getName(), list_maps_1);
QListWidgetItem* item2 = new QListWidgetItem(map->getName(), list_maps_2);
}
void Dialog_ComputeDistance::removeMapFromList(MapHandlerGen* map)
{
QList<QListWidgetItem*> items1 = list_maps_1->findItems(map->getName(), Qt::MatchExactly);
if(!items1.empty())
delete items1[0];
QList<QListWidgetItem*> items2 = list_maps_2->findItems(map->getName(), Qt::MatchExactly);
if(!items2.empty())
delete items2[0];
if(m_selectedMap1 == map)
{
disconnect(m_selectedMap1, SIGNAL(attributeAdded(unsigned int, const QString&)), this, SLOT(addAttributeToList1(unsigned int, const QString&)));
m_selectedMap1 = NULL;
}
if(m_selectedMap2 == map)
{
disconnect(m_selectedMap2, SIGNAL(attributeAdded(unsigned int, const QString&)), this, SLOT(addAttributeToList2(unsigned int, const QString&)));
m_selectedMap2 = NULL;
}
}
void Dialog_ComputeDistance::addAttributeToList1(unsigned int orbit, const QString& nameAttr)
{
if(orbit == VERTEX)