Commit 4dc1bdba authored by Sylvain Thery's avatar Sylvain Thery

Merge branch 'develop' into 'develop'

Develop

See merge request !41
parents 19976f90 280b6faa
......@@ -89,7 +89,6 @@ IF(WIN32)
ENDIF(WIN32)
find_package(OpenGL REQUIRED)
find_package(Boost COMPONENTS regex REQUIRED)
find_package(ZLIB REQUIRED)
find_package(GLEW REQUIRED)
......@@ -130,7 +129,6 @@ SET (CGoGN_EXT_INCLUDES
${OPENGL_INCLUDE_DIR}
${GLEW_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)
# define libs for external libs
......@@ -139,7 +137,6 @@ SET (CGoGN_EXT_LIBS
${OPENGL_LIBRARY}
${GLEW_LIBRARIES}
${ZLIB_LIBRARIES}
${Boost_REGEX_LIBRARY}
tinyxml2
)
......
English version bellow
Dpendences Linux
=================
installer les paquets suivants:
cmake cmake-curses-gui cmake-qt-gui libXi-dev libXmu-dev libglew-dev libxml2-dev libboost-all-dev zlib1g-dev qt4-designer qt4-dev-tools uuid-dev libgsl0-dev libsuitesparse-dev libqglviewer-dev
Pour compiler CGoGN
===================
* on compile tout d'abord les bibliothques third-party :
```
cd CGoGN/ThirdParty/build
cmake ..
make (-j x si vous avez x cores)
make install
```
La mme chose en debug:
```
cd ../buildDebug
cmake ..
make (-j x si vous avez x cores)
```
On peut fixer certaines option pour ne pas tout compiler:
* WITH_ASSIMP -> compile et utilise la librairie Assimp
* WITH_ZINRI -> compile et utilise la librairie Zinri
* WITH_PYTHONQT -> pour SCHNApps
* ensuite on compile CGoGN :
```
cd CGoGN/build
cmake ..
make (-j x si vous avez x cores)
```
Et en Debug avec:
```
cd ../buildDebug
cmake ..
make (-j x si vous avez x cores)
```
Certaines options sont disponibles :
* BUILD_SHARED_LIBS -Q experimental !
* ONELIB -> compilation en une seule lib (libcgogn.a) au lieu de 4
* WITH_ASSIMP -> utilise Assimp (auto set par third party compil)
* WITH_ZINRI -> utilise Zinri (auto set par third party compil)
* WITH_QT -> minimize les dependence si pas besoin de Qt (VRJuggler)
* WITH_GLEWMX -> pour utiliser GLEWMX a la place de GELW (pour VRJuggler)
Les librairies sont generees dans lib/Release et lib/Debug
Les binaires sont generes dans bin/Release et bin/Debug
* on peut ensuite compiler SCHNApps ainsi que les plugins fournis :
```
cd CGoGN/SCHNApps/build
cmake ..
make (-j x si vous avez x cores)
```
Et en Debug avec:
```
cd ../buildDebug
cmake ..
make (-j x si vous avez x cores)
```
Linux dependencies
==================
install the following packages:
cmake cmake-curses-gui cmake-qt-gui libXi-dev libXmu-dev libglew-dev zlib1g-dev libqt4-dev qt4-dev-tools uuid-dev libgsl0-dev libsuitesparse-dev libqglviewer-dev
Mac Dependencies
=================
To compile CGoGN on MAC
Des exemples de donnes (fichiers trianbgz, off, etc..) sont accessible l'adresse suivante:
https://iggservis.u-strasbg.fr/Data/data.zip
* install XCode and command line tools.
* install Qt4 (4.8) and QtCreator
* install (or build) libQGLViewer
* install cmake (native or with homebrew)
* install with homebrew : lzlib, glew, suite-sparse
To install suite-sparse package, you must first
add the homebrew/science repository with the following command :
brew tap homebrew/science
ENGLISH VERSION
===============
Compilation is the same as on Linux for CGoGN
Linux dependencies
==================
install the following packages:
cmake cmake-curses-gui cmake-qt-gui libXi-dev libXmu-dev libglew-dev libxml2-dev libboost-all-dev zlib1g-dev qt4-designer qt4-dev-tools uuid-dev libgsl0-dev libsuitesparse-dev libqglviewer-dev
To compile CGoGN
================
......@@ -101,7 +36,8 @@ To compile CGoGN
```
cd ../buildDebug
cmake ..
make
make (-j x if you have x cores)
make install
```
Some options are available to not compile everything:
......@@ -133,6 +69,7 @@ To compile CGoGN
* WITH_QT -> to minimize dependencies and compilation time
* WITH_GLEWMX -> to use GLEWMX (for VRJuggler users)
* we can then compile SCHNApps and the provided plugins :
```
......
......@@ -21,7 +21,6 @@ SET( USE_OGL_CORE_PROFILE OFF CACHE BOOL "use OpenGL 3.3 core profile (do not wo
find_package(OpenGL REQUIRED)
find_package(Boost COMPONENTS regex system REQUIRED)
find_package(ZLIB REQUIRED)
find_package(GLEW REQUIRED)
find_package(Qt4 REQUIRED)
......@@ -74,7 +73,6 @@ SET (EXT_INCLUDES
${OPENGL_INCLUDE_DIR}
${GLEW_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${QT_INCLUDE_DIR}
${QGLVIEWER_INCLUDE_DIR}
${PYTHON_INCLUDE_DIRS}
......@@ -90,8 +88,6 @@ SET (EXT_LIBS
${OPENGL_LIBRARY}
${GLEW_LIBRARIES}
${ZLIB_LIBRARIES}
${Boost_SYSTEM_LIBRARY}
${Boost_REGEX_LIBRARY}
${QT_LIBRARIES}
${PYTHON_LIBRARIES}
${SUITESPARSE_LIBRARIES}
......
......@@ -17,4 +17,4 @@ ADD_SUBDIRECTORY(surface_radiance)
ADD_SUBDIRECTORY(volume_import)
#ADD_SUBDIRECTORY(volume_render)
ADD_SUBDIRECTORY(volumetric)
#ADD_SUBDIRECTORY(volumetric)
......@@ -2,7 +2,9 @@ cmake_minimum_required(VERSION 2.6)
project(Zinri)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
find_package(ZLIB REQUIRED)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIRS})
file(
GLOB_RECURSE
......@@ -11,3 +13,4 @@ file(
)
add_library( Zinri ${source_files} )
target_link_libraries(Zinri ${ZLIB_LIBRARIES})
......@@ -29,7 +29,6 @@
#undef toupper
#include "Utils/cgognStream.h"
#include <boost/regex.hpp>
#include <string>
#include <sstream>
......
......@@ -23,6 +23,7 @@
*******************************************************************************/
#include "Utils/shaderMutator.h"
#include <regex>
namespace CGoGN
{
......@@ -451,15 +452,15 @@ bool ShaderMutator::srcContainsVariableDeclaration(const std::string& variableNa
{
// Regular expression for variable declaration
// <',' OR white-space[1 or more times]> <variableName> <',' OR ';' OR white-space>
boost::regex var_re("(,|\\s+)" + variableName + "(,|;|\\s)");
std::regex var_re("(,|\\s+)" + variableName + "(,|;|\\s)");
// Matches results
boost::match_results <std::string::iterator> matches;
std::match_results <std::string::iterator> matches;
// Search for the first expression that matches and isn't commented
std::string::iterator start = src.begin();
std::string::iterator end = src.end();
while (regex_search(start, end, matches, var_re, boost::format_first_only))
while (std::regex_search(start, end, matches, var_re, std::regex_constants::format_first_only))
{
// Start position of the match
size_t startPosition = std::distance(src.begin(), matches[0].first);
......@@ -480,10 +481,10 @@ bool ShaderMutator::srcSetMinShadingLanguageVersion(int version, std::string& mo
{
// Regular expression for shading language version
// <#version> <white-space>[1 or more times] <digit>[1 or more times]
boost::regex version_re("#version\\s+(\\d+)");
std::regex version_re("#version\\s+(\\d+)");
// Matches results
boost::match_results <std::string::iterator> matches;
std::match_results <std::string::iterator> matches;
// Build the version string
std::string versionStr;
......@@ -494,7 +495,7 @@ bool ShaderMutator::srcSetMinShadingLanguageVersion(int version, std::string& mo
// Search for the first expression that matches and isn't commented
std::string::iterator start = modifiedSrc.begin();
std::string::iterator end = modifiedSrc.end();
while (regex_search(start, end, matches, version_re, boost::format_first_only))
while (std::regex_search(start, end, matches, version_re, std::regex_constants::format_first_only))
{
// Start position of the match
size_t startPosition = std::distance(modifiedSrc.begin(), matches[0].first);
......@@ -535,10 +536,10 @@ bool ShaderMutator::srcChangeIntConstantValue(int newVal, const std::string& con
{
// Regular expression for constant expression
// <#define> <white-space>[1 or more times] <constant name> <white-space>[1 or more times] <digit>[1 or more times]
boost::regex const_re("#define\\s+" + constantName + "\\s+(\\d+)");
std::regex const_re("#define\\s+" + constantName + "\\s+(\\d+)");
// Matches results
boost::match_results <std::string::iterator> matches;
std::match_results <std::string::iterator> matches;
// Build the constant value string
std::string newValStr;
......@@ -549,7 +550,7 @@ bool ShaderMutator::srcChangeIntConstantValue(int newVal, const std::string& con
// Search for the first expression that matches and isn't commented
std::string::iterator start = modifiedSrc.begin();
std::string::iterator end = modifiedSrc.end();
while (regex_search(start, end, matches, const_re, boost::format_first_only))
while (std::regex_search(start, end, matches, const_re, std::regex_constants::format_first_only))
{
// Start position of the match
size_t startPosition = std::distance(modifiedSrc.begin(), matches[0].first);
......@@ -582,10 +583,10 @@ bool ShaderMutator::srcChangeFloatConstantValue(float newVal, const std::string&
// Regular expression for constant expression
// <#define> <white-space>[1 or more times] <constant name> <white-space>[1 or more times]
// <digit>[1 or more times] <.>[0 or 1 time] <digit>[0 or more times]
boost::regex const_re("#define\\s+" + constantName + "\\s+(\\d+\\.?\\d*)");
std::regex const_re("#define\\s+" + constantName + "\\s+(\\d+\\.?\\d*)");
// Matches results
boost::match_results <std::string::iterator> matches;
std::match_results <std::string::iterator> matches;
// Build the constant value string
std::string newValStr;
......@@ -596,7 +597,7 @@ bool ShaderMutator::srcChangeFloatConstantValue(float newVal, const std::string&
// Search for the first expression that matches and isn't commented
std::string::iterator start = modifiedSrc.begin();
std::string::iterator end = modifiedSrc.end();
while (regex_search(start, end, matches, const_re, boost::format_first_only))
while (std::regex_search(start, end, matches, const_re, std::regex_constants::format_first_only))
{
// Start position of the match
size_t startPosition = std::distance(modifiedSrc.begin(), matches[0].first);
......@@ -628,15 +629,15 @@ bool ShaderMutator::srcInsertCodeBeforeMainFunction(const std::string& insertedC
{
// Regular expression for main function
// <void> <white-space>[1 or more times] <main> <white-space>[0 or more times] <'('>
boost::regex main_re("(void)\\s+(main)\\s*\\(");
std::regex main_re("(void)\\s+(main)\\s*\\(");
// Matches results
boost::match_results <std::string::iterator> matches;
std::match_results <std::string::iterator> matches;
// Search for the first expression that matches and isn't commented
std::string::iterator start = modifiedSrc.begin();
std::string::iterator end = modifiedSrc.end();
while (regex_search(start, end, matches, main_re, boost::format_first_only))
while (std::regex_search(start, end, matches, main_re, std::regex_constants::format_first_only))
{
// Start position of the match
size_t startPosition = std::distance(modifiedSrc.begin(), matches[0].first);
......@@ -664,15 +665,15 @@ bool ShaderMutator::srcInsertCodeAtMainFunctionBeginning(const std::string& inse
// <void> <white-space>[1 or more times] <main> <white-space>[0 or more times]
// <'('> <white-space>[0 or more times] <')'>
// <white-space>[0 or more times] <'{'>
boost::regex main_re("(void)\\s+(main)\\s*\\(\\s*\\)\\s*\\{");
std::regex main_re("(void)\\s+(main)\\s*\\(\\s*\\)\\s*\\{");
// Matches results
boost::match_results <std::string::iterator> matches;
std::match_results <std::string::iterator> matches;
// Search for the first expression that matches and isn't commented
std::string::iterator start = modifiedSrc.begin();
std::string::iterator end = modifiedSrc.end();
while (regex_search(start, end, matches, main_re, boost::format_first_only))
while (std::regex_search(start, end, matches, main_re, std::regex_constants::format_first_only))
{
// Start position of the match
size_t startPosition = std::distance(modifiedSrc.begin(), matches[0].first);
......@@ -703,16 +704,16 @@ bool ShaderMutator::srcInsertCodeAtMainFunctionEnd(const std::string& insertedCo
// <void> <white-space>[1 or more times] <main> <white-space>[0 or more times]
// <'('> <white-space>[0 or more times] <')'>
// <white-space>[0 or more times] <'{'>
boost::regex main_re("(void)\\s+(main)\\s*\\(\\s*\\)\\s*\\{");
std::regex main_re("(void)\\s+(main)\\s*\\(\\s*\\)\\s*\\{");
// Matches results
boost::match_results <std::string::iterator> matches;
std::match_results <std::string::iterator> matches;
// Search for the first expression that matches and isn't commented
std::string::iterator start = modifiedSrc.begin();
std::string::iterator end = modifiedSrc.end();
size_t mainFirstBracePos = 0; // The aim is first to find this position
while (regex_search(start, end, matches, main_re, boost::format_first_only) && (mainFirstBracePos == 0))
while (std::regex_search(start, end, matches, main_re, std::regex_constants::format_first_only) && (mainFirstBracePos == 0))
{
// Start position of the match
size_t startPosition = std::distance(modifiedSrc.begin(), matches[0].first);
......
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