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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CGoGN
CGoGN
Commits
38e72f5d
Commit
38e72f5d
authored
Sep 01, 2011
by
untereiner
Browse files
Options
Browse Files
Download
Plain Diff
Merge cgogn:~cgogn/CGoGN
parents
8dd3610a
ad2de7a7
Changes
43
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
1972 additions
and
1438 deletions
+1972
-1438
Apps/Examples/Tests/concave_rendering.cpp
Apps/Examples/Tests/concave_rendering.cpp
+47
-19
Apps/Examples/Viewer.cpp
Apps/Examples/Viewer.cpp
+0
-564
Apps/Examples/viewer.cpp
Apps/Examples/viewer.cpp
+6
-4
build/apps_cmake.txt
build/apps_cmake.txt
+25
-1
include/Algo/Export/exportPov.h
include/Algo/Export/exportPov.h
+1
-1
include/Algo/MC/image.h
include/Algo/MC/image.h
+11
-8
include/Algo/MC/image.hpp
include/Algo/MC/image.hpp
+42
-39
include/Algo/MC/marchingcube.h
include/Algo/MC/marchingcube.h
+7
-7
include/Algo/MC/marchingcube.hpp
include/Algo/MC/marchingcube.hpp
+3
-4
include/Algo/MC/windowing.h
include/Algo/MC/windowing.h
+1
-1
include/Algo/Modelisation/extrusion.hpp
include/Algo/Modelisation/extrusion.hpp
+1
-1
include/Algo/Modelisation/triangulation.h
include/Algo/Modelisation/triangulation.h
+108
-0
include/Algo/Modelisation/triangulation.hpp
include/Algo/Modelisation/triangulation.hpp
+244
-0
include/Algo/Render/GL2/mapRender.h
include/Algo/Render/GL2/mapRender.h
+4
-5
include/Algo/Render/GL2/mapRender.hpp
include/Algo/Render/GL2/mapRender.hpp
+75
-50
include/Algo/Selection/raySelectFunctor.hpp
include/Algo/Selection/raySelectFunctor.hpp
+5
-3
include/Container/attributeContainer.hpp
include/Container/attributeContainer.hpp
+3
-0
include/Geometry/intersection.hpp
include/Geometry/intersection.hpp
+7
-46
include/Topology/generic/attribmap.h
include/Topology/generic/attribmap.h
+13
-8
include/Topology/generic/attribmap.hpp
include/Topology/generic/attribmap.hpp
+9
-1
include/Topology/generic/attributeHandler.h
include/Topology/generic/attributeHandler.h
+37
-12
include/Topology/generic/attributeHandler.hpp
include/Topology/generic/attributeHandler.hpp
+47
-29
include/Topology/generic/cellmarker.h
include/Topology/generic/cellmarker.h
+3
-3
include/Topology/generic/dartmarker.h
include/Topology/generic/dartmarker.h
+6
-6
include/Topology/generic/genericmap.h
include/Topology/generic/genericmap.h
+72
-82
include/Topology/generic/genericmap.hpp
include/Topology/generic/genericmap.hpp
+0
-16
include/Topology/gmap/gmap0.h
include/Topology/gmap/gmap0.h
+4
-0
include/Topology/gmap/gmap0.hpp
include/Topology/gmap/gmap0.hpp
+12
-1
include/Topology/gmap/gmap1.h
include/Topology/gmap/gmap1.h
+4
-0
include/Topology/gmap/gmap1.hpp
include/Topology/gmap/gmap1.hpp
+12
-1
include/Topology/gmap/gmap2.h
include/Topology/gmap/gmap2.h
+4
-0
include/Topology/gmap/gmap2.hpp
include/Topology/gmap/gmap2.hpp
+12
-1
include/Topology/gmap/gmap3.h
include/Topology/gmap/gmap3.h
+4
-0
include/Topology/gmap/gmap3.hpp
include/Topology/gmap/gmap3.hpp
+10
-1
include/Topology/map/map1.h
include/Topology/map/map1.h
+5
-1
include/Topology/map/map1.hpp
include/Topology/map/map1.hpp
+14
-3
include/Topology/map/map2.h
include/Topology/map/map2.h
+4
-0
include/Topology/map/map2.hpp
include/Topology/map/map2.hpp
+12
-1
include/Topology/map/map3.h
include/Topology/map/map3.h
+4
-0
include/Topology/map/map3.hpp
include/Topology/map/map3.hpp
+12
-1
src/Algo/MC/tables.cpp
src/Algo/MC/tables.cpp
+1026
-512
src/Topology/generic/attribmap.cpp
src/Topology/generic/attribmap.cpp
+21
-3
src/Topology/generic/genericmap.cpp
src/Topology/generic/genericmap.cpp
+35
-3
No files found.
Apps/Examples/Tests/concave_rendering.cpp
View file @
38e72f5d
...
...
@@ -42,6 +42,8 @@
#include "Algo/Render/SVG/mapSVGRender.h"
#include "Algo/Modelisation/triangulation.h"
using
namespace
CGoGN
;
...
...
@@ -156,7 +158,7 @@ void MyQT::cb_initGL()
void
MyQT
::
cb_redraw
()
{
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_FILL
);
gl
En
able
(
GL_CULL_FACE
);
gl
Dis
able
(
GL_CULL_FACE
);
glEnable
(
GL_LIGHTING
);
if
(
m_shader
)
{
...
...
@@ -170,7 +172,7 @@ void MyQT::cb_redraw()
m_render
->
draw
(
m_shader
,
Algo
::
Render
::
GL2
::
LINES
);
glPolygonOffset
(
0.8
f
,
0.8
f
);
m_shader
->
setColor
(
Geom
::
Vec4f
(
1
.0
,
0.
,
0.
,
0.
));
m_shader
->
setColor
(
Geom
::
Vec4f
(
0
.0
,
0.
,
0.
,
0.
));
glLineWidth
(
1.0
f
);
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_LINE
);
m_render
->
drawSub
(
m_shader
,
Algo
::
Render
::
GL2
::
TRIANGLES
,
nb_ears
);
...
...
@@ -185,32 +187,58 @@ void MyQT::cb_redraw()
void
MyQT
::
cb_keyPress
(
int
code
)
{
if
(
code
==
'+'
)
switch
(
code
)
{
case
'+'
:
nb_ears
++
;
// born sup dans drawing
updateGL
();
}
if
(
code
==
'-'
)
{
break
;
case
'-'
:
if
(
nb_ears
>=
1
)
nb_ears
--
;
updateGL
();
}
if
(
code
==
'n'
)
{
break
;
case
'n'
:
nb_ears
=
0
;
updateGL
();
}
break
;
if
(
code
==
'a'
)
{
case
'a'
:
nb_ears
=
99999999
;
updateGL
();
break
;
case
't'
:
{
Algo
::
Modelisation
::
EarTriangulation
<
PFP
>
triangulation
(
myMap
);
triangulation
.
triangule
();
SelectorTrue
allDarts
;
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
TRIANGLES
);
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
LINES
);
updateGL
();
}
break
;
// case 'u':
// {
// Dart d=myMap.begin();
// while (d != myMap.end())
// {
// if (myMap.phi2(d) != d)
// {
// Dart e = d;
// myMap.next(d);
// if (d== myMap.phi2(e))
// myMap.next(d);
// myMap.mergeFaces(e);
// }
// else
// myMap.next(d);
// }
// }
// break;
}
}
int
main
(
int
argc
,
char
**
argv
)
...
...
@@ -218,7 +246,6 @@ int main(int argc, char **argv)
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
Dart
d0
=
myMap
.
newFace
(
12
);
position
[
d0
]
=
PFP
::
VEC3
(
0
,
20
,
0
);
d0
=
myMap
.
phi1
(
d0
);
...
...
@@ -241,7 +268,7 @@ int main(int argc, char **argv)
position
[
d0
]
=
PFP
::
VEC3
(
5
,
30
,
0
);
d0
=
myMap
.
phi1
(
d0
);
position
[
d0
]
=
PFP
::
VEC3
(
0
,
30
,
0
);
d0
=
myMap
.
phi1
(
d0
);
d0
=
myMap
.
newFace
(
4
);
...
...
@@ -382,7 +409,6 @@ int main(int argc, char **argv)
for
(
int
i
=
0
;
i
<
174
;
++
i
)
{
float
a
=
float
(
rand
()
-
RAND_MAX
/
2
)
/
float
(
RAND_MAX
)
*
0.25
f
;
position
[
d9
]
=
PFP
::
VEC3
(
60.0
,
60.0
,
0.0
f
)
+
Gfont
[
2
*
i
]
*
V1
+
Gfont
[
2
*
i
+
1
]
*
V2
+
a
*
V3
;
d9
=
myMap
.
phi1
(
d9
);
}
...
...
@@ -417,8 +443,10 @@ int main(int argc, char **argv)
SelectorTrue
allDarts
;
sqt
.
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
TRIANGLES
);
sqt
.
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
LINES
);
sqt
.
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
POINTS
);
//
show final pour premier redraw
//
show final pour premier redraw
sqt
.
show
();
// et on attend la fin.
...
...
Apps/Examples/Viewer.cpp
deleted
100644 → 0
View file @
8dd3610a
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2011, 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: http://cgogn.u-strasbg.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include <iostream>
#include "Utils/os_spec.h"
#include "Utils/GLSLShader.h"
#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/Render/map_glRender.h"
#include "Algo/Render/vbo_MapRender.h"
#include "Algo/Geometry/normal.h"
#include "Algo/Geometry/boundingbox.h"
#include "Algo/Geometry/area.h"
#include "Algo/Geometry/intersection.h"
#include "Algo/Modelisation/polyhedron.h"
#include "Algo/Modelisation/subdivision.h"
#include "Algo/Modelisation/extrusion.h"
#include "Algo/MC/marchingcubeGen.h"
#include "Topology/generic/ecell.h"
#include "Algo/Export/export.h"
using
namespace
CGoGN
;
struct
PFP
:
public
PFP_STANDARD
{
// definition of the map
typedef
EmbeddedMap2
<
Map2
>
MAP
;
};
PFP
::
MAP
myMap
;
SelectorTrue
allDarts
;
PFP
::
TVEC3
position
;
PFP
::
TVEC3
normal
;
class
myGlutWin
:
public
Utils
::
SimpleGlutWin
{
public:
Geom
::
Vec4f
colDif
;
Geom
::
Vec4f
colSpec
;
Geom
::
Vec4f
colClear
;
Geom
::
Vec4f
colNormal
;
float
shininess
;
/**
* position of object
*/
Geom
::
Vec3f
gPosObj
;
/**
* width of object
*/
float
gWidthObj
;
/**
* factor to apply to normal drawing
*/
float
normalScaleFactor
;
/**
* redraw CB
*/
void
myRedraw
();
/**
* keyboard CB
*/
void
myKeyboard
(
unsigned
char
keycode
,
int
x
,
int
y
);
/**
* inverse the normal when computing normal
*/
bool
invertedNormals
;
/**
* inverse object for culling
*/
bool
invertedObject
;
/**
* rendering normals ?
*/
bool
renderNormal
;
/**
* rendering lines ?
*/
bool
renderLines
;
/**
* aide affichee
*/
bool
aff_help
;
/**
* style of rendering
*/
int
renderStyle
;
Algo
::
Render
::
GL2
::
MapRender_VBO
*
m_render
;
/**
* render mode enum
*/
enum
{
CLEAR
=
1
,
LINE
,
FLAT
,
GOURAUD
,
PHONG
,
NORMAL
,
NONE
};
myGlutWin
(
int
*
argc
,
char
**
argv
,
int
winX
,
int
winY
)
:
SimpleGlutWin
(
argc
,
argv
,
winX
,
winY
),
renderNormal
(
false
),
renderLines
(
false
),
aff_help
(
true
)
{
if
(
this
->
shaderOk
)
shaders
[
0
].
loadShaders
(
"phong_vs.txt"
,
"phong_ps.txt"
);
// m_cb = new Algo::Render::GL2::GL2_CB_PositionNormal<PFP>(myMap);
// m_render = new Algo::Render::GL2::MapRender_VBO(myMap, allDarts, m_cb);
//
// m_render->initBuffers();
// m_render->updateData(Algo::Render::GL2::POSITIONS, position );
// m_render->updateData(Algo::Render::GL2::NORMALS, normal );
// m_render->initPrimitives<PFP>(myMap, good, Algo::Render::GL2::TRIANGLES);
// m_render->initPrimitives<PFP>(myMap, good, Algo::Render::GL2::LINES);
}
};
void
myGlutWin
::
myRedraw
(
void
)
{
glClear
(
GL_COLOR_BUFFER_BIT
|
GL_DEPTH_BUFFER_BIT
);
glPushMatrix
();
float
sc
=
50.
/
gWidthObj
;
glScalef
(
sc
,
sc
,
sc
);
glTranslatef
(
-
gPosObj
[
0
],
-
gPosObj
[
1
],
-
gPosObj
[
2
]);
glEnable
(
GL_LIGHTING
);
glEnable
(
GL_COLOR_MATERIAL
);
glColorMaterial
(
GL_FRONT_AND_BACK
,
GL_DIFFUSE
);
glColor3f
(
0.7
f
,
0.8
f
,
1.0
f
);
glMaterialfv
(
GL_FRONT
,
GL_SPECULAR
,
colSpec
.
data
());
glMaterialf
(
GL_FRONT
,
GL_SHININESS
,
shininess
);
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
myMap
,
position
,
normal
)
;
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_FILL
);
// m_render->draw(Algo::Render::GL2::TRIANGLES);
Algo
::
Render
::
Direct
::
renderTriQuadPoly
<
PFP
>
(
myMap
,
Algo
::
Render
::
Direct
::
FLAT
,
0.9
,
position
,
normal
,
normal
);
glDisable
(
GL_LIGHTING
);
glColor3f
(
0.0
f
,
0.0
f
,
0.0
f
);
// m_render->draw(Algo::Render::GL2::LINES);
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_LINE
);
Algo
::
Render
::
Direct
::
renderTriQuadPoly
<
PFP
>
(
myMap
,
Algo
::
Render
::
Direct
::
LINE
,
1.0
,
position
,
normal
);
// glPointSize(5.0f);
// glColor3f(1.0f,.0f,.0f);
// glPolygonMode(GL_FRONT_AND_BACK,GL_POINT);
// Algo::Render::Direct::renderTriQuadPoly<PFP>(myMap, Algo::Render::Direct::LINE, 0.9, position, normal);
// Algo::Render::Direct::renderTriQuadPoly<PFP>(myMap, Algo::Render::Direct::FLAT, 0.9, position, normal);
// TESTED OK
glPopMatrix
();
// a faire en dernier pour que ca dessine au dessus
if
(
aff_help
)
{
glColor3f
(
1.0
f
,
1.0
f
,
1.0
f
);
printString2D
(
10
,
20
,
"Keys:
\n
----
\n
f : flat (DL)
\n
g: gouraud (DL)
\n
p: phong ( strip DL)
\n
a: dual
\n
u: simplification (nbfaces/2)
\n
C : catmullclark
\n
R : square3
\n
L: Loop
\n
O: inverse objet
\n
n: affiche normales
\n
Z/z: shininess
\n
D/d: focale
\n
v: calcul fps
\n
h: affiche l'aide"
);
}
}
void
myGlutWin
::
myKeyboard
(
unsigned
char
keycode
,
int
,
int
)
{
switch
(
keycode
)
{
case
'a'
:
{
unsigned
int
end
=
position
.
end
();
for
(
unsigned
int
it
=
position
.
begin
();
it
!=
end
;
position
.
next
(
it
))
{
position
[
it
]
+=
normal
[
it
]
*
0.1
;
}
m_render
->
updateData
(
Algo
::
Render
::
GL2
::
POSITIONS
,
position
);
}
break
;
case
'z'
:
{
unsigned
int
end
=
normal
.
end
();
for
(
unsigned
int
it
=
normal
.
begin
();
it
!=
end
;
normal
.
next
(
it
))
{
normal
[
it
]
*=
-
1.0
f
;
}
m_render
->
updateData
(
Algo
::
Render
::
GL2
::
NORMALS
,
normal
);
}
break
;
case
's'
:
{
GLint
t1
=
glutGet
(
GLUT_ELAPSED_TIME
);
Algo
::
Modelisation
::
CatmullClarkSubdivision
<
PFP
>
(
myMap
,
position
);
GLint
t2
=
glutGet
(
GLUT_ELAPSED_TIME
);
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
CGoGNout
<<
"catmull-clark: "
<<
seconds
<<
"sec"
<<
CGoGNendl
;
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
myMap
,
position
,
normal
)
;
break
;
}
case
'l'
:
{
GLint
t1
=
glutGet
(
GLUT_ELAPSED_TIME
);
Algo
::
Modelisation
::
LoopSubdivision
<
PFP
>
(
myMap
,
position
);
Algo
::
Modelisation
::
LoopSubdivision
<
PFP
>
(
myMap
,
position
);
Algo
::
Modelisation
::
LoopSubdivision
<
PFP
>
(
myMap
,
position
);
Algo
::
Modelisation
::
LoopSubdivision
<
PFP
>
(
myMap
,
position
);
Algo
::
Modelisation
::
LoopSubdivision
<
PFP
>
(
myMap
,
position
);
GLint
t2
=
glutGet
(
GLUT_ELAPSED_TIME
);
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
CGoGNout
<<
"loop: "
<<
seconds
<<
"sec"
<<
CGoGNendl
;
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
myMap
,
position
,
normal
,
allDarts
)
;
break
;
}
case
'd'
:
{
GLint
t1
=
glutGet
(
GLUT_ELAPSED_TIME
);
Algo
::
Modelisation
::
Sqrt3Subdivision
<
PFP
>
(
myMap
,
position
);
GLint
t2
=
glutGet
(
GLUT_ELAPSED_TIME
);
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
CGoGNout
<<
"dual: "
<<
seconds
<<
"sec"
<<
CGoGNendl
;
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
myMap
,
position
,
normal
,
allDarts
)
;
break
;
}
}
glutPostRedisplay
();
}
class
Scal3D
{
protected:
int
m_size
;
int
m_mid
;
public:
Scal3D
(
int
size
)
:
m_size
(
size
),
m_mid
(
size
/
2
)
{}
float
getVoxSizeX
()
{
return
1.0
f
;}
float
getVoxSizeY
()
{
return
1.0
f
;}
float
getVoxSizeZ
()
{
return
1.0
f
;}
long
getWidthX
()
{
return
m_size
;}
long
getWidthY
()
{
return
m_size
;}
long
getWidthZ
()
{
return
m_size
;}
float
getVoxel
(
long
x
,
long
y
,
long
z
)
{
float
rad
=
sqrt
(
float
((
x
-
m_mid
)
*
(
x
-
m_mid
)
+
(
y
-
m_mid
)
*
(
y
-
m_mid
)
+
(
z
-
m_mid
)
*
(
z
-
m_mid
)));
float
radx
=
sqrt
(
float
((
y
-
m_mid
)
*
(
y
-
m_mid
)
+
(
z
-
m_mid
)
*
(
z
-
m_mid
)));
float
rady
=
sqrt
(
float
((
x
-
m_mid
)
*
(
x
-
m_mid
)
+
(
z
-
m_mid
)
*
(
z
-
m_mid
)));
float
radz
=
sqrt
(
float
((
x
-
m_mid
)
*
(
x
-
m_mid
)
+
(
y
-
m_mid
)
*
(
y
-
m_mid
)));
float
val
=
1.0
f
-
rad
/
m_mid
;
if
((
val
<
0.0
f
)
||
(
radz
<
m_size
/
10
)
||
(
rady
<
m_size
/
8
)
||
(
radx
<
m_size
/
6
))
return
0.0
f
;
return
val
;
}
};
int
main
(
int
argc
,
char
**
argv
)
{
// GLint t1 = glutGet(GLUT_ELAPSED_TIME);
if
(
argc
==
1
)
{
position
=
myMap
.
addAttribute
<
Geom
::
Vec3f
>
(
VERTEX
,
"position"
);
CGoGNout
<<
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
<<
CGoGNendl
;
// typedef uint8 DATATYPE;
// Algo::MC::Image<DATATYPE> myImg;
// myImg.loadPNG3D("liver.png");
//
// CGoGNout << "Image chargee"<<CGoGNendl;
// CGoGNout << myImg.getWidthX() <<"x"<< myImg.getWidthY() <<"x"<< myImg.getWidthZ() << "voxels"<<CGoGNendl;
//
// // ajouté pour vérifier que ça marche sur les images non bool
//// myImg.Blur3();
//// CGoGNout << "Image lissee"<<CGoGNendl;
//
// // fonction de fenetrage de type superieur à ...
// Algo::MC::WindowingGreater<DATATYPE> myWindFunc;
//
// // valeur utilisee 0 (donc objet = tout ce qui est diff de 0)
// myWindFunc.setIsoValue(DATATYPE(127));
//
// // instanciation du mc
// CGoGNout << "mc init"<<CGoGNendl;
// Algo::MC::MarchingCube<DATATYPE,Algo::MC::WindowingGreater,PFP> mc(&myImg, &myMap, position, myWindFunc, false);
// // MarchingCube<DATATYPE,WindowingDiff> mc(&myImg, &myMap, myWindFunc, false);
//
// // realisation du maillage
// mc.simpleMeshing();
// CGoGNout << "mc ok"<<CGoGNendl;
// typedef float DATATYPE;
//
// // fonction de fenetrage de type superieur à ...
// Algo::MC::WindowingGreater<DATATYPE> myWindFunc;
//
// // valeur utilisee 0 (donc objet = tout ce qui est diff de 0)
// myWindFunc.setIsoValue(DATATYPE(0.32f));
//
// Scal3D myImg(256);
//
// CGoGNout << "mc init"<<CGoGNendl;
// Algo::MC::MarchingCubeGen<DATATYPE, Scal3D, Algo::MC::WindowingGreater,PFP> mc(&myImg, &myMap, position, myWindFunc, false);
//
// //realisation du maillage
// mc.simpleMeshing();
std
::
vector
<
Geom
::
Vec3f
>
objV
;
objV
.
push_back
(
Geom
::
Vec3f
(
-
1
,
-
1
,
37
));
objV
.
push_back
(
Geom
::
Vec3f
(
-
1
,
-
2
,
37
));
objV
.
push_back
(
Geom
::
Vec3f
(
+
1
,
-
2
,
37
));
objV
.
push_back
(
Geom
::
Vec3f
(
+
1
,
-
1
,
37
));
objV
.
push_back
(
Geom
::
Vec3f
(
+
2
,
-
1
,
37
));
objV
.
push_back
(
Geom
::
Vec3f
(
+
2
,
+
1
,
37
));
objV
.
push_back
(
Geom
::
Vec3f
(
+
1
,
+
1
,
37
));
objV
.
push_back
(
Geom
::
Vec3f
(
+
1
,
+
2
,
37
));
objV
.
push_back
(
Geom
::
Vec3f
(
-
1
,
+
2
,
37
));
objV
.
push_back
(
Geom
::
Vec3f
(
-
1
,
+
1
,
37
));
objV
.
push_back
(
Geom
::
Vec3f
(
-
2
,
+
1
,
37
));
objV
.
push_back
(
Geom
::
Vec3f
(
-
2
,
-
1
,
37
));
std
::
vector
<
Geom
::
Vec3f
>
pathV
;
std
::
vector
<
float
>
pathRadius
;
pathV
.
push_back
(
Geom
::
Vec3f
(
0
,
0
,
0
));
pathRadius
.
push_back
(
1.
);
pathV
.
push_back
(
Geom
::
Vec3f
(
0
,
0
,
10
));
pathRadius
.
push_back
(
1.5
);
pathV
.
push_back
(
Geom
::
Vec3f
(
10
,
0
,
10
));
pathRadius
.
push_back
(
1.9
);
pathV
.
push_back
(
Geom
::
Vec3f
(
10
,
10
,
10
));
pathRadius
.
push_back
(
2.5
);
pathV
.
push_back
(
Geom
::
Vec3f
(
10
,
10
,
20
));
pathRadius
.
push_back
(
3.0
);
pathV
.
push_back
(
Geom
::
Vec3f
(
10
,
11
,
25
));
pathRadius
.
push_back
(
1.0
);
pathV
.
push_back
(
Geom
::
Vec3f
(
11
,
13
,
30
));
pathRadius
.
push_back
(
1.5
);
pathV
.
push_back
(
Geom
::
Vec3f
(
0
,
0
,
40
));
pathRadius
.
push_back
(
.5
);
pathV
.
push_back
(
Geom
::
Vec3f
(
-
20
,
-
10
,
0.0
));
pathRadius
.
push_back
(
1.9
);
pathV
.
push_back
(
Geom
::
Vec3f
(
-
10
,
0
,
-
20
));
pathRadius
.
push_back
(
1.3
);
pathV
.
push_back
(
Geom
::
Vec3f
(
5
,
0
,
-
10
));
pathRadius
.
push_back
(
1.
);
// Algo::Modelisation::extrusion<PFP>(myMap, objV, Geom::Vec3f(0.0,0.0,37.0), Geom::Vec3f(0.0,0.0,1.0),false, pathV, false);
Algo
::
Modelisation
::
extrusion_scale_prim
<
PFP
>
(
myMap
,
position
,
objV
,
Geom
::
Vec3f
(
0.0
,
0.0
,
37.0
),
Geom
::
Vec3f
(
0.0
,
0.0
,
1.0
),
false
,
pathV
,
false
,
pathRadius
);
}
// {
// Algo::Modelisation::Primitive<PFP> prim(myMap,position);
//
// prim.grid_topo(2,2);
//
// prim.embedGrid(8.0f,8.0f);
//
// Algo::Modelisation::Primitive<PFP> prim2(myMap,position);
//
// prim2.tore_topo(7,4);
// prim2.embedTore(25.0f,5.0f);
//
// GLint t1 = glutGet(GLUT_ELAPSED_TIME);
//
// myMap.getAttributeContainer(VERTEX).toggleProcess(position);
//// myMap.getAttributeContainer(VERTEX).toggleProcess(idPipo);
//
// PFP::MAP::EVertex::setContainer(myMap.getAttributeContainer(VERTEX));
// PFP::MAP::EVertex::setMap(myMap);
// PFP::MAP::EVertex ec(0);
//
// GLint t2 = glutGet(GLUT_ELAPSED_TIME);
// GLfloat seconds = (t2 - t1) / 1000.0f;
// CGoGNout << "triangulation: "<< seconds << "sec" << CGoGNendl;
//
// Marker m = myMap.getNewMarker(VERTEX);
// myMap.markEmbVertex(myMap.begin(),m);
//
// Dart xd = myMap.alpha1(myMap.begin());
// if (myMap.isMarkedEmbVertex(xd,m))
// {
// CGoGNout << "Marke"<< CGoGNendl;
// }
// xd = myMap.phi2(xd);
// if (myMap.isMarkedEmbVertex(xd,m))
// {
// CGoGNout << "Marke aussi"<< CGoGNendl;
// }
//
// myMap.clearEmbMarkers(m,VERTEX);
// myMap.releaseEmbMarker(m,VERTEX);
//
// }
else
{
SelectorTrue
allDarts
;
// GLint t1 = glutGet(GLUT_ELAPSED_TIME);
std
::
vector
<
std
::
string
>
attrNames
;
if
(
!
Algo
::
Import
::
importMesh
<
PFP
>
(
myMap
,
std
::
string
(
argv
[
1
]),
attrNames
))
{
CGoGNerr
<<
"could not import "
<<
std
::
string
(
argv
[
1
])
<<
CGoGNendl
;
exit
(
1
);
}
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
GLint
t1
=
glutGet
(
GLUT_ELAPSED_TIME
);
// Algo::Export::exportCTM<PFP>(myMap, position, std::string("pipo.ctm"));
// Algo::Modelisation::LoopSubdivision<PFP, PFP::TVEC3, PFP::VEC3>(myMap,position);
// Algo::Modelisation::LoopSubdivision<PFP, PFP::TVEC3, PFP::VEC3>(myMap,position);
// Algo::Modelisation::CatmullClark<PFP, PFP::TVEC3, PFP::VEC3>(myMap,position);
// Algo::Modelisation::CatmullClark<PFP, PFP::TVEC3, PFP::VEC3>(myMap,position);
// PFP::MAP::EVertex::setContainer(myMap.getAttributeContainer(VERTEX));
// PFP::MAP::EVertex::setMap(myMap);
// PFP::MAP::EVertex ec(0);
// myMap.getAttributeContainer(VERTEX).toggleProcess(position);
//
// Algo::Modelisation::LoopSubdivision<PFP, PFP::EVERTEX, PFP::EVERTEX>(myMap,ec);
// Algo::Modelisation::LoopSubdivision<PFP, PFP::EVERTEX, PFP::EVERTEX>(myMap,ec);
// Algo::Modelisation::CatmullClark<PFP, PFP::EVERTEX, PFP::EVERTEX>(myMap,ec);
// Algo::Modelisation::CatmullClark<PFP, PFP::EVERTEX, PFP::EVERTEX>(myMap,ec);
GLint
t2
=
glutGet
(
GLUT_ELAPSED_TIME
);
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
CGoGNout
<<
"subdiv: "
<<
seconds
<<
"sec"
<<
CGoGNendl
;
// myMap.getAttributeContainer(VERTEX).toggleProcess(position);
// PFP::MAP::EVertex::setContainer(myMap.getAttributeContainer(VERTEX));
<