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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
KennethVanhoey
CGoGN
Commits
a4d40b86
Commit
a4d40b86
authored
Jan 28, 2011
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tout compile..
parent
dcdcb3bb
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
162 additions
and
268 deletions
+162
-268
Apps/Examples/decimationVolumique.cpp
Apps/Examples/decimationVolumique.cpp
+1
-1
Apps/Examples/ter_meshes.cpp
Apps/Examples/ter_meshes.cpp
+21
-24
Apps/Examples/triangulation.cpp
Apps/Examples/triangulation.cpp
+8
-9
Apps/Tuto/tp_master.cpp
Apps/Tuto/tp_master.cpp
+14
-64
Apps/Tuto/tuto1.cpp
Apps/Tuto/tuto1.cpp
+0
-4
Apps/Tuto/tuto2.cpp
Apps/Tuto/tuto2.cpp
+0
-3
Apps/Tuto/tuto3.cpp
Apps/Tuto/tuto3.cpp
+0
-4
Apps/Tuto/tuto4.cpp
Apps/Tuto/tuto4.cpp
+0
-4
Apps/Tuto/tuto5.cpp
Apps/Tuto/tuto5.cpp
+3
-8
Apps/Tuto/tuto_subdivision.cpp
Apps/Tuto/tuto_subdivision.cpp
+7
-11
include/Algo/Import/import.h
include/Algo/Import/import.h
+4
-4
include/Algo/Import/importInESS.hpp
include/Algo/Import/importInESS.hpp
+8
-8
include/Algo/Import/importObjEle.hpp
include/Algo/Import/importObjEle.hpp
+13
-13
include/Algo/Import/importTet.hpp
include/Algo/Import/importTet.hpp
+16
-14
include/Algo/Import/importTs.hpp
include/Algo/Import/importTs.hpp
+17
-15
include/Container/attrib_container.h
include/Container/attrib_container.h
+4
-46
include/Container/attrib_container.hpp
include/Container/attrib_container.hpp
+9
-5
include/Container/registered.h
include/Container/registered.h
+28
-16
src/Container/attrib_container.cpp
src/Container/attrib_container.cpp
+9
-15
No files found.
Apps/Examples/decimationVolumique.cpp
View file @
a4d40b86
...
...
@@ -379,7 +379,7 @@ int main(int argc, char **argv)
return
1
;
}
Algo
::
Import
::
importTet
<
PFP
>
(
myMap
,
argv
[
2
],
attrNames
);
Algo
::
Import
::
importTet
<
PFP
>
(
myMap
,
argv
[
2
],
attrNames
);
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
attrNames
[
0
])
;
}
else
if
(
std
::
string
(
argv
[
1
])
==
"-ts"
)
...
...
Apps/Examples/ter_meshes.cpp
View file @
a4d40b86
...
...
@@ -45,26 +45,23 @@ using namespace CGoGN ;
*/
struct
PFP
{
// definition of the
type of the
map
// definition of the map
typedef
EmbeddedMap2
<
Map2
>
MAP
;
// definition of the type of real value
typedef
float
REAL
;
// definition of the type of 3D vector
// other types definitions
typedef
Geom
::
Vector
<
3
,
REAL
>
VEC3
;
typedef
Geom
::
Vector
<
6
,
REAL
>
VEC6
;
typedef
Geom
::
Matrix
<
3
,
3
,
REAL
>
MATRIX33
;
typedef
Geom
::
Matrix
<
4
,
4
,
REAL
>
MATRIX44
;
typedef
Geom
::
Matrix
<
3
,
6
,
REAL
>
MATRIX36
;
// definition of the type of 3D vector attribute handler
typedef
AttributeHandler
<
VEC3
>
TVEC3
;
typedef
TVEC3
TFRAME
;
typedef
TVEC3
TRGBFUNCS
;
typedef
AttributeHandler
<
REAL
>
TREAL
;
};
// some hidden initializations
INIT_STATICS_MAP
();
/**
* A class for a little interface and rendering
*/
...
...
@@ -130,8 +127,6 @@ void fonction_exemple(typename PFP::MAP& map, const AttributeHandler<typename PF
int
main
(
int
argc
,
char
**
argv
)
{
// declaration of the map
...
...
@@ -141,28 +136,31 @@ int main(int argc, char **argv)
SelectorTrue
allDarts
;
// cree un handler d'attribut pour la position des points
AttributeHandler
<
PFP
::
VEC3
>
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
"position"
);
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
;
}
// cree un handler d'attribut pour la position des points (créé lors de l'import)
AttributeHandler
<
PFP
::
VEC3
>
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
attrNames
[
0
])
;
// cree un handler pour les normales aux sommets
AttributeHandler
<
PFP
::
VEC3
>
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
"normal"
);
bool
success
=
Algo
::
Import
::
importMesh
<
PFP
>
(
myMap
,
argv
[
1
],
position
,
Algo
::
Import
::
ImportSurfacique
::
UNKNOWNSURFACE
)
;
// // parcours de tous les brins de la carte:
// for (Dart d
=myMap.begin(); d!=
myMap.end(); myMap.next(d))
// fonction_exemple<PFP>(myMap,
position,
d);
// for (Dart d
= myMap.begin(); d !=
myMap.end(); myMap.next(d))
// fonction_exemple<PFP>(myMap,
position,
d);
// parcours de toutes les faces de la carte:
DartMarker
mf
(
myMap
);
for
(
Dart
d
=
myMap
.
begin
();
d
!=
myMap
.
end
();
myMap
.
next
(
d
))
for
(
Dart
d
=
myMap
.
begin
();
d
!=
myMap
.
end
();
myMap
.
next
(
d
))
{
if
(
!
mf
.
isMarked
(
d
))
// si d non marque:
{
fonction_exemple
<
PFP
>
(
myMap
,
position
,
d
);
fonction_exemple
<
PFP
>
(
myMap
,
position
,
d
);
// marque tous les brins de la face de d
mf
.
markOrbit
(
FACE_ORBIT
,
d
);
mf
.
markOrbit
(
FACE_ORBIT
,
d
);
}
}
...
...
@@ -170,7 +168,6 @@ int main(int argc, char **argv)
mf
.
unmarkAll
();
// instanciation of the interface
MyGlutWin
mgw
(
&
argc
,
argv
,
800
,
800
);
...
...
Apps/Examples/triangulation.cpp
View file @
a4d40b86
...
...
@@ -45,23 +45,23 @@ using namespace CGoGN ;
*/
struct
PFP
{
// definition of the
type of the
map
// definition of the map
typedef
EmbeddedMap2
<
Map2
>
MAP
;
// definition of the type of real value
typedef
float
REAL
;
// definition of the type of 3D vector
// other types definitions
typedef
Geom
::
Vector
<
3
,
REAL
>
VEC3
;
typedef
Geom
::
Vector
<
6
,
REAL
>
VEC6
;
typedef
Geom
::
Matrix
<
3
,
3
,
REAL
>
MATRIX33
;
typedef
Geom
::
Matrix
<
4
,
4
,
REAL
>
MATRIX44
;
typedef
Geom
::
Matrix
<
3
,
6
,
REAL
>
MATRIX36
;
// definition of the type of 3D vector attribute handler
typedef
AttributeHandler
<
VEC3
>
TVEC3
;
typedef
AttributeHandler
<
REAL
>
TREAL
;
};
// some hidden initializations
INIT_STATICS_MAP
();
/**
* A class for a little interface and rendering
*/
...
...
@@ -163,7 +163,6 @@ int main(int argc, char **argv)
// a handler to this attribute is returned
AttributeHandler
<
PFP
::
VEC3
>
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
"position"
);
// creation face 1 (convexe)
Dart
d1
=
myMap
.
newFace
(
5
);
...
...
Apps/Tuto/tp_master.cpp
View file @
a4d40b86
...
...
@@ -26,12 +26,9 @@
#include <time.h>
#include <algorithm>
#include "Utils/GLSLShader.h"
#include "Utils/glutwin.h"
#include "Topology/map/map2.h"
#include "Topology/generic/embeddedMap2.h"
...
...
@@ -47,20 +44,22 @@
#include "Algo/Import/import.h"
#include "Algo/Geometry/boundingbox.h"
/// pour simplifier l'ecriture du code
using
namespace
CGoGN
;
/// definition de la structure qui decrit le type de carte utilise
struct
PFP
{
// definition
de la carte
// definition
of the map
typedef
EmbeddedMap2
<
Map2
>
MAP
;
// definition
du type de reel utilis
e
// definition
of the type of real valu
e
typedef
float
REAL
;
// other types definitions
typedef
Geom
::
Vector
<
3
,
REAL
>
VEC3
;
typedef
Geom
::
Vector
<
6
,
REAL
>
VEC6
;
typedef
Geom
::
Matrix
<
3
,
3
,
REAL
>
MATRIX33
;
...
...
@@ -69,13 +68,8 @@ struct PFP
typedef
AttributeHandler
<
VEC3
>
TVEC3
;
typedef
AttributeHandler
<
REAL
>
TREAL
;
typedef
AttributeHandler
<
MATRIX33
>
TFRAME
;
typedef
AttributeHandler
<
MATRIX36
>
TRGBFUNCS
;
};
// some hidden initializations
INIT_STATICS_MAP
();
/// definition de la carte en global, plus facile
PFP
::
MAP
myMap
;
...
...
@@ -86,17 +80,12 @@ AttributeHandler<PFP::VEC3> position;
// handler d'attribut de normale par sommet
AttributeHandler
<
PFP
::
VEC3
>
normal
;
/// fonction qui renvoit vrai (appliquée à un brin)
SelectorTrue
allDarts
;
/// encore 2 typedef pour simplifier l'ecriture du code
/// encore 1 typedef pour simplifier l'ecriture du code
typedef
PFP
::
VEC3
Point3D
;
/// pile des brins selectionnes (6 max)
std
::
vector
<
Dart
>
selected_darts
;
...
...
@@ -233,11 +222,6 @@ void coupe_carre(Dart dd)
class
myGlutWin
:
public
Utils
::
SimpleGlutWin
{
public:
...
...
@@ -252,7 +236,6 @@ public:
*/
float
gWidthObj
;
Algo
::
Render
::
VBO
::
MapRender_VBO
<
PFP
>*
m_render
;
Algo
::
Render
::
VBO
::
topo_VBORenderMapD
*
m_render_topo
;
...
...
@@ -267,7 +250,6 @@ public:
*/
void
myKeyboard
(
unsigned
char
keycode
,
int
x
,
int
y
);
/**
* GL initialization
*/
...
...
@@ -298,8 +280,6 @@ public:
myGlutWin
(
int
*
argc
,
char
**
argv
,
int
winX
,
int
winY
)
:
SimpleGlutWin
(
argc
,
argv
,
winX
,
winY
),
m_render
(
NULL
),
m_render_topo
(
NULL
),
aff_help
(
true
)
{}
};
...
...
@@ -312,7 +292,7 @@ std::vector<Dart> d_edges;
std
::
vector
<
Dart
>
d_vertices
;
// fonction qui calcule la distance a utilis
é
pour la selection
// fonction qui calcule la distance a utilis
er
pour la selection
float
computeSelectRadius
(
int
x
,
int
y
,
int
pixelRadius
)
{
GLint
viewport
[
4
];
...
...
@@ -350,7 +330,6 @@ float computeSelectRadius(int x, int y, int pixelRadius)
}
void
myGlutWin
::
drawSelected
()
{
typedef
Dart
Dart
;
...
...
@@ -408,9 +387,6 @@ void myGlutWin::drawSelected()
glVertex3fv
(
P
.
data
());
}
glEnd
();
glLineWidth
(
7.0
f
);
for
(
unsigned
int
i
=
0
;
i
<
selected_darts
.
size
();
++
i
)
...
...
@@ -443,24 +419,17 @@ void myGlutWin::drawSelected()
}
}
void
myGlutWin
::
myInitGL
()
{
glClearColor
(
0.2
,
0.2
,
0.2
,
0.
);
glEnable
(
GL_DEPTH_TEST
);
glEnable
(
GL_NORMALIZE
);
glLightModeli
(
GL_LIGHT_MODEL_TWO_SIDE
,
GL_TRUE
);
glLightModeli
(
GL_LIGHT_MODEL_LOCAL_VIEWER
,
1
);
glLightfv
(
GL_LIGHT0
,
GL_DIFFUSE
,
lightZeroColor
);
glLightfv
(
GL_LIGHT0
,
GL_POSITION
,
lightZeroPosition
);
glEnable
(
GL_LIGHT0
);
}
void
myGlutWin
::
updateRender
()
...
...
@@ -482,7 +451,6 @@ void myGlutWin::updateRender()
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
0.9
f
,
0.9
f
);
}
void
myGlutWin
::
myRedraw
(
void
)
{
glClear
(
GL_COLOR_BUFFER_BIT
|
GL_DEPTH_BUFFER_BIT
);
...
...
@@ -493,7 +461,6 @@ void myGlutWin::myRedraw(void)
glScalef
(
sc
,
sc
,
sc
);
glTranslatef
(
-
gPosObj
[
0
],
-
gPosObj
[
1
],
-
gPosObj
[
2
]);
/// Affichage de la topologie si demande
glDisable
(
GL_LIGHTING
);
...
...
@@ -521,7 +488,6 @@ void myGlutWin::myRedraw(void)
//glColor3f(0.9f,0.3f,0.3f);
glColor3f
(
0.0
f
,
0.9
f
,
0.3
f
);
/// decalage pour surlignage non clignotant
glEnable
(
GL_POLYGON_OFFSET_FILL
);
glPolygonOffset
(
1.0
f
,
1.0
f
);
...
...
@@ -542,7 +508,6 @@ void myGlutWin::myRedraw(void)
glDisable
(
GL_POLYGON_OFFSET_FILL
);
glPopMatrix
();
if
(
aff_help
)
...
...
@@ -550,10 +515,8 @@ void myGlutWin::myRedraw(void)
glColor3f
(
1.0
f
,
1.0
f
,
1.0
f
);
printString2D
(
10
,
20
,
"Keys:
\n
t: affichage topologie
\n
f: selection face (position souris)
\n
a: selection aretes
\n
s: selection sommet
\n
d: selection brin
\n
0: vide la pile des brins selectionnes
\n
D: info brin"
);
}
}
void
myGlutWin
::
myKeyboard
(
unsigned
char
keycode
,
int
x
,
int
y
)
{
switch
(
keycode
)
...
...
@@ -680,8 +643,6 @@ void myGlutWin::myKeyboard(unsigned char keycode, int x, int y)
glScalef
(
sc
,
sc
,
sc
);
glTranslatef
(
-
gPosObj
[
0
],
-
gPosObj
[
1
],
-
gPosObj
[
2
]);
/// calcul du rayon
getOrthoScreenRay
(
x
,
y
,
rayA
,
rayB
);
PFP
::
VEC3
AB
=
rayB
-
rayA
;
...
...
@@ -699,8 +660,6 @@ void myGlutWin::myKeyboard(unsigned char keycode, int x, int y)
Algo
::
Selection
::
edgesRaySelection
<
PFP
>
(
myMap
,
position
,
allDarts
,
rayA
,
AB
,
d_edges
,
dist
);
glPopMatrix
();
if
(
!
d_edges
.
empty
())
...
...
@@ -728,7 +687,6 @@ void myGlutWin::myKeyboard(unsigned char keycode, int x, int y)
glScalef
(
sc
,
sc
,
sc
);
glTranslatef
(
-
gPosObj
[
0
],
-
gPosObj
[
1
],
-
gPosObj
[
2
]);
/// Rayon
getOrthoScreenRay
(
x
,
y
,
rayA
,
rayB
);
PFP
::
VEC3
AB
=
rayB
-
rayA
;
...
...
@@ -760,11 +718,6 @@ void myGlutWin::myKeyboard(unsigned char keycode, int x, int y)
break
;
}
glutPostRedisplay
();
break
;
case
'h'
:
aff_help
=!
aff_help
;
...
...
@@ -815,26 +768,24 @@ void myGlutWin::myKeyboard(unsigned char keycode, int x, int y)
}
}
int
main
(
int
argc
,
char
**
argv
)
{
/// init glut interface and
myGlutWin
mgw
(
&
argc
,
argv
,
800
,
800
);
mgw
.
init
();
// cree un handler d'attribut pour la position des points
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
"position"
);
// cree un handler pour les normales aux sommets
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
"normal"
);
if
(
argc
==
2
)
if
(
argc
==
2
)
{
bool
success
=
Algo
::
Import
::
importMesh
<
PFP
>
(
myMap
,
argv
[
1
],
position
,
Algo
::
Import
::
ImportSurfacique
::
UNKNOWNSURFACE
)
;
std
::
vector
<
std
::
string
>
attrNames
;
Algo
::
Import
::
importMesh
<
PFP
>
(
myMap
,
argv
[
1
],
attrNames
)
;
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
attrNames
[
0
])
;
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
"normal"
);
mgw
.
updateRender
();
}
else
{
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
"position"
);
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
"normal"
);
createMap
();
mgw
.
updateRender
();
// ne pas oublier de mettre à jour openGL après chaque modif dans la carte
}
...
...
@@ -846,7 +797,6 @@ int main(int argc, char **argv)
mgw
.
gWidthObj
=
std
::
max
<
PFP
::
REAL
>
(
std
::
max
<
PFP
::
REAL
>
(
bb
.
size
(
0
),
bb
.
size
(
1
)),
bb
.
size
(
2
));
mgw
.
gPosObj
=
(
bb
.
min
()
+
bb
.
max
())
/
PFP
::
REAL
(
2
);
mgw
.
mainLoop
();
return
0
;
...
...
Apps/Tuto/tuto1.cpp
View file @
a4d40b86
...
...
@@ -58,10 +58,6 @@ struct PFP
};
// some hidden initializations
INIT_STATICS_MAP
();
/**
* A class for a little interface and rendering
*/
...
...
Apps/Tuto/tuto2.cpp
View file @
a4d40b86
...
...
@@ -56,9 +56,6 @@ struct PFP {
typedef
AttributeHandler
<
VEC3
>
TVEC3
;
};
// qq initialisation cachees (car penible syntaxiquement)
INIT_STATICS_MAP
();
PFP
::
MAP
myMap
;
...
...
Apps/Tuto/tuto3.cpp
View file @
a4d40b86
...
...
@@ -56,10 +56,6 @@ struct PFP {
typedef
AttributeHandler
<
VEC3
>
TVEC3
;
};
// qq initialisation cachees (car penible syntaxiquement)
INIT_STATICS_MAP
();
PFP
::
MAP
myMap
;
SelectorTrue
allDarts
;
...
...
Apps/Tuto/tuto4.cpp
View file @
a4d40b86
...
...
@@ -58,10 +58,6 @@ struct PFP {
typedef
AttributeHandler
<
VEC3
>
TVEC3
;
};
// qq initialisation cachees (car penible syntaxiquement)
INIT_STATICS_MAP
();
PFP
::
MAP
myMap
;
SelectorTrue
allDarts
;
...
...
Apps/Tuto/tuto5.cpp
View file @
a4d40b86
...
...
@@ -70,10 +70,6 @@ struct PFP {
typedef
AttributeHandler
<
VEC3
>
TVEC3
;
};
// qq initialisation cachees (car penible syntaxiquement)
INIT_STATICS_MAP
();
PFP
::
MAP
myMap
;
SelectorTrue
allDarts
;
PFP
::
TVEC3
position
;
...
...
@@ -417,10 +413,9 @@ void myGlutWin::myKeyboard(unsigned char keycode, int x, int y)
int
main
(
int
argc
,
char
**
argv
)
{
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
"position"
);
Algo
::
Import
::
importInESS
<
PFP
>
(
myMap
,
position
,
argv
[
1
]);
std
::
vector
<
std
::
string
>
attrNames
;
Algo
::
Import
::
importInESS
<
PFP
>
(
myMap
,
argv
[
1
],
attrNames
);
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
attrNames
[
0
])
;
//plongement
// Algo::Modelisation::Primitive3D<PFP> prim(myMap,position);
...
...
Apps/Tuto/tuto_subdivision.cpp
View file @
a4d40b86
...
...
@@ -44,11 +44,13 @@ using namespace CGoGN ;
*/
struct
PFP
{
// definition of the
type of the
map
// definition of the map
typedef
EmbeddedMap2
<
Map2
>
MAP
;
// definition of the type of real value
typedef
float
REAL
;
// other types definitions
typedef
Geom
::
Vector
<
3
,
REAL
>
VEC3
;
typedef
Geom
::
Vector
<
6
,
REAL
>
VEC6
;
typedef
Geom
::
Matrix
<
3
,
3
,
REAL
>
MATRIX33
;
...
...
@@ -57,15 +59,9 @@ struct PFP
typedef
AttributeHandler
<
VEC3
>
TVEC3
;
typedef
AttributeHandler
<
REAL
>
TREAL
;
typedef
AttributeHandler
<
MATRIX33
>
TFRAME
;
typedef
AttributeHandler
<
MATRIX36
>
TRGBFUNCS
;
};
// some hidden initializations
INIT_STATICS_MAP
();
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
!=
3
)
...
...
@@ -83,11 +79,11 @@ int main(int argc, char **argv)
// declaration of the map
PFP
::
MAP
myMap
;
// 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"
);
std
::
vector
<
std
::
string
>
attrNames
;
Algo
::
Import
::
importMesh
<
PFP
>
(
myMap
,
argv
[
1
],
attrNames
);
Algo
::
Import
::
importMesh
<
PFP
>
(
myMap
,
argv
[
1
],
position
,
Algo
::
Import
::
ImportSurfacique
::
UNKNOWNSURFACE
);
// get a handler to the 3D vector attribute created by the import
AttributeHandler
<
PFP
::
VEC3
>
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
attrNames
[
0
]);
for
(
unsigned
int
i
=
0
;
i
<
nbSteps
;
++
i
)
Algo
::
Modelisation
::
LoopSubdivision
<
PFP
,
AttributeHandler
<
PFP
::
VEC3
>
,
PFP
::
VEC3
>
(
myMap
,
position
);
...
...
include/Algo/Import/import.h
View file @
a4d40b86
...
...
@@ -63,16 +63,16 @@ bool importMesh(typename PFP::MAP& map, const std::string& filename, typename PF
* TODO a transformer en utilisant un MeshTableVolume.
*/
template
<
typename
PFP
>
bool
importOFFWithELERegions
(
typename
PFP
::
MAP
&
the_map
,
c
har
*
filenameOFF
,
char
*
filenameELE
,
std
::
vector
<
std
::
string
>&
attrNames
);
bool
importOFFWithELERegions
(
typename
PFP
::
MAP
&
the_map
,
c
onst
std
::
string
&
filenameOFF
,
const
std
::
string
&
filenameELE
,
std
::
vector
<
std
::
string
>&
attrNames
);
template
<
typename
PFP
>
bool
importTet
(
typename
PFP
::
MAP
&
the_map
,
c
har
*
filename
,
std
::
vector
<
std
::
string
>&
attrNames
,
float
scaleFactor
=
1.0
f
);
bool
importTet
(
typename
PFP
::
MAP
&
the_map
,
c
onst
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
,
float
scaleFactor
=
1.0
f
);
template
<
typename
PFP
>
bool
importTs
(
typename
PFP
::
MAP
&
the_map
,
c
har
*
filename
,
std
::
vector
<
std
::
string
>&
attrNames
,
float
scaleFactor
=
1.0
f
);
bool
importTs
(
typename
PFP
::
MAP
&
the_map
,
c
onst
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
,
float
scaleFactor
=
1.0
f
);
template
<
typename
PFP
>
bool
importInESS
(
typename
PFP
::
MAP
&
the_map
,
c
har
*
filename
,
std
::
vector
<
std
::
string
>&
attrNames
);
bool
importInESS
(
typename
PFP
::
MAP
&
the_map
,
c
onst
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
);
}
// namespace Import
...
...
include/Algo/Import/importInESS.hpp
View file @
a4d40b86
...
...
@@ -33,7 +33,7 @@ namespace Import
{
template
<
typename
PFP
>
typename
PFP
::
VEC3
stringToEmb
(
std
::
string
&
s
)
typename
PFP
::
VEC3
stringToEmb
(
std
::
string
s
)
{
if
(
s
[
0
]
==
'('
)
s
.
erase
(
0
,
2
);
...
...
@@ -55,7 +55,7 @@ typename PFP::VEC3 stringToEmb(std::string& s)
}
template
<
typename
PFP
>
bool
importInESS
(
typename
PFP
::
MAP
&
map
,
c
har
*
filename
,
std
::
vector
<
std
::
string
>&
attrNames
)
bool
importInESS
(
typename
PFP
::
MAP
&
map
,
c
onst
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
)
{
typedef
typename
PFP
::
VEC3
VEC3
;
...
...
@@ -64,10 +64,10 @@ bool importInESS(typename PFP::MAP& map, char* filename, std::vector<std::string
attrNames
.
push_back
(
position
.
name
())
;
// open file
std
::
ifstream
fp
(
filename
,
std
::
ios
::
in
);
std
::
ifstream
fp
(
filename
.
c_str
()
,
std
::
ios
::
in
);
if
(
!
fp
.
good
())
{
std
::
cerr
<<
"Unable to open file "
<<
filename
<<
std
::
endl
;
std
::
cerr
<<
"Unable to open file "
<<
filename
<<
std
::
endl
;
return
false
;
}
...
...
@@ -83,9 +83,9 @@ bool importInESS(typename PFP::MAP& map, char* filename, std::vector<std::string
// First column
//Bounding box : first coord & second coord
bg
=
line
.
substr
(
0
,
posData
);
bg
=
line
.
substr
(
0
,
posData
);
posCoord
=
bg
.
find
(
") ("
);
stringToEmb
<
PFP
>
(
bg
.
substr
(
0
,
posCoord
));
stringToEmb
<
PFP
>
(
bg
.
substr
(
0
,
posCoord
));
stringToEmb
<
PFP
>
(
bg
.
substr
(
posCoord
+
3
));
while
(
std
::
getline
(
fp
,
line
)
)
...
...
@@ -94,7 +94,7 @@ bool importInESS(typename PFP::MAP& map, char* filename, std::vector<std::string
// First column
//Bounding box : first coord & second coord
bg
=
line
.
substr
(
0
,
posData
);
bg
=
line
.
substr
(
0
,
posData
);
posCoord
=
bg
.
find
(
") ("
);
stringToEmb
<
PFP
>
(
bg
.
substr
(
0
,
posCoord
));
stringToEmb
<
PFP
>
(
bg
.
substr
(
posCoord
+
3
));
...
...
@@ -102,7 +102,7 @@ bool importInESS(typename PFP::MAP& map, char* filename, std::vector<std::string
//Second column
bg
=
line
.
substr
(
posData
+
1
);
posCoord
=
bg
.
find
(
") ("
);
stringToEmb
<
PFP
>
(
bg
.
substr
(
0
,
posCoord
));
stringToEmb
<
PFP
>
(
bg
.
substr
(
0
,
posCoord
));
stringToEmb
<
PFP
>
(
bg
.
substr
(
posCoord
+
3
));
++
count
;
...
...
include/Algo/Import/importObjEle.hpp
View file @
a4d40b86
...
...
@@ -35,7 +35,7 @@ namespace Import
{
template
<
typename
PFP
>
bool
importOFFWithELERegions
(
typename
PFP
::
MAP
&
map
,
c
har
*
filenameOFF
,
char
*
filenameELE
,
std
::
vector
<
std
::
string
>&
attrNames
)
bool
importOFFWithELERegions
(
typename
PFP
::
MAP
&
map
,
c
onst
std
::
string
&
filenameOFF
,
const
std
::
string
&
filenameELE
,
std
::
vector
<
std
::
string
>&
attrNames
)
{
typedef
typename
PFP
::
VEC3
VEC3
;
...
...
@@ -48,14 +48,14 @@ bool importOFFWithELERegions(typename PFP::MAP& map, char* filenameOFF, char * f
AutoAttributeHandler
<
NoMathIONameAttribute
<
std
::
vector
<
Dart
>
>
>
vecDartsPerVertex
(
map
,
VERTEX_ORBIT
,
"incidents"
);
// open files
std
::
ifstream
foff
(
filenameOFF
,
std
::
ios
::
in
);
std
::
ifstream
foff
(
filenameOFF
.
c_str
()
,
std
::
ios
::
in
);
if
(
!
foff
.
good
())
{
std
::
cerr
<<
"Unable to open OFF file "
<<
std
::
endl
;
return
false
;
}
std
::
ifstream
fele
(
filenameELE
,
std
::
ios
::
in
);
std
::
ifstream
fele
(
filenameELE
.
c_str
()
,
std
::
ios
::
in
);
if
(
!
fele
.
good
())
{
std
::
cerr
<<
"Unable to open ELE file "
<<
std
::
endl
;
...
...
@@ -65,7 +65,7 @@ bool importOFFWithELERegions(typename PFP::MAP& map, char* filenameOFF, char * f
std
::
string
line
;
//OFF reading
std
::
getline
(
foff
,
line
);