Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Pitiot
CGoGN
Commits
4bc17c66
Commit
4bc17c66
authored
May 10, 2011
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of cgogn:~cgogn/CGoGN
parents
3429cb80
19fce084
Changes
43
Show whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
1367 additions
and
220 deletions
+1367
-220
Apps/CMakeLists.txt
Apps/CMakeLists.txt
+3
-2
Apps/Examples/Release/CMakeLists.txt
Apps/Examples/Release/CMakeLists.txt
+6
-3
Apps/Tuto/CMakeLists.txt
Apps/Tuto/CMakeLists.txt
+16
-7
Apps/Tuto/tuto1.cpp
Apps/Tuto/tuto1.cpp
+20
-5
Apps/Tuto/tuto5.cpp
Apps/Tuto/tuto5.cpp
+48
-6
Apps/Tuto/tuto5.h
Apps/Tuto/tuto5.h
+7
-3
Apps/Tuto/tuto_mt.cpp
Apps/Tuto/tuto_mt.cpp
+1
-1
Apps/Tuto/tuto_ogl3.cpp
Apps/Tuto/tuto_ogl3.cpp
+0
-2
README.TXT
README.TXT
+5
-1
README_VISUAL.TXT
README_VISUAL.TXT
+8
-3
ThirdParty/CMakeLists.txt
ThirdParty/CMakeLists.txt
+5
-4
ThirdParty/gzstream/gzstream.h
ThirdParty/gzstream/gzstream.h
+4
-4
build/CMakeLists.txt
build/CMakeLists.txt
+23
-5
build/Debug/CMakeLists.txt
build/Debug/CMakeLists.txt
+7
-5
build/Release/CMakeLists.txt
build/Release/CMakeLists.txt
+8
-4
include/Algo/Export/export.hpp
include/Algo/Export/export.hpp
+149
-1
include/Algo/Export/exportPov.h
include/Algo/Export/exportPov.h
+34
-40
include/Algo/Import/import2tablesSurface.hpp
include/Algo/Import/import2tablesSurface.hpp
+132
-1
include/Algo/Render/Deprecated/vbo_MapRender.h
include/Algo/Render/Deprecated/vbo_MapRender.h
+1
-1
include/Algo/Render/GL2/mapRender.h
include/Algo/Render/GL2/mapRender.h
+0
-6
include/Algo/Render/GL2/mapRender.hpp
include/Algo/Render/GL2/mapRender.hpp
+2
-54
include/Algo/Render/SVG/mapSVGRender.h
include/Algo/Render/SVG/mapSVGRender.h
+194
-0
include/Algo/Render/SVG/mapSVGRender.hpp
include/Algo/Render/SVG/mapSVGRender.hpp
+116
-0
include/Topology/generic/functor.h
include/Topology/generic/functor.h
+1
-0
include/Utils/cgognStream.h
include/Utils/cgognStream.h
+1
-0
include/Utils/cgognStream.hpp
include/Utils/cgognStream.hpp
+61
-0
include/Utils/colourConverter.h
include/Utils/colourConverter.h
+3
-2
include/Utils/glutwin.h
include/Utils/glutwin.h
+2
-2
include/Utils/img3D_IO.h
include/Utils/img3D_IO.h
+10
-10
include/Utils/os_spec.h
include/Utils/os_spec.h
+4
-13
include/Utils/qtInputs.h
include/Utils/qtInputs.h
+3
-3
include/Utils/qtSimple.h
include/Utils/qtSimple.h
+47
-2
include/Utils/qtgl.h
include/Utils/qtgl.h
+2
-1
include/Utils/quadricRGBfunctions.h
include/Utils/quadricRGBfunctions.h
+1
-0
include/Utils/trackball.h
include/Utils/trackball.h
+4
-4
include/Utils/vbo.h
include/Utils/vbo.h
+7
-2
src/Algo/Render/mapRender.cpp
src/Algo/Render/mapRender.cpp
+0
-12
src/Algo/Render/mapSVGRender.cpp
src/Algo/Render/mapSVGRender.cpp
+351
-0
src/Utils/cgognStream.cpp
src/Utils/cgognStream.cpp
+1
-0
src/Utils/qtSimple.cpp
src/Utils/qtSimple.cpp
+39
-3
src/Utils/qtgl.cpp
src/Utils/qtgl.cpp
+12
-2
src/Utils/qtinputs.cpp
src/Utils/qtinputs.cpp
+6
-5
src/Utils/vbo.cpp
src/Utils/vbo.cpp
+23
-1
No files found.
Apps/CMakeLists.txt
View file @
4bc17c66
...
...
@@ -2,13 +2,14 @@ SET(EXECUTABLE_OUTPUT_PATH ${CGoGN_ROOT_DIR}/bin)
SET
(
COMMON_LIBS
${
GLUT_LIBRARY
}
${
OPENGL_LIBRARY
}
${
GLEW_LIBRARY
}
${
DEVIL_LIBRARIES
}
${
ZLIB_LIBRARIES
}
${
LIBXML2_LIBRARIES
}
gzstream AntTweakBar openctm assimp
)
SET
(
CGoGN_LIBS_D topologyD algoD containerD utilsD
)
SET
(
CGoGN_LIBS_R topology algo container utils
)
IF
(
WIN32
)
SET
(
CGoGN_LIBS_D topology algo container utils
)
# libs have same name but in different place in Visual
add_subdirectory
(
Examples/Release
)
add_subdirectory
(
Tuto
)
ELSE
(
WIN32
)
SET
(
CGoGN_LIBS_D topologyD algoD containerD utilsD
)
add_subdirectory
(
Examples/Release
)
add_subdirectory
(
Examples/Debug
)
add_subdirectory
(
Examples/Tests
)
...
...
Apps/Examples/Release/CMakeLists.txt
View file @
4bc17c66
...
...
@@ -28,9 +28,12 @@ include_directories(
)
# define libs path
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Release
)
IF
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/$
(
ConfigurationName
)
)
ELSE
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Release
)
ENDIF
(
WIN32
)
#define exec to compile
...
...
Apps/Tuto/CMakeLists.txt
View file @
4bc17c66
...
...
@@ -2,12 +2,8 @@ cmake_minimum_required(VERSION 2.6)
project
(
Tutos
)
#SET (COMMON_LIBS ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ${GLEW_LIBRARY} ${DEVIL_LIBRARIES} ${ZLIB_LIBRARIES} ${LIBXML2_LIBRARIES} gzstream AntTweakBar openctm)
SET
(
CMAKE_BUILD_TYPE Debug
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DNOTOPOWARNING"
)
# FOR Qt4
...
...
@@ -18,6 +14,8 @@ ADD_DEFINITIONS(${QT_DEFINITIONS})
# define includes path
MESSAGE
(
STATUS
${
BOOST_INCLUDE_PATH
}
)
include_directories
(
${
CMAKE_CURRENT_BINARY_DIR
}
/usr/include/libxml2/
...
...
@@ -26,11 +24,16 @@ include_directories(
${
CGoGN_ROOT_DIR
}
/ThirdParty/Assimp/include
${
CGoGN_ROOT_DIR
}
/ThirdParty/glm
${
CGoGN_ROOT_DIR
}
/include
${
BOOST_INCLUDE_PATH
}
)
# define libs path
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Release
${
CGoGN_ROOT_DIR
}
/lib/Debug
)
IF
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/$
(
ConfigurationName
))
ELSE
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Release
${
CGoGN_ROOT_DIR
}
/lib/Debug
)
ENDIF
(
WIN32
)
#define exec to compile
...
...
@@ -71,10 +74,16 @@ add_executable( tp_master tp_master.cpp ${tp_master_moc})
target_link_libraries
(
tp_master
${
CGoGN_LIBS_D
}
${
COMMON_LIBS
}
${
QT_LIBRARIES
}
)
#BOOST_LIBS macro: allow using compiled boost in windows (see readme)
# -first argument variable that will contain the libs
# -second argument list of boost libs separated by ; in " "
# exemple: BOOST_LIBS(boost_lib_lists "boost_thread-mt;boost_iostreams-mt")
BOOST_LIBS
(
boost_lib_lists
"boost_thread-mt"
)
QT4_WRAP_CPP
(
tuto_mt_moc tuto_mt.h
)
add_executable
(
tuto_mt tuto_mt.cpp
${
tuto_mt_moc
}
)
target_link_libraries
(
tuto_mt
${
CGoGN_LIBS_D
}
${
COMMON_LIBS
}
${
QT_LIBRARIES
}
boost_thread-mt
)
${
CGoGN_LIBS_D
}
${
COMMON_LIBS
}
${
QT_LIBRARIES
}
${
boost_lib_lists
}
)
QT4_WRAP_CPP
(
tuto_ogl3_moc tuto_ogl3.h
)
add_executable
(
tuto_ogl3 tuto_ogl3.cpp
${
tuto_ogl3_moc
}
)
...
...
Apps/Tuto/tuto1.cpp
View file @
4bc17c66
...
...
@@ -22,8 +22,6 @@
* *
*******************************************************************************/
//#define GL3_PROTOTYPES
#include "tuto1.h"
#include <iostream>
...
...
@@ -41,6 +39,9 @@
#include <glm/gtc/type_ptr.hpp>
#include "Algo/Render/SVG/mapSVGRender.h"
using
namespace
CGoGN
;
/**
...
...
@@ -53,6 +54,11 @@ struct PFP: public PFP_STANDARD
typedef
EmbeddedMap2
<
Map2
>
MAP
;
};
// declaration of the map
PFP
::
MAP
myMap
;
// and attribute of position
AttributeHandler
<
PFP
::
VEC3
>
position
;
void
MyQT
::
cb_initGL
()
{
// choose to use GL version 2
...
...
@@ -99,12 +105,21 @@ void MyQT::cb_keyPress(int code)
if
((
code
>
'0'
)
&&
(
code
<=
'9'
))
CGoGNout
<<
" key num "
<<
code
-
'0'
<<
"pressed"
<<
CGoGNendl
;
if
(
code
==
's'
)
{
std
::
string
filename
=
selectFileSave
(
"Export SVG file "
);
CGoGNout
<<
"Exporting "
<<
filename
<<
CGoGNendl
;
Algo
::
Render
::
SVG
::
SVGOut
svg
(
filename
,
modelViewMatrix
(),
projectionMatrix
());
svg
.
renderLinesToSVG
<
PFP
>
(
myMap
,
position
);
svg
.
setColor
(
Geom
::
Vec3f
(
0.7
f
,
0.0
f
,
0.4
f
));
svg
.
renderFacesToSVG
<
PFP
>
(
myMap
,
position
,
0.8
f
);
//svg destruction close the file
}
}
int
main
(
int
argc
,
char
**
argv
)
{
// declaration of the map
PFP
::
MAP
myMap
;
// creation of 2 new faces: 1 triangle and 1 square
Dart
d1
=
myMap
.
newFace
(
3
);
...
...
@@ -115,7 +130,7 @@ int main(int argc, char **argv)
// creation of a new attribute on vertices of type 3D vector
// a handler to this attribute is returned
AttributeHandler
<
PFP
::
VEC3
>
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
"position"
);
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
"position"
);
// affect a position to the vertices of the mesh
position
[
d1
]
=
PFP
::
VEC3
(
0
,
0
,
0
);
...
...
Apps/Tuto/tuto5.cpp
View file @
4bc17c66
...
...
@@ -49,6 +49,7 @@
#include "Utils/shaderVectorPerVertex.h"
#include "Utils/cgognStream.h"
#include "Algo/Render/SVG/mapSVGRender.h"
using
namespace
CGoGN
;
...
...
@@ -68,24 +69,29 @@ void MyQT::balls_onoff(bool x)
{
render_balls
=
!
render_balls
;
updateGL
();
CGoGNerr
<<
" balls_onoff "
<<
CGoGNendl
;
}
void
MyQT
::
vectors_onoff
(
bool
x
)
{
render_vectors
=
!
render_vectors
;
updateGL
();
CGoGNerr
<<
" vectors_onoff "
<<
CGoGNflush
;
}
void
MyQT
::
text_onoff
(
bool
x
)
{
render_text
=
!
render_text
;
updateGL
();
CGoGNerr
<<
" text_onoff "
<<
CGoGNflush
;
}
void
MyQT
::
topo_onoff
(
bool
x
)
{
render_topo
=
!
render_topo
;
updateGL
();
CGoGNerr
<<
" topo_onoff "
<<
CGoGNflush
;
}
void
MyQT
::
slider_balls
(
int
x
)
...
...
@@ -106,6 +112,16 @@ void MyQT::slider_text(int x)
updateGL
();
}
void
MyQT
::
animate
()
{
// transfoMatrix() = glm::rotate(transfoMatrix(), 0.5f, glm::vec3(0.5773f,0.5773f,0.5773f));
transfoRotate
(
0.5
f
,
0.5773
f
,
0.5773
f
,
0.5773
f
);
updateGLMatrices
();
}
void
MyQT
::
storeVerticesInfo
()
{
...
...
@@ -177,6 +193,11 @@ void MyQT::cb_initGL()
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
POINTS
);
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
allDarts
,
position
,
0.9
,
0.9
,
0.9
);
// timer example for animation
m_timer
=
new
QTimer
(
m_glWidget
);
connect
(
m_timer
,
SIGNAL
(
timeout
()),
SLOT
(
animate
())
);
}
void
MyQT
::
cb_redraw
()
...
...
@@ -224,13 +245,9 @@ void MyQT::cb_mousePress(int button, int x, int y)
{
if
(
Shift
())
{
Dart
d
=
m_render_topo
->
picking
<
PFP
>
(
myMap
,
allDarts
,
x
,
getHeight
()
-
y
);
Dart
d
=
m_render_topo
->
picking
<
PFP
>
(
myMap
,
allDarts
,
x
,
y
);
if
(
d
!=
Dart
::
nil
())
{
// std::stringstream ss;
// ss << "Dart "<< d << " clicked"<< CGoGNendl;
// statusMsg(ss.str().c_str());
CGoGNout
<<
"Dart "
<<
d
<<
" clicked"
<<
CGoGNendl
;
}
else
...
...
@@ -240,6 +257,29 @@ void MyQT::cb_mousePress(int button, int x, int y)
}
}
void
MyQT
::
cb_keyPress
(
int
code
)
{
if
(
code
==
's'
)
{
std
::
string
filename
=
selectFileSave
(
"Export SVG file "
);
CGoGNout
<<
"Exporting "
<<
filename
<<
CGoGNendl
;
Algo
::
Render
::
SVG
::
SVGOut
svg
(
filename
,
modelViewMatrix
(),
projectionMatrix
());
// svg.renderLinesToSVG<PFP>(myMap,position);
svg
.
setColor
(
Geom
::
Vec3f
(
1.
,
0.
,
0.
));
svg
.
renderFacesToSVG
<
PFP
>
(
myMap
,
position
,
0.8
f
);
//svg destruction close the file
}
if
(
code
==
't'
)
{
if
(
m_timer
->
isActive
())
m_timer
->
stop
();
else
m_timer
->
start
(
1000
/
30
);
// 30 fps
}
}
int
main
(
int
argc
,
char
**
argv
)
{
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
"position"
);
...
...
@@ -305,7 +345,9 @@ int main(int argc, char **argv)
CGoGNdbg2
.
toConsole
(
&
sqt
);
CGoGNerr
.
toConsole
(
&
sqt
);
CGoGNdbg2
<<
" TextureSize "
<<
texSize
<<
CGoGNendl
;
CGoGNerr
<<
" ERROR "
<<
5
*
7
<<
CGoGNendl
;
CGoGNerr
<<
" test ERROR "
<<
5
*
7
<<
CGoGNflush
;
// et on attend la fin.
return
app
.
exec
();
...
...
Apps/Tuto/tuto5.h
View file @
4bc17c66
...
...
@@ -72,6 +72,8 @@ class MyQT: public Utils::QT::SimpleQT
Utils
::
Strings3D
*
m_strings
;
Utils
::
PointSprite
*
m_sprite
;
QTimer
*
m_timer
;
public:
MyQT
()
:
render_text
(
true
),
...
...
@@ -85,7 +87,8 @@ public:
m_shader
(
NULL
),
m_lines
(
NULL
),
m_strings
(
NULL
),
m_sprite
(
NULL
)
m_sprite
(
NULL
),
m_timer
(
NULL
)
{}
protected:
...
...
@@ -97,8 +100,7 @@ protected:
void
cb_mousePress
(
int
button
,
int
x
,
int
y
);
void
cb_keyPress
(
int
code
)
{}
void
cb_keyPress
(
int
code
);
// slots locaux
public
slots
:
...
...
@@ -110,6 +112,8 @@ public slots:
void
slider_balls
(
int
x
);
void
slider_vectors
(
int
x
);
void
slider_text
(
int
x
);
void
animate
();
};
#endif
Apps/Tuto/tuto_mt.cpp
View file @
4bc17c66
...
...
@@ -379,7 +379,7 @@ int main(int argc, char **argv)
{
using
namespace
CGoGN
::
Utils
::
QT
;
inputValues
(
VarInt
(
0
,
20
,
xx
,
"Entier"
,
inputValues
(
VarInt
eger
(
0
,
20
,
xx
,
"Entier"
,
VarBool
(
zz
,
"Bool"
,
VarDbl
(
0.314
,
3.14
,
yy
,
"Double"
,
VarSlider
(
10
,
100
,
kk
,
"Slider"
,
...
...
Apps/Tuto/tuto_ogl3.cpp
View file @
4bc17c66
...
...
@@ -108,8 +108,6 @@ void MyQT::cb_initGL()
shader1
->
setAttributePosition
(
positionVBO
);
shader1
->
setAttributeNormal
(
normalVBO
);
registerShader
(
shader1
);
currentShader
=
shader1
;
}
...
...
README.TXT
View file @
4bc17c66
Dépendences Linux:
installer les paquets suivants:
cmake libXi-dev libXmu-dev freeglut3-dev libdevil-dev libglew-dev libgmp3-dev libxml2-dev libboost-dev lizip-dev libqt4-help qt4-designer qt4-dev-tools
<<<<<<< HEAD
cmake libXi-dev libXmu-dev freeglut3-dev libdevil-dev libglew-dev libgmp3-dev libxml2-dev libboost-dev libzip-dev libqt4-help qt4-designer qt4-dev-tools
=======
cmake libXi-dev libXmu-dev freeglut3-dev libdevil-dev libglew-dev libgmp3-dev libxml2-dev libboost-dev lizip-dev libqt4-dev qt4-designer qt4-dev-tools
>>>>>>> 84fe346d20a65b08cb049bffc98c793c70f687f2
Pour compiler CGoGN:
...
...
README_VISUAL.TXT
View file @
4bc17c66
...
...
@@ -10,13 +10,18 @@ Cliquer sur Configure
Choisir le bon compilateur (celui de votre version de Visual C++)
Recliquer sur Configure
Cliquer sur Generate
Unziper le
dependencies.zip (http://iggservis.u-strasbg.fr/Data/dependencies.zip) dans le repertoire Visual
Unziper le
windows_dependencies.zip (http://iggservis.u-strasbg.fr/Data/) a la racine de CGoGN
Aller dans Visual et double-cliquer sur CGoGN.sln !!
Pour que les executables fonctionnent ajouter
....\Visual\dependencies\
dll dans la variable d'environnement path
Pour que les executables fonctionnent ajouter
le chemin vers les
dll dans la variable d'environnement path
(ou copier les dll dans un répertoire déjà dans le path)
Remarque: uniquement compilation 32bits testée pour le moment.
Remarque pour l'utilisation de boost (manière simple):
-installer les binaires a l'aide de boostpro (www.boostpro.com)
-definir la varible d'env "boost_extension" avec ce que vous voulez utiliser (exemple: -vc100-mt-1_44)
-definir la varible d'env "boost_path" avec le chemin d'acces (exemple: C:\Program Files\boost\boost_1_44\)
-ajouter le chemin vers les dll dans le path (comme cf ci-dessus)
...
...
ThirdParty/CMakeLists.txt
View file @
4bc17c66
...
...
@@ -8,6 +8,7 @@ SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
find_package
(
OpenGL
)
find_package
(
GLUT
)
IF
(
APPLE
)
SET
(
CMAKE_OSX_ARCHITECTURES x86_64
)
ENDIF
(
APPLE
)
...
...
@@ -19,10 +20,10 @@ IF(WIN32)
add_subdirectory
(
gzstream/Build
)
add_subdirectory
(
Numerical
)
add_subdirectory
(
Assimp/code
)
if
(
CMAKE_CONFIGURATION_TYPES
)
set
(
CMAKE_CONFIGURATION_TYPES Release
)
set
(
CMAKE_CONFIGURATION_TYPES
"
${
CMAKE_CONFIGURATION_TYPES
}
"
CACHE STRING
"Use only Release configuration for ThirdParty"
FORCE
)
endif
()
#
if(CMAKE_CONFIGURATION_TYPES)
#
set(CMAKE_CONFIGURATION_TYPES Release)
#
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Use only Release configuration for ThirdParty" FORCE)
#
endif()
ELSE
(
WIN32
)
SET
(
LIBRARY_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/lib/Release
)
add_custom_target
(
FakeTargetOpenCTM ALL
"make"
...
...
ThirdParty/gzstream/gzstream.h
View file @
4bc17c66
...
...
@@ -36,10 +36,10 @@
#include <stdio.h>
#include <limits>
#include <cmath>
#ifndef PI_DEFINED
#define PI_DEFINED
const
double
M_PI
=
3.14159265359
;
#endif
//
#ifndef PI_DEFINED
//
#define PI_DEFINED
//
double M_PI = 3.14159265359;
//
#endif
#endif
...
...
build/CMakeLists.txt
View file @
4bc17c66
...
...
@@ -9,7 +9,8 @@ SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
SET
(
CMAKE_MODULE_PATH
"
${
CMAKE_MODULE_PATH
}
${
CGoGN_ROOT_DIR
}
/cmake_modules/"
)
find_package
(
OpenGL
)
find_package
(
OpenGL REQUIRED
)
find_package
(
Qt4 REQUIRED
)
find_package
(
GLUT
)
# qq definition specifiques pour mac
...
...
@@ -26,9 +27,19 @@ IF(WIN32)
SET
(
DEVIL_LIBRARIES DevIL ILU ILUT
)
SET
(
ZLIB_LIBRARIES zlib
)
SET
(
LIBXML2_LIBRARIES xml2
)
MACRO
(
BOOST_LIBS lib_lists names
)
SET
(
${
lib_lists
}
""
)
FOREACH
(
name
${
names
}
)
STRING
(
REGEX REPLACE
"-mt"
$ENV{boost_extension} newname
${
name
}
)
SET
(
${
lib_lists
}
${${
lib_lists
}}
${
newname
}
)
ENDFOREACH
(
name
)
ENDMACRO
(
BOOST_LIBS
)
set
(
BOOST_INCLUDE_PATH $ENV{boost_path}
)
INCLUDE_DIRECTORIES
(
${
CGoGN_ROOT_DIR
}
/windows_dependencies/include/
)
LINK_DIRECTORIES
(
${
CGoGN_ROOT_DIR
}
/windows_dependencies/lib/
)
# add_subdirectory(${CGoGN_ROOT_DIR}/ThirdParty ThirdParty)
LINK_DIRECTORIES
(
${
CGoGN_ROOT_DIR
}
/windows_dependencies/lib/ $ENV{boost_path}/lib
)
add_subdirectory
(
Release
)
add_subdirectory
(
${
CGoGN_ROOT_DIR
}
/Apps Apps
)
if
(
EXISTS
"
${
CGoGN_ROOT_DIR
}
/Perso"
)
...
...
@@ -37,7 +48,7 @@ IF(WIN32)
if
(
CMAKE_CONFIGURATION_TYPES
)
set
(
CMAKE_CONFIGURATION_TYPES Release Debug
)
set
(
CMAKE_CONFIGURATION_TYPES
"
${
CMAKE_CONFIGURATION_TYPES
}
"
CACHE STRING
"
Use only Release configuration for ThirdParty
"
FORCE
)
set
(
CMAKE_CONFIGURATION_TYPES
"
${
CMAKE_CONFIGURATION_TYPES
}
"
CACHE STRING
"
Only Release or Debug
"
FORCE
)
endif
()
ELSE
(
WIN32
)
...
...
@@ -51,7 +62,14 @@ ELSE(WIN32)
ELSE
(
IL_LIBRARIES
)
SET
(
DEVIL_LIBRARIES
${
IL_LIBRARY
}
${
ILU_LIBRARY
}
${
ILUT_LIBRARY
}
)
ENDIF
(
IL_LIBRARIES
)
# add_subdirectory(${CGoGN_ROOT_DIR}/ThirdParty ThirdParty)
MACRO
(
BOOST_LIBS lib_lists names
)
SET
(
${
lib_lists
}
)
FOREACH
(
name
${
names
}
)
SET
(
${
lib_lists
}
${${
lib_lists
}}
${
name
}
)
ENDFOREACH
(
name
)
ENDMACRO
(
BOOST_LIBS
)
add_subdirectory
(
Release
)
add_subdirectory
(
Debug
)
add_subdirectory
(
${
CGoGN_ROOT_DIR
}
/Apps Apps
)
...
...
build/Debug/CMakeLists.txt
View file @
4bc17c66
...
...
@@ -2,15 +2,17 @@ cmake_minimum_required(VERSION 2.6)
project
(
CGoGNDebug
)
set
(
LIBRARY_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/lib/Debug
)
#SET(BUILD_SHARED_LIBS,FALSE)
SET
(
CMAKE_BUILD_TYPE Debug
)
IF
(
WIN32
)
SET
(
LIBRARY_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/lib
)
ELSE
(
WIN32
)
SET
(
LIBRARY_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/lib/Debug
)
ENDIF
(
WIN32
)
#SET(BUILD_SHARED_LIBS,FALSE)
# FOR Qt4
FIND_PACKAGE
(
Qt4 REQUIRED
)
SET
(
QT_USE_QTOPENGL TRUE
)
INCLUDE
(
${
QT_USE_FILE
}
)
ADD_DEFINITIONS
(
${
QT_DEFINITIONS
}
)
...
...
build/Release/CMakeLists.txt
View file @
4bc17c66
...
...
@@ -2,15 +2,19 @@ cmake_minimum_required(VERSION 2.6)
project
(
CGoGNRelease
)
set
(
LIBRARY_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/lib/
Release
)
SET
(
CMAKE_BUILD_TYPE
Release
)
IF
(
WIN32
)
SET
(
LIBRARY_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/lib
)
ELSE
(
WIN32
)
SET
(
LIBRARY_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/lib/Release
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DNOTOPOWARNING"
)
ENDIF
(
WIN32
)
#SET(BUILD_SHARED_LIBS,FALSE)
SET
(
CMAKE_BUILD_TYPE Release
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DNOTOPOWARNING"
)
# FOR Qt4
FIND_PACKAGE
(
Qt4 REQUIRED
)
SET
(
QT_USE_QTOPENGL TRUE
)
INCLUDE
(
${
QT_USE_FILE
}
)
ADD_DEFINITIONS
(
${
QT_DEFINITIONS
}
)
...
...
include/Algo/Export/export.hpp
View file @
4bc17c66
...
...
@@ -247,6 +247,154 @@ bool exportCTM(typename PFP::MAP& the_map, const typename PFP::TVEC3& position,
return
true
;
}
template
<
typename
PFP
>
bool
exportPLYPTM
(
typename
PFP
::
MAP
&
map
,
const
char
*
filename
,
const
typename
PFP
::
TVEC3
&
position
,
const
typename
PFP
::
TVEC3
frame
[
3
],
const
typename
PFP
::
TVEC3
colorPTM
[
15
],
const
FunctorSelect
&
good
)
{
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
VEC3
VEC3
;
std
::
ofstream
out
(
filename
,
std
::
ios
::
out
)
;
if
(
!
out
.
good
())
{
std
::
cerr
<<
"Unable to open file "
<<
std
::
endl
;
return
false
;
}
AutoAttributeHandler
<
unsigned
int
>
tableVertLab
(
map
,
VERTEX_ORBIT
);
CellMarker
markV
(
map
,
VERTEX_CELL
);
unsigned
int
nbDarts
=
map
.
getNbDarts
()
;
std
::
vector
<
unsigned
int
>
vertices
;
std
::
vector
<
unsigned
int
>
faces
;
vertices
.
reserve
(
nbDarts
/
5
);
// TODO non optimal reservation
faces
.
reserve
(
nbDarts
/
3
);
DartMarker
markF
(
map
);
unsigned
int
lab
=
0
;
unsigned
int
nbf
=
0
;
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
{
if
(
good
(
d
)
&&
!
markF
.
isMarked
(
d
))
{
markF
.
markOrbit
(
FACE_ORBIT
,
d
)
;
Dart
e
=
d
;
std
::
vector
<
unsigned
int
>
face
;
do
{
if
(
!
markV
.
isMarked
(
e
))
{
vertices
.
push_back
(
map
.
getEmbedding
(
e
,
VERTEX_ORBIT
));
tableVertLab
[
e
]
=
lab
++
;
markV
.
mark
(
e
);
}
face
.
push_back
(
tableVertLab
[
e
]);
e
=
map
.
phi1
(
e
);
}
while
(
e
!=
d
)
;
faces
.
push_back
(
face
.
size
())
;
for
(
unsigned
int
i
=
0
;
i
<
face
.
size
()
;
++
i
)
faces
.
push_back
(
face
.
at
(
i
))
;
++
nbf
;
}
}
out
<<
"ply"
<<
std
::
endl
;
out
<<
"format ascii 1.0"
<<
std
::
endl
;
out
<<
"comment ply PTM"
<<
std
::
endl
;
out
<<
"element vertex "
<<
vertices
.
size
()
<<
std
::
endl
;
out
<<
"property float x"
<<
std
::
endl
;
out
<<
"property float y"
<<
std
::
endl
;
out
<<
"property float z"
<<
std
::
endl
;
out
<<
"property float tx"
<<
std
::
endl
;
out
<<
"property float ty"
<<
std
::
endl
;
out
<<
"property float tz"
<<
std
::
endl
;
out
<<
"property float bx"
<<
std
::
endl
;
out
<<
"property float by"
<<
std
::
endl
;
out
<<
"property float bz"
<<
std
::
endl
;
out
<<
"property float nx"
<<
std
::
endl
;
out
<<
"property float ny"
<<
std
::
endl
;
out
<<
"property float nz"
<<
std
::
endl
;
out
<<
"property float L1_a0"
<<
std
::
endl
;
out
<<
"property float L1_a1"
<<
std
::
endl
;
out
<<
"property float L1_a2"
<<
std
::
endl
;
out
<<
"property float L1_a3"
<<
std
::
endl
;
out
<<
"property float L1_a4"
<<
std
::
endl
;
out
<<
"property float L1_a5"
<<
std
::
endl
;
out
<<
"property float L1_a6"
<<
std
::
endl
;
out
<<
"property float L1_a7"
<<
std
::
endl
;
out
<<
"property float L1_a8"
<<
std
::
endl
;
out
<<
"property float L1_a9"
<<
std
::
endl
;
out
<<
"property float L1_a10"
<<
std
::
endl
;
out
<<
"property float L1_a11"
<<
std
::
endl
;
out
<<
"property float L1_a12"
<<
std
::
endl
;
out
<<
"property float L1_a13"
<<
std
::
endl
;
out
<<
"property float L1_a14"
<<
std
::
endl
;
out
<<
"property float L2_a0"
<<
std
::
endl
;
out
<<
"property float L2_a1"
<<
std
::
endl
;
out
<<
"property float L2_a2"
<<
std
::
endl
;
out
<<
"property float L2_a3"
<<
std
::
endl
;
out
<<
"property float L2_a4"
<<
std
::
endl
;
out
<<
"property float L2_a5"
<<
std
::
endl
;
out
<<
"property float L2_a6"
<<
std
::
endl
;
out
<<
"property float L2_a7"
<<
std
::
endl
;
out
<<
"property float L2_a8"
<<
std
::
endl
;
out
<<
"property float L2_a9"
<<
std
::
endl
;
out
<<
"property float L2_a10"
<<
std
::
endl
;
out
<<
"property float L2_a11"
<<
std
::
endl
;
out
<<
"property float L2_a12"
<<
std
::
endl
;
out
<<
"property float L2_a13"
<<
std
::
endl
;
out
<<
"property float L2_a14"
<<
std
::
endl
;