Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
KennethVanhoey
CGoGN
Commits
51b5ef93
Commit
51b5ef93
authored
May 06, 2011
by
Thomas
Browse files
correction intersection bis
parents
b5395a85
84fe346d
Changes
47
Hide whitespace changes
Inline
Side-by-side
Apps/CMakeLists.txt
View file @
51b5ef93
...
...
@@ -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
)
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 @
51b5ef93
...
...
@@ -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 @
51b5ef93
...
...
@@ -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
...
...
@@ -28,9 +24,14 @@ include_directories(
${
CGoGN_ROOT_DIR
}
/include
)
# 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
...
...
Apps/Tuto/tuto1.cpp
View file @
51b5ef93
...
...
@@ -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/tuto2.h
View file @
51b5ef93
...
...
@@ -47,7 +47,6 @@ using namespace CGoGN ;
* Ajouter les widgets necessaires, mettre des noms clairs pour
* les utiliser dans le .cpp (pour les call back principalement)
*/
class
MyQT
:
public
Utils
::
QT
::
SimpleQT
{
Q_OBJECT
...
...
Apps/Tuto/tuto5.cpp
View file @
51b5ef93
...
...
@@ -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
)
...
...
@@ -227,10 +233,6 @@ void MyQT::cb_mousePress(int button, int x, int y)
Dart
d
=
m_render_topo
->
picking
<
PFP
>
(
myMap
,
allDarts
,
x
,
getHeight
()
-
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 +242,21 @@ 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
}
}
int
main
(
int
argc
,
char
**
argv
)
{
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
"position"
);
...
...
@@ -305,7 +322,8 @@ int main(int argc, char **argv)
CGoGNdbg2
.
toConsole
(
&
sqt
);
CGoGNerr
.
toConsole
(
&
sqt
);
CGoGNdbg2
<<
" TextureSize "
<<
texSize
<<
CGoGNendl
;
CGoGNerr
<<
" ERROR "
<<
5
*
7
<<
CGoGNendl
;
CGoGNerr
<<
" ERROR "
<<
5
*
7
<<
CGoGNflush
;
// et on attend la fin.
return
app
.
exec
();
...
...
Apps/Tuto/tuto5.h
View file @
51b5ef93
...
...
@@ -97,8 +97,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
:
...
...
Apps/Tuto/tuto_mt.cpp
View file @
51b5ef93
...
...
@@ -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"
,
...
...
README.TXT
View file @
51b5ef93
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
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
Pour compiler CGoGN:
...
...
ThirdParty/CMakeLists.txt
View file @
51b5ef93
...
...
@@ -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 @
51b5ef93
...
...
@@ -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 @
51b5ef93
...
...
@@ -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
...
...
@@ -28,7 +29,6 @@ IF(WIN32)
SET
(
LIBXML2_LIBRARIES xml2
)
INCLUDE_DIRECTORIES
(
${
CGoGN_ROOT_DIR
}
/windows_dependencies/include/
)
LINK_DIRECTORIES
(
${
CGoGN_ROOT_DIR
}
/windows_dependencies/lib/
)
# add_subdirectory(${CGoGN_ROOT_DIR}/ThirdParty ThirdParty)
add_subdirectory
(
Release
)
add_subdirectory
(
${
CGoGN_ROOT_DIR
}
/Apps Apps
)
if
(
EXISTS
"
${
CGoGN_ROOT_DIR
}
/Perso"
)
...
...
@@ -37,7 +37,7 @@ IF(WIN32)
if
(
CMAKE_CONFIGURATION_TYPES
)
set
(
CMAKE_CONFIGURATION_TYPES Release Debug
)
set
(
CMAKE_CONFIGURATION_TYPES
"
${
CMAKE_CONFIGURATION_TYPES
}
"
CACHE STRING
"
Use o
nly Release
configuration for ThirdParty
"
FORCE
)
set
(
CMAKE_CONFIGURATION_TYPES
"
${
CMAKE_CONFIGURATION_TYPES
}
"
CACHE STRING
"
O
nly Release
or Debug
"
FORCE
)
endif
()
ELSE
(
WIN32
)
...
...
@@ -51,7 +51,7 @@ ELSE(WIN32)
ELSE
(
IL_LIBRARIES
)
SET
(
DEVIL_LIBRARIES
${
IL_LIBRARY
}
${
ILU_LIBRARY
}
${
ILUT_LIBRARY
}
)
ENDIF
(
IL_LIBRARIES
)
# add_subdirectory(${CGoGN_ROOT_DIR}/ThirdParty ThirdParty)
add_subdirectory
(
Release
)
add_subdirectory
(
Debug
)
add_subdirectory
(
${
CGoGN_ROOT_DIR
}
/Apps Apps
)
...
...
build/Debug/CMakeLists.txt
View file @
51b5ef93
...
...
@@ -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 @
51b5ef93
...
...
@@ -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/Decimation/decimation.hpp
View file @
51b5ef93
...
...
@@ -149,7 +149,7 @@ void decimate(
while
(
!
finished
)
{
CGoGNout
<<
"Countdown : "
;
CGoGNout
<<
std
::
setprecision
(
8
)
<<
(
nbVertices
-
nbWantedVertices
)
<<
"
\r
"
<<
std
::
flush
;
CGoGNout
<<
std
::
setprecision
(
8
)
<<
(
nbVertices
-
nbWantedVertices
)
<<
"
\r
"
<<
/* flush */
CGoGNendl
;
if
(
!
selector
->
nextEdge
(
d
))
{
CGoGNout
<<
CGoGNendl
<<
"out"
<<
CGoGNendl
;
...
...
include/Algo/Export/export.hpp
View file @
51b5ef93
...
...
@@ -86,28 +86,28 @@ bool exportPLY(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons
}
}
out
<<
"ply"
<<
CGoGN
endl
;
out
<<
"format ascii 1.0"
<<
CGoGN
endl
;
out
<<
"comment no comment"
<<
CGoGN
endl
;
out
<<
"element vertex "
<<
vertices
.
size
()
<<
CGoGN
endl
;
out
<<
"property float x"
<<
CGoGN
endl
;
out
<<
"property float y"
<<
CGoGN
endl
;
out
<<
"property float z"
<<
CGoGN
endl
;
out
<<
"element face "
<<
facesSize
.
size
()
<<
CGoGN
endl
;
out
<<
"property list uchar int vertex_indices"
<<
CGoGN
endl
;
out
<<
"end_header"
<<
CGoGN
endl
;
out
<<
"ply"
<<
std
::
endl
;
out
<<
"format ascii 1.0"
<<
std
::
endl
;
out
<<
"comment no comment"
<<
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
<<
"element face "
<<
facesSize
.
size
()
<<
std
::
endl
;
out
<<
"property list uchar int vertex_indices"
<<
std
::
endl
;
out
<<
"end_header"
<<
std
::
endl
;
for
(
unsigned
int
i
=
0
;
i
<
vertices
.
size
();
++
i
)
{
const
VEC3
&
v
=
position
[
vertices
[
i
]]
;
out
<<
v
[
0
]
<<
" "
<<
v
[
1
]
<<
" "
<<
v
[
2
]
<<
CGoGN
endl
;
out
<<
v
[
0
]
<<
" "
<<
v
[
1
]
<<
" "
<<
v
[
2
]
<<
std
::
endl
;
}
for
(
unsigned
int
i
=
0
;
i
<
facesSize
.
size
();
++
i
)
{
out
<<
facesSize
[
i
]
;
for
(
unsigned
int
j
=
0
;
j
<
facesIdx
[
i
].
size
();
++
j
)
out
<<
" "
<<
facesIdx
[
i
][
j
]
;
out
<<
CGoGN
endl
;
out
<<
std
::
endl
;
}
out
.
close
()
;
...
...
@@ -164,20 +164,20 @@ bool exportOFF(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons
}
}
out
<<
"OFF"
<<
CGoGN
endl
;
out
<<
vertices
.
size
()
<<
" "
<<
facesSize
.
size
()
<<
" "
<<
0
<<
CGoGN
endl
;
out
<<
"OFF"
<<
std
::
endl
;
out
<<
vertices
.
size
()
<<
" "
<<
facesSize
.
size
()
<<
" "
<<
0
<<
std
::
endl
;
for
(
unsigned
int
i
=
0
;
i
<
vertices
.
size
();
++
i
)
{
const
VEC3
&
v
=
position
[
vertices
[
i
]]
;
out
<<
v
[
0
]
<<
" "
<<
v
[
1
]
<<
" "
<<
v
[
2
]
<<
CGoGN
endl
;
out
<<
v
[
0
]
<<
" "
<<
v
[
1
]
<<
" "
<<
v
[
2
]
<<
std
::
endl
;
}
for
(
unsigned
int
i
=
0
;
i
<
facesSize
.
size
();
++
i
)
{
out
<<
facesSize
[
i
]
;
for
(
unsigned
int
j
=
0
;
j
<
facesIdx
[
i
].
size
();
++
j
)
out
<<
" "
<<
facesIdx
[
i
][
j
]
;
out
<<
CGoGN
endl
;
out
<<
std
::
endl
;
}
out
.
close
()
;
...
...
@@ -219,7 +219,6 @@ bool exportCTM(typename PFP::MAP& the_map, const typename PFP::TVEC3& position,
verticesBuffer
.
push_back
(
vert
[
0
]);
verticesBuffer
.
push_back
(
vert
[
1
]);
verticesBuffer
.
push_back
(
vert
[
2
]);
// CGoGNout << vert<< CGoGNendl;
}
indicesBuffer
.
push_back
(
tableVertLab
[
e
]);
e
=
the_map
.
phi1
(
e
);
...
...
@@ -227,13 +226,6 @@ bool exportCTM(typename PFP::MAP& the_map, const typename PFP::TVEC3& position,
}
}
// for (int i=0; i< indicesBuffer.size(); ++i)
// {
// CGoGNout << indicesBuffer[i]<<", "<< CGoGNendl;
// if (i%3==0)
// CGoGNout << CGoGNendl;
// }
// Save the file using the OpenCTM API
CTMexporter
ctm
;
...
...
@@ -311,43 +303,43 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P
}
}
out
<<
"ply"
<<
CGoGN
endl
;
out
<<
"format ascii 1.0"
<<
CGoGN
endl
;
out
<<
"comment ply PTM (F. Larue format)"
<<
CGoGN
endl
;
out
<<
"element vertex "
<<
vertices
.
size
()
<<
CGoGN
endl
;
out
<<
"property float x"
<<
CGoGN
endl
;
out
<<
"property float y"
<<
CGoGN
endl
;
out
<<
"property float z"
<<
CGoGN
endl
;
out
<<
"property float tx"
<<
CGoGN
endl
;
out
<<
"property float ty"
<<
CGoGN
endl
;
out
<<
"property float tz"
<<
CGoGN
endl
;
out
<<
"property float bx"
<<
CGoGN
endl
;
out
<<
"property float by"
<<
CGoGN
endl
;
out
<<
"property float bz"
<<
CGoGN
endl
;
out
<<
"property float nx"
<<
CGoGN
endl
;
out
<<
"property float ny"
<<
CGoGN
endl
;
out
<<
"property float nz"
<<
CGoGN
endl
;
out
<<
"property float L1_a"
<<
CGoGN
endl
;
out
<<
"property float L1_b"
<<
CGoGN
endl
;
out
<<
"property float L1_c"
<<
CGoGN
endl
;
out
<<
"property float L1_d"
<<
CGoGN
endl
;
out
<<
"property float L1_e"
<<
CGoGN
endl
;
out
<<
"property float L1_f"
<<
CGoGN
endl
;
out
<<
"property float L2_a"
<<
CGoGN
endl
;
out
<<
"property float L2_b"
<<
CGoGN
endl
;
out
<<
"property float L2_c"
<<
CGoGN
endl
;
out
<<
"property float L2_d"
<<
CGoGN
endl
;
out
<<
"property float L2_e"
<<
CGoGN
endl
;
out
<<
"property float L2_f"
<<
CGoGN
endl
;
out
<<
"property float L3_a"
<<
CGoGN
endl
;
out
<<
"property float L3_b"
<<
CGoGN
endl
;
out
<<
"property float L3_c"
<<
CGoGN
endl
;
out
<<
"property float L3_d"
<<
CGoGN
endl
;
out
<<
"property float L3_e"
<<
CGoGN
endl
;
out
<<
"property float L3_f"
<<
CGoGN
endl
;
out
<<
"element face "
<<
nbf
<<
CGoGN
endl
;
out
<<
"property list uchar int vertex_indices"
<<
CGoGN
endl
;
out
<<
"end_header"
<<
CGoGN
endl
;
out
<<
"ply"
<<
std
::
endl
;
out
<<
"format ascii 1.0"
<<
std
::
endl
;
out
<<
"comment ply PTM (F. Larue format)"
<<
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_a"
<<
std
::
endl
;
out
<<
"property float L1_b"
<<
std
::
endl
;
out
<<
"property float L1_c"
<<
std
::
endl
;
out
<<
"property float L1_d"
<<
std
::
endl
;
out
<<
"property float L1_e"
<<
std
::
endl
;
out
<<
"property float L1_f"
<<
std
::
endl
;
out
<<
"property float L2_a"
<<
std
::
endl
;
out
<<
"property float L2_b"
<<
std
::
endl
;
out
<<
"property float L2_c"
<<
std
::
endl
;
out
<<
"property float L2_d"
<<
std
::
endl
;
out
<<
"property float L2_e"
<<
std
::
endl
;
out
<<
"property float L2_f"
<<
std
::
endl
;
out
<<
"property float L3_a"
<<
std
::
endl
;
out
<<
"property float L3_b"
<<
std
::
endl
;
out
<<
"property float L3_c"
<<
std
::
endl
;
out
<<
"property float L3_d"
<<
std
::
endl
;
out
<<
"property float L3_e"
<<
std
::
endl
;
out
<<
"property float L3_f"
<<
std
::
endl
;
out
<<
"element face "
<<
nbf
<<
std
::
endl
;
out
<<
"property list uchar int vertex_indices"
<<
std
::
endl
;
out
<<
"end_header"
<<
std
::
endl
;
for
(
unsigned
int
i
=
0
;
i
<
vertices
.
size
();
++
i
)
{
...
...
@@ -358,7 +350,7 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P
out
<<
frame
[
2
][
vi
][
0
]
<<
" "
<<
frame
[
2
][
vi
][
1
]
<<
" "
<<
frame
[
2
][
vi
][
2
]
<<
" "
;
out
<<
colorPTM
[
0
][
vi
][
0
]
<<
" "
<<
colorPTM
[
1
][
vi
][
0
]
<<
" "
<<
colorPTM
[
2
][
vi
][
0
]
<<
" "
<<
colorPTM
[
3
][
vi
][
0
]
<<
" "
<<
colorPTM
[
4
][
vi
][
0
]
<<
" "
<<
colorPTM
[
5
][
vi
][
0
]
<<
" "
;
out
<<
colorPTM
[
0
][
vi
][
1
]
<<
" "
<<
colorPTM
[
1
][
vi
][
1
]
<<
" "
<<
colorPTM
[
2
][
vi
][
1
]
<<
" "
<<
colorPTM
[
3
][
vi
][
1
]
<<
" "
<<
colorPTM
[
4
][
vi
][
1
]
<<
" "
<<
colorPTM
[
5
][
vi
][
1
]
<<
" "
;
out
<<
colorPTM
[
0
][
vi
][
2
]
<<
" "
<<
colorPTM
[
1
][
vi
][
2
]
<<
" "
<<
colorPTM
[
2
][
vi
][
2
]
<<
" "
<<
colorPTM
[
3
][
vi
][
2
]
<<
" "
<<
colorPTM
[
4
][
vi
][
2
]
<<
" "
<<
colorPTM
[
5
][
vi
][
2
]
<<
CGoGN
endl
;
out
<<
colorPTM
[
0
][
vi
][
2
]
<<
" "
<<
colorPTM
[
1
][
vi
][
2
]
<<
" "
<<
colorPTM
[
2
][
vi
][
2
]
<<
" "
<<
colorPTM
[
3
][
vi
][
2
]
<<
" "
<<
colorPTM
[
4
][
vi
][
2
]
<<
" "
<<
colorPTM
[
5
][
vi
][
2
]
<<
std
::
endl
;
}
std
::
vector
<
unsigned
int
>::
iterator
it
=
faces
.
begin
();
...
...
@@ -368,7 +360,7 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P
out
<<
nbe
;
for
(
unsigned
int
j
=
0
;
j
<
nbe
;
++
j
)
out
<<
" "
<<
*
it
++
;
out
<<
CGoGN
endl
;
out
<<
std
::
endl
;
}
out
.
close
()
;
...
...
include/Algo/Export/exportPov.h
View file @
51b5ef93
...
...
@@ -16,33 +16,27 @@ namespace ExportPov
template
<
typename
PFP
>
void
exportTriangleWire
(
std
::
ofstream
&
out
,
typename
PFP
::
VEC3
&
p1
,
typename
PFP
::
VEC3
&
p2
,
typename
PFP
::
VEC3
&
p3
)
{
CGoGNout
<<
"cylinder {"
<<
CGoGNendl
;
CGoGNout
<<
"<"
<<
p1
[
0
]
<<
","
<<
p1
[
1
]
<<
","
<<
p1
[
2
]
<<
">, <"
<<
p2
[
0
]
<<
","
<<
p2
[
1
]
<<
","
<<
p2
[
2
]
<<
">, 0.5"
<<
CGoGNendl
;
CGoGNout
<<
"}"
<<
CGoGNendl
;
out
<<
"cylinder { <"
<<
p1
[
0
]
<<
","
<<
p1
[
2
]
<<
","
<<
p1
[
1
]
<<
">, <"
<<
p2
[
0
]
<<
","
<<
p2
[
2
]
<<
","
<<
p2
[
1
]
<<
">, 0.5 }"
<<
std
::
endl
;
CGoGNout
<<
"cylinder {"
<<
CGoGNendl
;
CGoGNout
<<
"<"
<<
p1
[
0
]
<<
","
<<
p1
[
1
]
<<
","
<<
p1
[
2
]
<<
">, <"
<<
p3
[
0
]
<<
","
<<
p3
[
1
]
<<
","
<<
p3
[
2
]
<<
">, 0.5"
<<
CGoGNendl
;
CGoGNout
<<
"}"
<<
CGoGNendl
;
out
<<
"cylinder { <"
<<
p1
[
0
]
<<
","
<<
p1
[
2
]
<<
","
<<
p1
[
1
]
<<
">, <"
<<
p3
[
0
]
<<
","
<<
p3
[
2
]
<<
","
<<
p3
[
1
]
<<
">, 0.5 }"
<<
std
::
endl
;
CGoGNout
<<
"cylinder {"
<<
CGoGNendl
;
CGoGNout
<<
"<"
<<
p3
[
0
]
<<
","
<<
p3
[
1
]
<<
","
<<
p3
[
2
]
<<
">, <"
<<
p2
[
0
]
<<
","
<<
p2
[
1
]
<<
","
<<
p2
[
2
]
<<
">, 0.5"
<<
CGoGNendl
;
CGoGNout
<<
"}"
<<
CGoGNendl
;
out
<<
"cylinder { <"
<<
p3
[
0
]
<<
","
<<
p3
[
2
]
<<
","
<<
p3
[
1
]
<<
">, <"
<<
p2
[
0
]
<<
","
<<
p2
[
2
]
<<
","
<<
p2
[
1
]
<<
">, 0.5 }"
<<
std
::
endl
;
}
template
<
typename
PFP
>
void
exportTrianglePlain
(
std
::
ofstream
&
out
,
typename
PFP
::
VEC3
&
p1
,
typename
PFP
::
VEC3
&
p2
,
typename
PFP
::
VEC3
&
p3
)
{
CGoGN
out
<<
"triangle {"
<<
CGoGN
endl
;
CGoGN
out
<<
"<"
<<
p1
[
0
]
<<
","
<<
p1
[
1
]
<<
","
<<
p1
[
2
]
<<
">,"
<<
CGoGN
endl
;
CGoGN
out
<<
"<"
<<
p2
[
0
]
<<
","
<<
p2
[
1
]
<<
","
<<
p2
[
2
]
<<
">, "
<<
CGoGN
endl
;
CGoGN
out
<<
"<"
<<
p3
[
0
]
<<
","
<<
p3
[
1
]
<<
","
<<
p3
[
2
]
<<
"> "
<<
CGoGN
endl
;
CGoGN
out
<<
"}"
<<
CGoGN
endl
;
out
<<
"triangle {"
<<
std
::
endl
;
out
<<
"<"
<<
p1
[
0
]
<<
","
<<
p1
[
2
]
<<
","
<<
p1
[
1
]
<<
">,"
<<
std
::
endl
;
out
<<
"<"
<<
p2
[
0
]
<<
","
<<
p2
[
2
]
<<
","
<<
p2
[
1
]
<<
">, "
<<
std
::
endl
;
out
<<
"<"
<<
p3
[
0
]
<<
","
<<
p3
[
2
]
<<
","
<<
p3
[
1
]
<<
"> "
<<
std
::
endl
;
out
<<
"}"
<<
std
::
endl
;
}
template
<
typename
PFP
>