Commit e795ca1a authored by unknown's avatar unknown

MAJ compilation

divers pb includes
parent 951a7236
......@@ -15,9 +15,11 @@ include_directories(
link_directories(
${CGoGN_ROOT_DIR}/lib/Debug
${CGoGN_ROOT_DIR}/lib/Release
${Boost_LIBRARY_DIRS}
)
IF(WIN32)
link_directories( ${CGoGN_ROOT_DIR}/lib/$(ConfigurationName) ${Boost_LIBRARY_DIRS})
link_directories( ${CGoGN_ROOT_DIR}/lib/$(ConfigurationName)
${Boost_LIBRARY_DIRS})
ELSE(WIN32)
link_directories( ${CGoGN_ROOT_DIR}/lib/Debug ${CGoGN_ROOT_DIR}/lib/Release )
ENDIF(WIN32)
......
......@@ -14,7 +14,7 @@ include_directories(
IF(WIN32)
link_directories(
${CGoGN_ROOT_DIR}/lib/$(ConfigurationName)
${CGoGN_ROOT_DIR}/lib/Release )
${Boost_LIBRARY_DIRS} )
ELSE(WIN32)
link_directories(
${CGoGN_ROOT_DIR}/lib/Debug
......
......@@ -48,74 +48,74 @@ using namespace CGoGN ;
float Ifont[74*2]={
0.145434,0.126469, 0.141475,0.096252, 0.133621,0.0730446, 0.120846,0.0558913,
0.0764256,0.0359233, 0,0.028701, 0,0.0215257, 0,0.0143506, 0,0.00717529, 0,0,
0.0560801,0, 0.11216,0, 0.16824,0, 0.22432,0, 0.2804,0, 0.33648,0, 0.39256,0,
0.448641,0, 0.448641,0.00717529, 0.448641,0.0143506, 0.448641,0.0215257, 0.448641,0.028701,
0.406716,0.0313208, 0.373254,0.0363483, 0.347367,0.0446329, 0.328172,0.0570242,
0.314784,0.0743722, 0.306316,0.0975264, 0.301885,0.127337, 0.300604,0.164653,
0.300604,0.248489, 0.300604,0.332326, 0.300604,0.416163, 0.300604,0.5,
0.300604,0.583837, 0.300604,0.667674, 0.300604,0.751511, 0.300604,0.835347,
0.301761,0.872601, 0.305891,0.902261, 0.313987,0.925229, 0.327039,0.942409,
0.371979,0.963015, 0.448641,0.971299, 0.448641,0.978474, 0.448641,0.98565,
0.448641,0.992825, 0.448641,1, 0.39256,1, 0.33648,1, 0.2804,1, 0.22432,1,
0.11216,1, 0,1, 0,0.992825, 0,0.98565, 0,0.978474, 0,0.971299,
0.0431605,0.967874, 0.0770629,0.96259, 0.102787,0.954438, 0.121412,0.942409,
0.134019,0.925495, 0.141687,0.902686, 0.145496,0.872973, 0.146526,0.835347,
0.146526,0.751511, 0.146526,0.667674, 0.146526,0.583837, 0.146526,0.5,
0.146526,0.416163, 0.146526,0.332326, 0.146526,0.248489, 0.146526,0.164653};
0.145434f,0.126469f, 0.141475f,0.096252f, 0.133621f,0.0730446f, 0.120846f,0.0558913f,
0.0764256f,0.0359233f, 0.0f,0.028701f, 0.0f,0.0215257f, 0.0f,0.0143506f, 0.0f,0.00717529f, 0.0f,0.0f,
0.0560801f, 0.0f, 0.11216f,0.0f, 0.16824f,0.0f, 0.22432f,0.0f, 0.2804f,0.0f, 0.33648f,0.0f, 0.39256f,0.0f,
0.448641f,0.0f, 0.448641f,0.00717529f, 0.448641f,0.0143506f, 0.448641f,0.0215257f, 0.448641f,0.028701f,
0.406716f,0.0313208f, 0.373254f,0.0363483f, 0.347367f,0.0446329f, 0.328172f,0.0570242f,
0.314784f,0.0743722f, 0.306316f,0.0975264f, 0.301885f,0.127337f, 0.300604f,0.164653f,
0.300604f,0.248489f, 0.300604f,0.332326f, 0.300604f,0.416163f, 0.300604f,0.5f,
0.300604f,0.583837f, 0.300604f,0.667674f, 0.300604f,0.751511f, 0.300604f,0.835347f,
0.301761f,0.872601f, 0.305891f,0.902261f, 0.313987f,0.925229f, 0.327039f,0.942409f,
0.371979f,0.963015f, 0.448641f,0.971299f, 0.448641f,0.978474f, 0.448641f,0.98565f,
0.448641f,0.992825f, 0.448641f,1.0f, 0.39256f,1.0f, 0.33648f,1.0f, 0.2804f,1.0f, 0.22432f,1.0f,
0.11216f,1.0f, 0.0f,1.0f, 0.0f,0.992825f, 0.0f,0.98565f, 0.0f,0.978474f, 0.0f,0.971299f,
0.0431605f,0.967874f, 0.0770629f,0.96259f, 0.102787f,0.954438f, 0.121412f,0.942409f,
0.134019f,0.925495f, 0.141687f,0.902686f, 0.145496f,0.872973f, 0.146526f,0.835347f,
0.146526f,0.751511f, 0.146526f,0.667674f, 0.146526f,0.583837f, 0.146526f,0.5f,
0.146526f,0.416163f, 0.146526f,0.332326f, 0.146526f,0.248489f, 0.146526f,0.164653f};
float Gfont[174*2]={
0.934964,0.533333, 0.888768,0.533333, 0.842572,0.533333, 0.796377,0.533333,
0.703986,0.533333, 0.611594,0.533333,
0.611594,0.526812, 0.611594,0.52029,
0.611594,0.513768, 0.611594,0.507246,
0.632945,0.505602, 0.650611,0.503872, 0.665118,0.501973, 0.676993,0.499819,
0.686761,0.497325, 0.69495,0.494407, 0.702086,0.490979, 0.708696,0.486957,
0.716245,0.481097, 0.722622,0.473234, 0.727879,0.463264, 0.732065,0.451087,
0.735233,0.4366, 0.737432,0.419701, 0.738714,0.400289, 0.73913,0.378261,
0.73913,0.348913, 0.73913,0.319565, 0.73913,0.290217, 0.73913,0.26087,
0.73913,0.231522, 0.73913,0.202174, 0.73913,0.172826, 0.73913,0.143478,
0.735128,0.126489, 0.723686,0.110553, 0.705656,0.0960427, 0.681884,0.0833333,
0.653221,0.0727978, 0.620516,0.0648098, 0.584618,0.0597429, 0.546377,0.057971,
0.462175,0.0655967, 0.38716,0.0879982, 0.321963,0.124462, 0.26721,0.174275,
0.223531,0.236725, 0.191553,0.311096, 0.171906,0.396677, 0.165217,0.492754,
0.167085,0.543526, 0.172554,0.593229, 0.18142,0.641199, 0.193478,0.686775,
0.208526,0.729294, 0.226359,0.768093, 0.246773,0.802511, 0.269565,0.831884,
0.294667,0.857006, 0.322011,0.879053, 0.351393,0.897942, 0.382609,0.913587,
0.415455,0.925903, 0.449728,0.934805, 0.485224,0.940209, 0.521739,0.942029,
0.55169,0.940744, 0.580639,0.936911, 0.608534,0.930565, 0.635326,0.921739,
0.660963,0.910468, 0.685394,0.896784, 0.708568,0.880723, 0.730435,0.862319,
0.745853,0.84707, 0.75976,0.831363, 0.772546,0.814603, 0.784601,0.796196,
0.796317,0.775546, 0.808084,0.752061, 0.820293,0.725144, 0.833333,0.694203,
0.841667,0.694203, 0.85,0.694203,
0.858333,0.694203, 0.866667,0.694203,
0.865217,0.732428, 0.863768,0.770652, 0.862319,0.808877, 0.86087,0.847101,
0.85942,0.885326, 0.857971,0.923551, 0.856522,0.961775, 0.855072,1,
0.847101,1, 0.83913,1,
0.831159,1, 0.823188,1,
0.819138,0.990039, 0.813609,0.98091, 0.806757,0.972767, 0.798732,0.965761,
0.789688,0.960046, 0.779778,0.955774, 0.769155,0.953099, 0.757971,0.952174,
0.75214,0.95238, 0.745562,0.953012, 0.738304,0.954085, 0.730435,0.955616,
0.722022,0.957623, 0.713134,0.960122, 0.703838,0.963131, 0.694203,0.966667,
0.669684,0.97434, 0.645063,0.981046, 0.620375,0.986767, 0.595652,0.991485,
0.570929,0.995185, 0.546241,0.997849, 0.52162,0.999459, 0.497101,1,
0.392522,0.990268, 0.297147,0.962092, 0.212438,0.917001, 0.139855,0.856522,
0.0808595,0.782184, 0.0369112,0.695516, 0.00947117,0.598047, 0,0.491304,
0.00183978,0.439586, 0.00738215,0.390874, 0.016661,0.345049, 0.0297101,0.301993,
0.0465636,0.261586, 0.0672554,0.223709, 0.0918195,0.188244, 0.12029,0.155072,
0.15863,0.119698, 0.200657,0.0886549, 0.246114,0.0620613, 0.294746,0.0400362,
0.3463,0.0226987, 0.400521,0.0101675, 0.457153,0.00256171, 0.515942,0,
0.56498,0.00227868, 0.61721,0.00871821, 0.670527,0.0187244, 0.722826,0.0317028,
0.771999,0.047059, 0.815942,0.0641983, 0.852548,0.0825265, 0.87971,0.101449,
0.87971,0.138225, 0.87971,0.175, 0.87971,0.211775, 0.87971,0.248551,
0.87971,0.285326, 0.87971,0.322101, 0.87971,0.358877, 0.87971,0.395652,
0.880621,0.4247, 0.883741,0.448143, 0.889646,0.466627, 0.898913,0.480797,
0.912121,0.491299, 0.929846,0.498777, 0.952666,0.503878, 0.981159,0.507246,
0.981159,0.513768, 0.981159,0.52029,
0.981159,0.526812, 0.981159,0.533333};
0.934964f,0.533333f, 0.888768f,0.533333f, 0.842572f,0.533333f, 0.796377f,0.533333f,
0.703986f,0.533333f, 0.611594f,0.533333f,
0.611594f,0.526812f, 0.611594f,0.52029f,
0.611594f,0.513768f, 0.611594f,0.507246f,
0.632945f,0.505602f, 0.650611f,0.503872f, 0.665118f,0.501973f, 0.676993f,0.499819f,
0.686761f,0.497325f, 0.69495f,0.494407f, 0.702086f,0.490979f, 0.708696f,0.486957f,
0.716245f,0.481097f, 0.722622f,0.473234f, 0.727879f,0.463264f, 0.732065f,0.451087f,
0.735233f,0.4366f, 0.737432f,0.419701f, 0.738714f,0.400289f, 0.73913f,0.378261f,
0.73913f,0.348913f, 0.73913f,0.319565f, 0.73913f,0.290217f, 0.73913f,0.26087f,
0.73913f,0.231522f, 0.73913f,0.202174f, 0.73913f,0.172826f, 0.73913f,0.143478f,
0.735128f,0.126489f, 0.723686f,0.110553f, 0.705656f,0.0960427f, 0.681884f,0.0833333f,
0.653221f,0.0727978f, 0.620516f,0.0648098f, 0.584618f,0.0597429f, 0.546377f,0.057971f,
0.462175f,0.0655967f, 0.38716f,0.0879982f, 0.321963f,0.124462f, 0.26721f,0.174275f,
0.223531f,0.236725f, 0.191553f,0.311096f, 0.171906f,0.396677f, 0.165217f,0.492754f,
0.167085f,0.543526f, 0.172554f,0.593229f, 0.18142f,0.641199f, 0.193478f,0.686775f,
0.208526f,0.729294f, 0.226359f,0.768093f, 0.246773f,0.802511f, 0.269565f,0.831884f,
0.294667f,0.857006f, 0.322011f,0.879053f, 0.351393f,0.897942f, 0.382609f,0.913587f,
0.415455f,0.925903f, 0.449728f,0.934805f, 0.485224f,0.940209f, 0.521739f,0.942029f,
0.55169f,0.940744f, 0.580639f,0.936911f, 0.608534f,0.930565f, 0.635326f,0.921739f,
0.660963f,0.910468f, 0.685394f,0.896784f, 0.708568f,0.880723f, 0.730435f,0.862319f,
0.745853f,0.84707f, 0.75976f,0.831363f, 0.772546f,0.814603f, 0.784601f,0.796196f,
0.796317f,0.775546f, 0.808084f,0.752061f, 0.820293f,0.725144f, 0.833333f,0.694203f,
0.841667f,0.694203f, 0.85f,0.694203f,
0.858333f,0.694203f, 0.866667f,0.694203f,
0.865217f,0.732428f, 0.863768f,0.770652f, 0.862319f,0.808877f, 0.86087f,0.847101f,
0.85942f,0.885326f, 0.857971f,0.923551f, 0.856522f,0.961775f, 0.855072f,1.0f,
0.847101f,1.0f, 0.83913f,1.0f,
0.831159f,1.0f, 0.823188f,1.0f,
0.819138f,0.990039f, 0.813609f,0.98091f, 0.806757f,0.972767f, 0.798732f,0.965761f,
0.789688f,0.960046f, 0.779778f,0.955774f, 0.769155f,0.953099f, 0.757971f,0.952174f,
0.75214f,0.95238f, 0.745562f,0.953012f, 0.738304f,0.954085f, 0.730435f,0.955616f,
0.722022f,0.957623f, 0.713134f,0.960122f, 0.703838f,0.963131f, 0.694203f,0.966667f,
0.669684f,0.97434f, 0.645063f,0.981046f, 0.620375f,0.986767f, 0.595652f,0.991485f,
0.570929f,0.995185f, 0.546241f,0.997849f, 0.52162f,0.999459f, 0.497101f,1.0f,
0.392522f,0.990268f, 0.297147f,0.962092f, 0.212438f,0.917001f, 0.139855f,0.856522f,
0.0808595f,0.782184f, 0.0369112f,0.695516f, 0.00947117f,0.598047f, 0.0f,0.491304f,
0.00183978f,0.439586f, 0.00738215f,0.390874f, 0.016661f,0.345049f, 0.0297101f,0.301993f,
0.0465636f,0.261586f, 0.0672554f,0.223709f, 0.0918195f,0.188244f, 0.12029f,0.155072f,
0.15863f,0.119698f, 0.200657f,0.0886549f, 0.246114f,0.0620613f, 0.294746f,0.0400362f,
0.3463f,0.0226987f, 0.400521f,0.0101675f, 0.457153f,0.00256171f, 0.515942f,0.0f,
0.56498f,0.00227868f, 0.61721f,0.00871821f, 0.670527f,0.0187244f, 0.722826f,0.0317028f,
0.771999f,0.047059f, 0.815942f,0.0641983f, 0.852548f,0.0825265f, 0.87971f,0.101449f,
0.87971f,0.138225f, 0.87971f,0.175f, 0.87971f,0.211775f, 0.87971f,0.248551f,
0.87971f,0.285326f, 0.87971f,0.322101f, 0.87971f,0.358877f, 0.87971f,0.395652f,
0.880621f,0.4247f, 0.883741f,0.448143f, 0.889646f,0.466627f, 0.898913f,0.480797f,
0.912121f,0.491299f, 0.929846f,0.498777f, 0.952666f,0.503878f, 0.981159f,0.507246f,
0.981159f,0.513768f, 0.981159f,0.52029f,
0.981159f,0.526812f, 0.981159f,0.533333f};
/**
* Struct that contains some informations about the types of the manipulated objects
......
......@@ -16,7 +16,8 @@ include_directories(
# define libs path
IF(WIN32)
link_directories(${CGoGN_ROOT_DIR}/lib/$(ConfigurationName) ${Boost_LIBRARY_DIRS})
link_directories(${CGoGN_ROOT_DIR}/lib/$(ConfigurationName)
${Boost_LIBRARY_DIRS})
ELSE(WIN32)
link_directories(${CGoGN_ROOT_DIR}/lib/Release ${CGoGN_ROOT_DIR}/lib/Debug)
ENDIF(WIN32)
......
......@@ -14,7 +14,9 @@ Le plus sur mais plus long est de compiler soi-même Qt et Boost (bon courage)
Lancer CMake
Mettre le chemin de la racine de CGoGN + /ThirdParty pour les sources
Mettre le chemin de la racine de CGoGN + /ThirdParty/build pour le build
Mettre le chemin de la racine de CGoGN + /ThirdParty/buildRelease pour le build en release
Mettre le chemin de la racine de CGoGN + /ThirdParty/buildDebug pour le build en debug
La suite vaut pour les 2 répertoires:
Cliquer sur Configure
Choisir le bon compilateur (celui de votre version de Visual C++)
Modifier les variables en fonctions de ce que vous voulez compiler (README.TXT de ThirdParty)
......
......@@ -56,11 +56,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* Include our stdint.h replacement header for MSVC, take the global header for gcc/mingw
*/
#ifdef _MSC_VER
# include "pstdint.h"
#else
# include <stdint.h>
#endif
//#ifdef _MSC_VER
//# include "pstdint.h"
//#else
//# include <stdint.h>
//#endif
#include <stdint.h>
/* Undefine the min/max macros defined by some platform headers (namely Windows.h) to
* avoid obvious conflicts with std::min() and std::max().
......
......@@ -2,10 +2,26 @@ cmake_minimum_required(VERSION 2.6)
project(CGoGN_ThirdParty)
SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
IF(WIN32)
set(CMAKE_PREFIX_PATH ${CGoGN_ROOT_DIR}/windows_dependencies CACHE STRING "path to dependencies")
ENDIF(WIN32)
SET(CMAKE_BUILD_TYPE Release)
IF (${CMAKE_CURRENT_BINARY_DIR} MATCHES "(.*)Debug")
SET(CMAKE_BUILD_TYPE Debug)
ENDIF (${CMAKE_CURRENT_BINARY_DIR} MATCHES "(.*)Debug")
IF(WIN32)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib)#release added by visual
INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/)
ELSE(WIN32)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE})
ENDIF(WIN32)
# for shared or not shared
SET (BUILD_SHARED_LIBS OFF CACHE BOOL
"if used all library are build as shared type (.so /dylib/dll).")
......@@ -18,18 +34,10 @@ IF (APPLE)
SET(CMAKE_OSX_ARCHITECTURES x86_64)
ENDIF(APPLE)
IF(WIN32)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib)#release added by visual
INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/)
ELSE(WIN32)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
ENDIF(WIN32)
add_subdirectory(Tools Tools/build)
# add_subdirectory(gzstream gzstream/build)
IF (WITH_ZINRI)
add_subdirectory(Zinri Zinri/build)
ENDIF(WITH_ZINRI)
......@@ -42,3 +50,8 @@ IF (WITH_NUMERICAL)
add_subdirectory(Numerical Numerical/build)
ENDIF (WITH_NUMERICAL)
IF(WIN32)
SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE})
SET(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "" FORCE)
MARK_AS_ADVANCED(CMAKE_CONFIGURATION_TYPES)
ENDIF(WIN32)
......@@ -4,7 +4,9 @@ Assimp: import de nombreux type de fichiers 3D (maillages)
Compilation:
============
cd build
cd buildRelease (pour compiler en release)
ou cd buildDebug (pour compiler en Debug)
cmake .. ou ccmake .. ou cmake-gui ..
options (et valeur par defaut)
......@@ -14,3 +16,6 @@ options (et valeur par defaut)
WITH_ZINRI (T)
Pour utiliser avec CMake -DOPTION=true/false
Pour compiler make dans le repertoire sous linux
ou avec VisualStudio souss Linux
......@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.6)
project(Tools)
SET(EXECUTABLE_OUTPUT_PATH ${CGoGN_ROOT_DIR}/bin)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../bin/)
add_executable( shader_to_h ${CMAKE_CURRENT_SOURCE_DIR}/shader_to_h.cpp )
......
......@@ -12,16 +12,16 @@
#ifndef ZINRIMAGE_H
#define ZINRIMAGE_H
#ifdef WIN32
#ifdef EXPORTING
#define APIEXPORT __declspec(dllexport)
#else
#define APIEXPORT __declspec(dllimport)
#endif
#else
#define APIEXPORT
#endif
//#ifdef WIN32
// #ifdef EXPORTING
// #define APIEXPORT __declspec(dllexport)
// #else
// #define APIEXPORT __declspec(dllimport)
// #endif
//#else
// #define APIEXPORT
//#endif
#define APIEXPORT
#ifdef __cplusplus
extern "C" {
......
......@@ -93,9 +93,9 @@ ENDIF(APPLE)
IF(WIN32)
add_subdirectory(Release)
add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps)
# set(CMAKE_CONFIGURATION_TYPES Release Debug)
# set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Only Release or Debug" FORCE)
set(CMAKE_CONFIGURATION_TYPES "Release Debug" CACHE STRING "Only Release or Debug" FORCE)
set(CMAKE_CONFIGURATION_TYPES Release Debug)
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Only Release or Debug" FORCE)
# set(CMAKE_CONFIGURATION_TYPES "Release Debug" CACHE STRING "Only Release or Debug" FORCE)
ELSE(WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
add_subdirectory(Release)
......
......@@ -80,15 +80,13 @@ file(
IF(WIN32)
add_custom_target(shader_target ${CGoGN_ROOT_DIR}/bin/Release/shader_to_h ${shaders_src}
add_custom_target(shader_target ${CGoGN_ROOT_DIR}/ThirdParty/bin/Release/shader_to_h ${shaders_src}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${shaders_src}
)
SOURCES ${shaders_src} )
ELSE(WIN32)
add_custom_target(shader_target ${CGoGN_ROOT_DIR}/bin/shader_to_h ${shaders_src}
add_custom_target(shader_target ${CGoGN_ROOT_DIR}/ThirdParty/bin/shader_to_h ${shaders_src}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${shaders_src}
)
SOURCES ${shaders_src} )
ENDIF(WIN32)
......
......@@ -50,13 +50,13 @@ SET (COMMON_LIBS
#optionnal libs
IF (WITH_ASSIMP)
add_definitions(-DWITH_ASSIMP)
SET (COMMON_INCLUDES ${COMMON_INCLUDES} ThirdParty/Assimp/include)
SET (COMMON_INCLUDES ${COMMON_INCLUDES} ${CGoGN_ROOT_DIR}/ThirdParty/Assimp/include)
SET (COMMON_LIBS ${COMMON_LIBS} assimp)
ENDIF (WITH_ASSIMP)
IF (WITH_ZINRI)
add_definitions(-DWITH_ZINRI)
SET (COMMON_INCLUDES ${COMMON_INCLUDES} ${CGoGN_ROOT_DIR}/ThirdParty/Zinri)
SET (COMMON_INCLUDES ${COMMON_INCLUDES} ${CGoGN_ROOT_DIR}/ThirdParty/Zinri)
SET (COMMON_LIBS ${COMMON_LIBS} Zinri)
ENDIF (WITH_ZINRI)
......
......@@ -25,7 +25,6 @@
#include "Topology/generic/attributeHandler.h"
#include "Topology/generic/autoAttributeHandler.h"
#include "Topology/generic/cellmarker.h"
#include "openctm.h"
namespace CGoGN
{
......
......@@ -310,7 +310,7 @@ void computeCurvatureVertices_NormalCycles(
typename PFP::TVEC3& Kmax,
typename PFP::TVEC3& Kmin,
typename PFP::TVEC3& Knormal,
const FunctorSelect& select = SelectorTrue())
const FunctorSelect& select)
{
CellMarker marker(map, VERTEX);
for(Dart d = map.begin(); d != map.end(); map.next(d))
......
......@@ -25,6 +25,9 @@
#ifndef _GL2_MAP_RENDER_
#define _GL2_MAP_RENDER_
#define _USE_MATH_DEFINES
#include <cmath>
#include <GL/glew.h>
#include <vector>
#include <list>
......
......@@ -153,6 +153,9 @@ private:
bool optimize(VEC4& v) const
{
#ifdef WIN32
#define isnan(X) _isnan(X)
#endif
if (isnan(A(0,0)))
return false ;
......
......@@ -231,7 +231,7 @@ public:
* @param h heighy of image
* @param bpp byte per pixel of image
*/
bool load(const unsigned char *ptr, unsigned int w, unsigned int h, unsigned int bpp)
bool load(const unsigned char *ptr, unsigned int w, unsigned int h, unsigned int bpp);
#ifdef WITH_QT
/// load from file
......
......@@ -329,7 +329,7 @@ bool Image<DIM,TYPE>::load(const std::string& filename)
if (ptr == NULL)
{
CGoGNout << "Impossible to load "<< filename << std::endl;
CGoGNout << "Impossible to load "<< filename << CGoGNendl;
return false;
}
......@@ -354,19 +354,19 @@ bool Image<DIM,TYPE>::load(const std::string& filename)
if (sizeof(TYPE) == 3)
{
QImage img = ptr->convertToFormat(QImage::Format_RGB888);
this->m_data_ptr = new T[3*img.width()*img.height()];
this->m_data_ptr = new TYPE[3*img.width()*img.height()];
memcpy(this->m_data_ptr, img.bits(), 3*img.width()*img.height());
}
else if (sizeof(TYPE) == 1)
{
QImage img = ptr->convertToFormat(QImage::Format_Indexed8);
this->m_data_ptr = new T[img.width()*img.height()];
this->m_data_ptr = new TYPE[img.width()*img.height()];
memcpy(this->m_data_ptr, img.bits(), img.width()*img.height());
}
}
else
{
this->m_data_ptr = new T[ptr->width()*ptr->height()];
this->m_data_ptr = new TYPE[ptr->width()*ptr->height()];
memcpy(this->m_data_ptr, ptr->bits(), ptr->width()*ptr->height());
}
......@@ -386,30 +386,24 @@ void Image<DIM,TYPE>::save(const std::string& filename)
if (this->m_data_ptr != NULL)
{
QImage* ptrIm = NULL;
switch(sizeof(TYPE))
{
case 1:
{
QImage((uchar *)(this->m_data_ptr), this->m_size[0],this->m_size[1], QImage::Format_Indexed8);
this->m_qimg->save(QString(filename), QImage::Format_Indexed8);
}
ptrIm = new QImage((uchar *)(this->m_data_ptr), this->m_size[0],this->m_size[1], QImage::Format_Indexed8);
break;
case 3:
{
QImage((uchar *)(this->m_data_ptr), this->m_size[0],this->m_size[1], QImage::Format_RGB888);
this->m_qimg->save(QString(filename), QImage::Format_RGB888);
}
ptrIm = new QImage((uchar *)(this->m_data_ptr), this->m_size[0],this->m_size[1], QImage::Format_RGB888);
break;
case 4:
{
QImage((uchar *)(this->m_data_ptr), this->m_size[0],this->m_size[1], QImage::Format_ARGB32);
this->m_qimg->save(QString(filename), QImage::Format_ARGB32);
}
ptrIm = new QImage((uchar *)(this->m_data_ptr), this->m_size[0],this->m_size[1], QImage::Format_ARGB32);
break;
default:
break;
}
}
ptrIm->save(QString(filename.c_str()));
delete ptrIm;
}
#endif
......
......@@ -27,6 +27,10 @@
#include "Utils/img3D_IO.h"
#include "Utils/cgognStream.h"
#ifdef WITH_QT
#include <QImage>
#include <QString>
#endif
namespace CGoGN
{
......@@ -156,9 +160,8 @@ void saveBool(const std::string& filename, unsigned char* data, int w, int h, in
// save image2D
int hh = (h*nd)+1;
QImage img(dat_comp, w, hh, Q, QImage::Format_Indexed8);
img.save(filename, QImage::Format_Indexed8);
QImage img(dat_comp, w, hh, QImage::Format_Indexed8);
img.save(QString(filename.c_str()));
}
......@@ -177,7 +180,7 @@ unsigned char* loadVal_8(const std::string& filename, int& w, int& h, int &d, fl
if ((bpp!=8))
return NULL;
unsigned char* ptr=bits();
unsigned char* ptr=ptrImg->bits();
int* ptr_int = reinterpret_cast<int*>(ptr+(w*(h-1)));
int t = *ptr_int++;
......@@ -198,14 +201,14 @@ unsigned char* loadVal_8(const std::string& filename, int& w, int& h, int &d, fl
// uncompress data
unsigned char* data = uncompressZ8<unsigned char>(ptr,w,h,d);
delete prtImg;
delete ptrImg;
// return 3D image
return data;
}
unsigned char* ptr2 = new unsigned char[w*h*d];
memcpy (ptr2, ptr, w*h*d);
delete prtImg;
delete ptrImg;
return ptr2;
}
......@@ -233,7 +236,7 @@ void saveVal(const std::string& filename, unsigned char* data, int w, int h, int
*entete2++ = vz;
// save image
img.save(filename.c_str(),QImage::Format_Indexed8);
img.save(QString(filename.c_str()));
}
......@@ -253,7 +256,7 @@ unsigned char* loadRGB(const std::string& filename, int& w, int& h, int &d, floa
if ((bpp!=24))
return NULL;
unsigned char* ptr=bits();
unsigned char* ptr=ptrImg->bits();
int* ptr_int = reinterpret_cast<int*>(ptr+3*(w*(h-1)));
int t = *ptr_int++;
if (t!= RGB8)
......@@ -269,7 +272,7 @@ unsigned char* loadRGB(const std::string& filename, int& w, int& h, int &d, floa
unsigned char* ptr2 = new unsigned char[3*w*h*d];
memcpy (ptr2, ptr, 3*w*h*d);
delete prtImg;
delete ptrImg;
return ptr2;
}
......@@ -296,7 +299,7 @@ void saveRGB(const std::string& filename, unsigned char* data, int w, int h, int
// save image
img.save(filename.c_str(),QImage::Format_RGB888);
img.save(QString(filename.c_str()));
}
/*
......
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