Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Hurstel
CGoGN
Commits
2904fbf9
Commit
2904fbf9
authored
Feb 15, 2011
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'CGoGN_MT'
parents
8f014cc6
be1ee120
Changes
283
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
75 changed files
with
22035 additions
and
18 deletions
+22035
-18
Apps/Tuto/CMakeLists.txt
Apps/Tuto/CMakeLists.txt
+15
-1
Apps/Tuto/tp_master.cpp
Apps/Tuto/tp_master.cpp
+3
-4
Apps/Tuto/tuto_mt.cpp
Apps/Tuto/tuto_mt.cpp
+340
-0
README.TXT
README.TXT
+1
-1
ThirdParty/Assimp/code/CMakeLists.txt
ThirdParty/Assimp/code/CMakeLists.txt
+4
-4
ThirdParty/CMakeLists.txt
ThirdParty/CMakeLists.txt
+8
-1
ThirdParty/Numerical/CMakeLists.txt
ThirdParty/Numerical/CMakeLists.txt
+0
-1
ThirdParty/Numerical/C_BLAS_LAPACK/BLAS/SRC/CMakeLists.txt
ThirdParty/Numerical/C_BLAS_LAPACK/BLAS/SRC/CMakeLists.txt
+1
-1
ThirdParty/Numerical/C_BLAS_LAPACK/F2CLIBS/libf2c/CMakeLists.txt
...rty/Numerical/C_BLAS_LAPACK/F2CLIBS/libf2c/CMakeLists.txt
+3
-2
ThirdParty/Numerical/C_BLAS_LAPACK/SRC/CMakeLists.txt
ThirdParty/Numerical/C_BLAS_LAPACK/SRC/CMakeLists.txt
+0
-1
ThirdParty/Zinri/Build/CMakeLists.txt
ThirdParty/Zinri/Build/CMakeLists.txt
+0
-2
ThirdParty/glm/glm/core/_detail.hpp
ThirdParty/glm/glm/core/_detail.hpp
+323
-0
ThirdParty/glm/glm/core/_swizzle.hpp
ThirdParty/glm/glm/core/_swizzle.hpp
+1085
-0
ThirdParty/glm/glm/core/_swizzle.inl
ThirdParty/glm/glm/core/_swizzle.inl
+20
-0
ThirdParty/glm/glm/core/dummy.cpp
ThirdParty/glm/glm/core/dummy.cpp
+17
-0
ThirdParty/glm/glm/core/func_common.hpp
ThirdParty/glm/glm/core/func_common.hpp
+274
-0
ThirdParty/glm/glm/core/func_common.inl
ThirdParty/glm/glm/core/func_common.inl
+1542
-0
ThirdParty/glm/glm/core/func_exponential.hpp
ThirdParty/glm/glm/core/func_exponential.hpp
+71
-0
ThirdParty/glm/glm/core/func_exponential.inl
ThirdParty/glm/glm/core/func_exponential.inl
+358
-0
ThirdParty/glm/glm/core/func_geometric.hpp
ThirdParty/glm/glm/core/func_geometric.hpp
+92
-0
ThirdParty/glm/glm/core/func_geometric.inl
ThirdParty/glm/glm/core/func_geometric.inl
+290
-0
ThirdParty/glm/glm/core/func_integer.hpp
ThirdParty/glm/glm/core/func_integer.hpp
+142
-0
ThirdParty/glm/glm/core/func_integer.inl
ThirdParty/glm/glm/core/func_integer.inl
+600
-0
ThirdParty/glm/glm/core/func_matrix.hpp
ThirdParty/glm/glm/core/func_matrix.hpp
+92
-0
ThirdParty/glm/glm/core/func_matrix.inl
ThirdParty/glm/glm/core/func_matrix.inl
+559
-0
ThirdParty/glm/glm/core/func_noise.hpp
ThirdParty/glm/glm/core/func_noise.hpp
+53
-0
ThirdParty/glm/glm/core/func_noise.inl
ThirdParty/glm/glm/core/func_noise.inl
+305
-0
ThirdParty/glm/glm/core/func_packing.hpp
ThirdParty/glm/glm/core/func_packing.hpp
+45
-0
ThirdParty/glm/glm/core/func_packing.inl
ThirdParty/glm/glm/core/func_packing.inl
+94
-0
ThirdParty/glm/glm/core/func_trigonometric.hpp
ThirdParty/glm/glm/core/func_trigonometric.hpp
+125
-0
ThirdParty/glm/glm/core/func_trigonometric.inl
ThirdParty/glm/glm/core/func_trigonometric.inl
+745
-0
ThirdParty/glm/glm/core/func_vector_relational.hpp
ThirdParty/glm/glm/core/func_vector_relational.hpp
+189
-0
ThirdParty/glm/glm/core/func_vector_relational.inl
ThirdParty/glm/glm/core/func_vector_relational.inl
+20
-0
ThirdParty/glm/glm/core/hint.hpp
ThirdParty/glm/glm/core/hint.hpp
+21
-0
ThirdParty/glm/glm/core/type.hpp
ThirdParty/glm/glm/core/type.hpp
+283
-0
ThirdParty/glm/glm/core/type_float.hpp
ThirdParty/glm/glm/core/type_float.hpp
+72
-0
ThirdParty/glm/glm/core/type_gentype.hpp
ThirdParty/glm/glm/core/type_gentype.hpp
+150
-0
ThirdParty/glm/glm/core/type_gentype.inl
ThirdParty/glm/glm/core/type_gentype.inl
+347
-0
ThirdParty/glm/glm/core/type_half.hpp
ThirdParty/glm/glm/core/type_half.hpp
+85
-0
ThirdParty/glm/glm/core/type_half.inl
ThirdParty/glm/glm/core/type_half.inl
+357
-0
ThirdParty/glm/glm/core/type_int.hpp
ThirdParty/glm/glm/core/type_int.hpp
+130
-0
ThirdParty/glm/glm/core/type_mat.hpp
ThirdParty/glm/glm/core/type_mat.hpp
+56
-0
ThirdParty/glm/glm/core/type_mat.inl
ThirdParty/glm/glm/core/type_mat.inl
+0
-0
ThirdParty/glm/glm/core/type_mat2x2.hpp
ThirdParty/glm/glm/core/type_mat2x2.hpp
+245
-0
ThirdParty/glm/glm/core/type_mat2x2.inl
ThirdParty/glm/glm/core/type_mat2x2.inl
+610
-0
ThirdParty/glm/glm/core/type_mat2x3.hpp
ThirdParty/glm/glm/core/type_mat2x3.hpp
+212
-0
ThirdParty/glm/glm/core/type_mat2x3.inl
ThirdParty/glm/glm/core/type_mat2x3.inl
+541
-0
ThirdParty/glm/glm/core/type_mat2x4.hpp
ThirdParty/glm/glm/core/type_mat2x4.hpp
+212
-0
ThirdParty/glm/glm/core/type_mat2x4.inl
ThirdParty/glm/glm/core/type_mat2x4.inl
+569
-0
ThirdParty/glm/glm/core/type_mat3x2.hpp
ThirdParty/glm/glm/core/type_mat3x2.hpp
+214
-0
ThirdParty/glm/glm/core/type_mat3x2.inl
ThirdParty/glm/glm/core/type_mat3x2.inl
+575
-0
ThirdParty/glm/glm/core/type_mat3x3.hpp
ThirdParty/glm/glm/core/type_mat3x3.hpp
+244
-0
ThirdParty/glm/glm/core/type_mat3x3.inl
ThirdParty/glm/glm/core/type_mat3x3.inl
+704
-0
ThirdParty/glm/glm/core/type_mat3x4.hpp
ThirdParty/glm/glm/core/type_mat3x4.hpp
+214
-0
ThirdParty/glm/glm/core/type_mat3x4.inl
ThirdParty/glm/glm/core/type_mat3x4.inl
+609
-0
ThirdParty/glm/glm/core/type_mat4x2.hpp
ThirdParty/glm/glm/core/type_mat4x2.hpp
+216
-0
ThirdParty/glm/glm/core/type_mat4x2.inl
ThirdParty/glm/glm/core/type_mat4x2.inl
+618
-0
ThirdParty/glm/glm/core/type_mat4x3.hpp
ThirdParty/glm/glm/core/type_mat4x3.hpp
+216
-0
ThirdParty/glm/glm/core/type_mat4x3.inl
ThirdParty/glm/glm/core/type_mat4x3.inl
+623
-0
ThirdParty/glm/glm/core/type_mat4x4.hpp
ThirdParty/glm/glm/core/type_mat4x4.hpp
+244
-0
ThirdParty/glm/glm/core/type_mat4x4.inl
ThirdParty/glm/glm/core/type_mat4x4.inl
+759
-0
ThirdParty/glm/glm/core/type_size.hpp
ThirdParty/glm/glm/core/type_size.hpp
+24
-0
ThirdParty/glm/glm/core/type_vec.hpp
ThirdParty/glm/glm/core/type_vec.hpp
+22
-0
ThirdParty/glm/glm/core/type_vec.inl
ThirdParty/glm/glm/core/type_vec.inl
+0
-0
ThirdParty/glm/glm/core/type_vec1.hpp
ThirdParty/glm/glm/core/type_vec1.hpp
+172
-0
ThirdParty/glm/glm/core/type_vec1.inl
ThirdParty/glm/glm/core/type_vec1.inl
+879
-0
ThirdParty/glm/glm/core/type_vec2.hpp
ThirdParty/glm/glm/core/type_vec2.hpp
+250
-0
ThirdParty/glm/glm/core/type_vec2.inl
ThirdParty/glm/glm/core/type_vec2.inl
+1005
-0
ThirdParty/glm/glm/core/type_vec3.hpp
ThirdParty/glm/glm/core/type_vec3.hpp
+256
-0
ThirdParty/glm/glm/core/type_vec3.inl
ThirdParty/glm/glm/core/type_vec3.inl
+1092
-0
ThirdParty/glm/glm/core/type_vec4.hpp
ThirdParty/glm/glm/core/type_vec4.hpp
+276
-0
ThirdParty/glm/glm/core/type_vec4.inl
ThirdParty/glm/glm/core/type_vec4.inl
+1221
-0
ThirdParty/glm/glm/ext.hpp
ThirdParty/glm/glm/ext.hpp
+94
-0
ThirdParty/glm/glm/glm.hpp
ThirdParty/glm/glm/glm.hpp
+137
-0
ThirdParty/glm/glm/gtc/double_float.hpp
ThirdParty/glm/glm/gtc/double_float.hpp
+65
-0
No files found.
Apps/Tuto/CMakeLists.txt
View file @
2904fbf9
...
...
@@ -4,7 +4,9 @@ project(Tutos)
#SET (COMMON_LIBS ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ${GLEW_LIBRARY} ${DEVIL_LIBRARIES} ${ZLIB_LIBRARIES} ${LIBXML2_LIBRARIES} gzstream AntTweakBar openctm)
SET
(
CMAKE_BUILD_TYPE Release
)
SET
(
CMAKE_BUILD_TYPE Debug
)
#SET(CMAKE_BUILD_TYPE Release)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DNOTOPOWARNING"
)
...
...
@@ -14,6 +16,7 @@ include_directories(
${
CGoGN_ROOT_DIR
}
/ThirdParty/gzstream
${
CGoGN_ROOT_DIR
}
/ThirdParty/OpenCTM
${
CGoGN_ROOT_DIR
}
/ThirdParty/Assimp/include
${
CGoGN_ROOT_DIR
}
/ThirdParty/glm
${
CGoGN_ROOT_DIR
}
/include
)
...
...
@@ -49,3 +52,14 @@ target_link_libraries( tuto_subdivision
add_executable
(
tp_master tp_master.cpp
)
target_link_libraries
(
tp_master
container topology utils algo
${
COMMON_LIBS
}
)
add_executable
(
tuto_mt tuto_mt.cpp
)
target_link_libraries
(
tuto_mt
containerD topologyD utilsD algoD
${
COMMON_LIBS
}
boost_thread
)
# container topology utils algo ${COMMON_LIBS} boost_thread)
add_executable
(
tuto_ogl3 tuto_ogl3.cpp
)
target_link_libraries
(
tuto_ogl3
containerD topologyD utilsD algoD
${
COMMON_LIBS
}
)
# container topology utils algo ${COMMON_LIBS} )
Apps/Tuto/tp_master.cpp
View file @
2904fbf9
...
...
@@ -100,6 +100,7 @@ Dart d_maison;
Dart
Carre
()
{
return
Dart
::
nil
();
}
...
...
@@ -107,7 +108,7 @@ Dart Carre()
Dart
Triangle
()
{
return
Dart
::
nil
();
}
...
...
@@ -141,7 +142,7 @@ void ColleMilieu(Dart d, Dart e)
Dart
Maison
()
{
return
Dart
::
nil
();
}
...
...
@@ -634,7 +635,6 @@ void myGlutWin::myKeyboard(unsigned char keycode, int x, int y)
/// calcul du rayon
getOrthoScreenRay
(
x
,
y
,
rayA
,
rayB
);
PFP
::
VEC3
AB
=
rayB
-
rayA
;
float
AB2
=
AB
.
norm2
();
d_faces
.
clear
();
d_edges
.
clear
();
...
...
@@ -678,7 +678,6 @@ void myGlutWin::myKeyboard(unsigned char keycode, int x, int y)
/// Rayon
getOrthoScreenRay
(
x
,
y
,
rayA
,
rayB
);
PFP
::
VEC3
AB
=
rayB
-
rayA
;
float
AB2
=
AB
.
norm2
();
d_faces
.
clear
();
d_edges
.
clear
();
...
...
Apps/Tuto/tuto_mt.cpp
0 → 100644
View file @
2904fbf9
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: https://iggservis.u-strasbg.fr/CGoGN/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include <iostream>
#include "Utils/glutwin.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/map2.h"
#include "Topology/generic/embeddedMap2.h"
#include "Geometry/vector_gen.h"
#include "Algo/Import/import.h"
#include "Algo/Geometry/boundingbox.h"
#include "Algo/Render/vbo_MapRender.h"
#include "Algo/Geometry/area.h"
#include "Algo/Geometry/normal.h"
#include "Algo/Parallel/parallel_foreach.h"
#include "averaging.h"
using
namespace
CGoGN
;
/**
* Struct that contains some informations about the types of the manipulated objects
* Mainly here to be used by the algorithms that are parameterized by it
*/
struct
PFP
:
public
PFP_STANDARD
{
// definition of the map
typedef
EmbeddedMap2
<
Map2
>
MAP
;
};
/**
* A class for a little interface and rendering
*/
class
MyGlutWin
:
public
Utils
::
SimpleGlutWin
{
public:
void
myRedraw
();
PFP
::
REAL
gWidthObj
;
PFP
::
VEC3
gPosObj
;
Algo
::
Render
::
VBO
::
MapRender_VBO
*
m_render
;
MyGlutWin
(
int
*
argc
,
char
**
argv
,
int
winX
,
int
winY
)
:
SimpleGlutWin
(
argc
,
argv
,
winX
,
winY
),
m_render
(
NULL
)
{}
~
MyGlutWin
()
{
if
(
m_render
!=
NULL
)
delete
m_render
;
}
};
// Routine d'affichage
void
MyGlutWin
::
myRedraw
()
{
glClear
(
GL_COLOR_BUFFER_BIT
|
GL_DEPTH_BUFFER_BIT
);
glPushMatrix
();
// center the object
float
sc
=
50.0
f
/
gWidthObj
;
glScalef
(
sc
,
sc
,
sc
);
glTranslatef
(
-
gPosObj
[
0
],
-
gPosObj
[
1
],
-
gPosObj
[
2
]);
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_FILL
);
glDisable
(
GL_LIGHTING
);
// draw the lines
glColor3f
(
1.0
f
,
1.0
f
,
0.0
f
);
m_render
->
draw
(
Algo
::
Render
::
VBO
::
LINES
);
// draw the faces
glEnable
(
GL_POLYGON_OFFSET_FILL
);
glPolygonOffset
(
1.0
f
,
1.0
f
);
glColor3f
(
0.0
f
,
0.5
f
,
0.0
f
);
m_render
->
draw
(
Algo
::
Render
::
VBO
::
TRIANGLES
);
glDisable
(
GL_POLYGON_OFFSET_FILL
);
glPopMatrix
();
}
template
<
typename
XXX
>
class
ThreadArea
:
public
Algo
::
Parallel
::
CGoGNThread
<
typename
XXX
::
MAP
>
{
protected:
const
typename
XXX
::
TVEC3
&
m_positions
;
float
area
;
public:
ThreadArea
(
typename
XXX
::
MAP
&
map
,
const
typename
XXX
::
TVEC3
&
pos
,
unsigned
int
th
)
:
Algo
::
Parallel
::
CGoGNThread
<
typename
XXX
::
MAP
>
(
map
,
th
),
m_positions
(
pos
),
area
(
0.0
f
)
{}
void
operator
()()
{
// 3 times just for fun !!!
area
+=
Algo
::
Geometry
::
totalArea
<
XXX
>
(
this
->
m_map
,
m_positions
,
SelectorTrue
(),
this
->
m_threadId
);
area
+=
Algo
::
Geometry
::
totalArea
<
XXX
>
(
this
->
m_map
,
m_positions
,
SelectorTrue
(),
this
->
m_threadId
);
area
+=
Algo
::
Geometry
::
totalArea
<
XXX
>
(
this
->
m_map
,
m_positions
,
SelectorTrue
(),
this
->
m_threadId
);
}
float
getTripleValue
()
{
return
area
;}
};
template
<
typename
XXX
>
class
ThreadNormals
:
public
Algo
::
Parallel
::
CGoGNThread
<
typename
XXX
::
MAP
>
{
protected:
const
typename
XXX
::
TVEC3
&
m_positions
;
typename
XXX
::
TVEC3
&
m_normals
;
public:
ThreadNormals
(
typename
XXX
::
MAP
&
map
,
const
typename
XXX
::
TVEC3
&
pos
,
typename
XXX
::
TVEC3
&
norm
,
unsigned
int
th
)
:
Algo
::
Parallel
::
CGoGNThread
<
typename
XXX
::
MAP
>
(
map
,
th
),
m_positions
(
pos
),
m_normals
(
norm
)
{}
void
operator
()()
{
Algo
::
Geometry
::
computeNormalVertices
<
XXX
>
(
this
->
m_map
,
m_positions
,
m_normals
,
SelectorTrue
(),
this
->
m_threadId
);
}
};
//
//template<typename XXX>
//class Thread0
//{
//protected:
// typename XXX::MAP& m_map;
// MyGlutWin& m_mgw;
// unsigned int m_th;
// SelectorTrue m_selt;
//public:
// Thread0(typename XXX::MAP& map,MyGlutWin& mgw, unsigned int th):
// m_map(map), m_mgw(mgw), m_th(th) {}
//
// void operator()()
// {
// std::cout << "Begin render init"<<std::endl;
// m_mgw.useContext();
//
// // instanciation of the renderer (here using VBOs)
// m_mgw.m_render = new Algo::Render::VBO::MapRender_VBO();
//
// // update the renderer (geometry and primitives)
// m_mgw.m_render->updateData(Algo::Render::VBO::POSITIONS, position);
//
// m_mgw.m_render->initPrimitives<PFP>(m_map, m_selt, Algo::Render::VBO::TRIANGLES,m_th);
// m_mgw.m_render->initPrimitives<PFP>(m_map, m_selt, Algo::Render::VBO::LINES,m_th);
//
// m_mgw.releaseContext();
// std::cout<< "Render OK "<< std::endl;
//
// }
//};
template
<
typename
XXX
>
class
calculFunctor1
:
public
Algo
::
Parallel
::
FunctorMapThreaded
<
typename
XXX
::
MAP
>
{
protected:
typename
XXX
::
TVEC3
&
m_positions
;
typename
XXX
::
TVEC3
&
m_normals
;
public:
calculFunctor1
(
typename
XXX
::
MAP
&
map
,
typename
XXX
::
TVEC3
&
pos
,
typename
XXX
::
TVEC3
&
norm
,
unsigned
int
id
=
0
)
:
Algo
::
Parallel
::
FunctorMapThreaded
<
typename
XXX
::
MAP
>
(
map
,
id
),
m_positions
(
pos
),
m_normals
(
norm
)
{}
bool
operator
()(
Dart
d
)
{
typename
XXX
::
VEC3
n1
=
Algo
::
Geometry
::
vertexNormal
<
XXX
>
(
this
->
m_map
,
d
,
m_positions
);
typename
XXX
::
VEC3
n2
=
Algo
::
Geometry
::
vertexNormal
<
XXX
>
(
this
->
m_map
,
this
->
m_map
.
phi1
(
d
),
m_positions
);
typename
XXX
::
VEC3
n3
=
Algo
::
Geometry
::
vertexNormal
<
XXX
>
(
this
->
m_map
,
this
->
m_map
.
phi_1
(
d
),
m_positions
);
typename
XXX
::
VEC3
n
=
n1
+
n2
+
n3
;
n1
=
Algo
::
Geometry
::
vertexNormal
<
XXX
>
(
this
->
m_map
,
d
,
m_positions
);
n2
=
Algo
::
Geometry
::
vertexNormal
<
XXX
>
(
this
->
m_map
,
this
->
m_map
.
phi1
(
d
),
m_positions
);
n3
=
Algo
::
Geometry
::
vertexNormal
<
XXX
>
(
this
->
m_map
,
this
->
m_map
.
phi_1
(
d
),
m_positions
);
n
+=
n1
+
n2
+
n3
;
n
.
normalize
();
m_normals
[
d
]
=
n
;
// m_normals[d] = Algo::Geometry::vertexNormal<XXX>(this->m_map, d, m_positions);
return
false
;
}
Algo
::
Parallel
::
FunctorMapThreaded
<
typename
XXX
::
MAP
>*
duplicate
(
unsigned
int
id
)
{
calculFunctor1
<
XXX
>*
copy
=
new
calculFunctor1
<
XXX
>
(
this
->
m_map
,
m_positions
,
m_normals
,
id
);
return
reinterpret_cast
<
Algo
::
Parallel
::
FunctorMapThreaded
<
typename
XXX
::
MAP
>*>
(
copy
);
}
};
template
<
typename
XXX
>
class
LengthEdgeFunctor
:
public
Algo
::
Parallel
::
FunctorMapThreadedResult
<
typename
XXX
::
MAP
,
std
::
pair
<
double
,
unsigned
int
>
>
{
protected:
typename
XXX
::
TVEC3
&
m_positions
;
double
m_length
;
unsigned
int
m_nb
;
public:
LengthEdgeFunctor
(
typename
XXX
::
MAP
&
map
,
typename
XXX
::
TVEC3
&
pos
,
unsigned
int
id
=
0
)
:
Algo
::
Parallel
::
FunctorMapThreadedResult
<
typename
XXX
::
MAP
,
std
::
pair
<
double
,
unsigned
int
>
>
(
map
,
id
),
m_positions
(
pos
),
m_length
(
0.0
),
m_nb
(
0
)
{}
bool
operator
()(
Dart
d
)
{
Dart
dd
=
this
->
m_map
.
phi2
(
d
);
typename
XXX
::
VEC3
V
=
m_positions
[
dd
]
-
m_positions
[
d
];
m_length
+=
V
.
norm
();
m_nb
++
;
return
false
;
}
Algo
::
Parallel
::
FunctorMapThreaded
<
typename
XXX
::
MAP
>*
duplicate
(
unsigned
int
id
)
{
LengthEdgeFunctor
<
XXX
>*
copy
=
new
LengthEdgeFunctor
<
XXX
>
(
this
->
m_map
,
m_positions
,
id
);
return
reinterpret_cast
<
Algo
::
Parallel
::
FunctorMapThreaded
<
typename
XXX
::
MAP
>*>
(
copy
);
}
std
::
pair
<
double
,
unsigned
int
>
getResult
()
{
return
std
::
pair
<
double
,
unsigned
int
>
(
m_length
,
m_nb
);}
};
int
main
(
int
argc
,
char
**
argv
)
{
// declaration of the map
PFP
::
MAP
myMap
;
// this selector is going to select all the darts
SelectorTrue
allDarts
;
// instanciation of the interface
MyGlutWin
mgw
(
&
argc
,
argv
,
800
,
800
);
glewInit
();
// release context (leave it for thread 0);
mgw
.
releaseContext
();
std
::
vector
<
std
::
string
>
attrNames
;
if
(
!
Algo
::
Import
::
importMesh
<
PFP
>
(
myMap
,
argv
[
1
],
attrNames
))
{
std
::
cerr
<<
"could not import "
<<
argv
[
1
]
<<
std
::
endl
;
return
1
;
}
AttributeHandler
<
PFP
::
VEC3
>
position
;
AttributeHandler
<
PFP
::
VEC3
>
facesnormals
;
// cree un handler d'attribut pour la position des points (créé lors de l'import)
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
attrNames
[
0
])
;
std
::
cout
<<
"Sommets:"
<<
position
.
end
()
<<
std
::
endl
;
// cree un handler pour les normales aux sommets
AttributeHandler
<
PFP
::
VEC3
>
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
"normal"
);
AttributeHandler
<
PFP
::
VEC3
>
normal2
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
"normal2"
);
// ajout de 4 threads pour les markers
myMap
.
addThreadMarker
(
4
);
//Algorithmes en //
boost
::
thread
thread1
(
ThreadArea
<
PFP
>
(
myMap
,
position
,
1
));
boost
::
thread
thread2
(
ThreadNormals
<
PFP
>
(
myMap
,
position
,
normal
,
2
));
thread1
.
join
();
thread2
.
join
();
// parallelisation de boucle sans resultat
calculFunctor1
<
PFP
>
tf1
(
myMap
,
position
,
normal
);
Algo
::
Parallel
::
foreach_orbit
<
PFP
>
(
myMap
,
VERTEX_ORBIT
,
tf1
,
4
);
std
::
cout
<<
"ok:"
<<
std
::
endl
;
// parallelisation de boucle avec resultats stockes
// vector pour le resultat (ici paire double/int pour faire la moyenne des longueurs des aretes)
std
::
vector
<
std
::
pair
<
double
,
unsigned
int
>
>
lengthp
;
LengthEdgeFunctor
<
PFP
>
tflef
(
myMap
,
position
);
// le foncteur
// on lance l'algo parallelise (4 threads, buffer de 16384 brins par thread)
Algo
::
Parallel
::
foreach_orbit_res
<
PFP
,
std
::
pair
<
double
,
unsigned
int
>
>
(
myMap
,
EDGE_ORBIT
,
tflef
,
4
,
16384
,
lengthp
);
// on calcule la somme des resultats
std
::
pair
<
double
,
unsigned
int
>
le
=
Algo
::
Parallel
::
sumPairResult
<
double
,
unsigned
int
>
(
lengthp
);
std
::
cout
<<
"length :"
<<
le
.
first
/
le
.
second
<<
std
::
endl
;
// on enleve les markers ajoutes
myMap
.
removeThreadMarker
(
4
);
return
0
;
}
README.TXT
View file @
2904fbf9
Dépendences Linux:
installer les paquets suivants:
cmake libXi-dev libXmu-dev freeglut3-dev libdevil-dev libglew-dev libgmp3-dev libxml2-dev libboost-dev
cmake libXi-dev libXmu-dev freeglut3-dev libdevil-dev libglew-dev libgmp3-dev libxml2-dev libboost-dev
lizip-dev
Pour compiler CGoGN:
...
...
ThirdParty/Assimp/code/CMakeLists.txt
View file @
2904fbf9
cmake_minimum_required
(
VERSION 2.6
)
PROJECT
(
Assimp
)
set
(
LIBRARY_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/lib/Release
)
INCLUDE_DIRECTORIES
(
../include
)
SET
(
LIBRARY_VERSION
"1.0.0"
)
SET
(
LIBRARY_SOVERSION
"1"
)
IF
(
WIN32
)
SET
(
ENABLE_BOOST_WORKAROUND
"1"
)
ENDIF
(
WIN32
)
IF
(
ENABLE_BOOST_WORKAROUND
)
INCLUDE_DIRECTORIES
(
BoostWorkaround
)
ADD_DEFINITIONS
(
-DASSIMP_BUILD_BOOST_WORKAROUND
)
MESSAGE
(
STATUS
"Building a non-boost version of Assimp."
)
ELSE
(
ENABLE_BOOST_WORKAROUND
)
FIND_PACKAGE
(
Boost
1.35
)
FIND_PACKAGE
(
Boost
)
IF
(
NOT Boost_FOUND
)
MESSAGE
(
FATAL_ERROR
...
...
ThirdParty/CMakeLists.txt
View file @
2904fbf9
...
...
@@ -11,11 +11,18 @@ find_package(GLUT)
#On Windows we use AntTweakBar/OpenCTM of dependencies, not compiled
IF
(
WIN32
)
SET
(
LIBRARY_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/lib
)
#release added by visual
INCLUDE_DIRECTORIES
(
${
CGoGN_ROOT_DIR
}
/windows_dependencies/include/
)
add_subdirectory
(
Zinri/Build
)
add_subdirectory
(
gzstream/Build
)
add_subdirectory
(
Numerical
)
add_subdirectory
(
Assimp
)
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
()
ELSE
(
WIN32
)
SET
(
LIBRARY_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/lib/Release
)
add_custom_target
(
FakeTargetOpenCTM ALL
"make"
WORKING_DIRECTORY
${
CGoGN_ROOT_DIR
}
/ThirdParty/OpenCTM
COMMENT
"Custom compile of OpenCTM"
)
...
...
ThirdParty/Numerical/CMakeLists.txt
View file @
2904fbf9
...
...
@@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.6)
project
(
Numerical
)
set
(
LIBRARY_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/lib/Release
)
SUBDIRS
(
C_BLAS_LAPACK
)
...
...
ThirdParty/Numerical/C_BLAS_LAPACK/BLAS/SRC/CMakeLists.txt
View file @
2904fbf9
...
...
@@ -135,7 +135,7 @@ if(BLAS_COMPLEX16)
${
ALLBLAS
}
${
ZBLAS2
}
${
ZBLAS3
}
)
endif
()
set
(
LIBRARY_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/lib/Release
)
add_library
(
blas
${
ALLOBJ
}
)
if
(
UNIX
)
target_link_libraries
(
blas m
)
...
...
ThirdParty/Numerical/C_BLAS_LAPACK/F2CLIBS/libf2c/CMakeLists.txt
View file @
2904fbf9
...
...
@@ -58,6 +58,7 @@ if(WIN32)
endif
()
include_directories
(
${
CLAPACK_SOURCE_DIR
}
/F2CLIBS/libf2c
)
include_directories
(
${
CLAPACK_BINARY_DIR
}
/F2CLIBS/libf2c
)
set
(
LIBRARY_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/lib/Release
)
add_library
(
f2c
${
OFILES
}
${
CMAKE_CURRENT_BINARY_DIR
}
/arith.h
)
set_property
(
TARGET f2c PROPERTY PREFIX lib
)
#set_property(TARGET f2c PROPERTY PREFIX lib)
#pb sous windows avec le prefix lib
\ No newline at end of file
ThirdParty/Numerical/C_BLAS_LAPACK/SRC/CMakeLists.txt
View file @
2904fbf9
...
...
@@ -376,7 +376,6 @@ if(BUILD_COMPLEX16)
set
(
ALLOBJ
${
ZLASRC
}
${
ALLAUX
}
${
DZLAUX
}
)
endif
()
set
(
LIBRARY_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/lib/Release
)
add_library
(
lapack
${
ALLOBJ
}
${
ALLXOBJ
}
)
target_link_libraries
(
lapack blas
)
ThirdParty/Zinri/Build/CMakeLists.txt
View file @
2904fbf9
...
...
@@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 2.6)
project
(
Zinri
)
set
(
LIBRARY_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/lib/Release
)
include_directories
(
..
)
file
(
...
...
ThirdParty/glm/glm/core/_detail.hpp
0 → 100644
View file @
2904fbf9
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-07-24
// Updated : 2008-08-31
// Licence : This source is under MIT License
// File : glm/core/_detail.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_detail
#define glm_core_detail
#include "../setup.hpp"
#include <cassert>
namespace
glm
{
namespace
detail
{
class
thalf
;
#if(defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_VC))
typedef
signed
__int64
sint64
;
typedef
unsigned
__int64
uint64
;
#elif(defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_GCC))
__extension__
typedef
signed
long
long
sint64
;
__extension__
typedef
unsigned
long
long
uint64
;
#else//unknown compiler
typedef
signed
long
sint64
;
typedef
unsigned
long
uint64
;
#endif//GLM_COMPILER
template
<
bool
C
>
struct
If
{
template
<
typename
F
,
typename
T
>
static
inline
T
apply
(
F
functor
,
const
T
&
val
)
{
return
functor
(
val
);
}
};
template
<
>
struct
If
<
false
>
{
template
<
typename
F
,
typename
T
>
static
inline
T
apply
(
F
,
const
T
&
val
)
{
return
val
;
}
};
//template <typename T>
//struct traits
//{
// static const bool is_signed = false;
// static const bool is_float = false;
// static const bool is_vector = false;
// static const bool is_matrix = false;
// static const bool is_genType = false;
// static const bool is_genIType = false;
// static const bool is_genUType = false;
//};
//template <>
//struct traits<half>
//{
// static const bool is_float = true;
// static const bool is_genType = true;
//};
//template <>
//struct traits<float>
//{
// static const bool is_float = true;
// static const bool is_genType = true;