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
c3509197
Commit
c3509197
authored
Nov 23, 2011
by
Thomas
Browse files
Merge branch 'master' of cgogn.u-strasbg.fr:CGoGN
parents
2629514a
9d09fe01
Changes
24
Hide whitespace changes
Inline
Side-by-side
Apps/Examples/decimationVolumique.cpp
View file @
c3509197
...
...
@@ -321,8 +321,8 @@ void MyGlutWin::initGUI()
void
maillageTest
()
{
/// on creer une carte
Dart
dd
=
Algo
::
Modelisation
::
Polyhedron
<
PFP
>::
create
Oriented
Polyhedron
(
myMap
,
4
);
Dart
ee
=
Algo
::
Modelisation
::
Polyhedron
<
PFP
>::
create
Oriented
Polyhedron
(
myMap
,
4
);
Dart
dd
=
Algo
::
Modelisation
::
Polyhedron
<
PFP
>::
createPolyhedron
(
myMap
,
4
);
Dart
ee
=
Algo
::
Modelisation
::
Polyhedron
<
PFP
>::
createPolyhedron
(
myMap
,
4
);
myMap
.
sewVolumes
(
dd
,
ee
);
// plongement
...
...
Apps/Examples/simpleGMap2.cpp
View file @
c3509197
...
...
@@ -31,7 +31,7 @@ SimpleGMap2::SimpleGMap2()
{
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
Dart
d
=
Algo
::
Modelisation
::
Polyhedron
<
PFP
>::
create
Oriented
Tetra
(
myMap
);
Dart
d
=
Algo
::
Modelisation
::
Polyhedron
<
PFP
>::
createTetra
(
myMap
);
position
[
d
]
=
VEC3
(
0
,
0
,
0
);
position
[
myMap
.
phi1
(
d
)]
=
VEC3
(
10
,
0
,
15
);
position
[
myMap
.
phi_1
(
d
)]
=
VEC3
(
10
,
20
,
15
);
...
...
Apps/Examples/squelette3carte.cpp
View file @
c3509197
...
...
@@ -269,8 +269,8 @@ void MyGlutWin::initGUI()
void
maillageTest
()
{
/// on creer une carte
Dart
dd
=
Algo
::
Modelisation
::
Polyhedron
<
PFP
>::
create
Oriented
Polyhedron
(
myMap
,
4
);
Dart
ee
=
Algo
::
Modelisation
::
Polyhedron
<
PFP
>::
create
Oriented
Polyhedron
(
myMap
,
4
);
Dart
dd
=
Algo
::
Modelisation
::
Polyhedron
<
PFP
>::
createPolyhedron
(
myMap
,
4
);
Dart
ee
=
Algo
::
Modelisation
::
Polyhedron
<
PFP
>::
createPolyhedron
(
myMap
,
4
);
myMap
.
sewVolumes
(
dd
,
ee
);
// plongement
...
...
include/Algo/Export/exportPov.h
View file @
c3509197
...
...
@@ -3,6 +3,7 @@
#include
"Topology/generic/attributeHandler.h"
#include
"Utils/cgognStream.h"
#include
"Algo/Geometry/normal.h"
namespace
CGoGN
{
...
...
@@ -45,7 +46,7 @@ void exportMeshPlain(std::ofstream& out, typename PFP::MAP& map, typename PFP::T
unsigned
int
nb
=
0
;
Dart
dd
=
d
;
do
{
traite
.
mark
Orbit
(
DART
,
dd
);
traite
.
mark
(
dd
);
dd
=
map
.
phi1
(
dd
);
nb
++
;
}
while
(
dd
!=
d
);
...
...
@@ -69,6 +70,104 @@ void exportMeshPlain(std::ofstream& out, typename PFP::MAP& map, typename PFP::T
out
<<
"}"
<<
std
::
endl
;
}
template
<
typename
PFP
>
void
export3MeshPlainSmooth
(
std
::
ofstream
&
out
,
typename
PFP
::
MAP
&
map
,
typename
PFP
::
TVEC3
&
position
,
const
std
::
string
&
meshName
,
const
FunctorSelect
&
good
=
SelectorTrue
())
{
typedef
typename
PFP
::
VEC3
VEC3
;
out
<<
"#declare "
<<
meshName
<<
"= mesh2 {"
<<
std
::
endl
;
unsigned
int
nbDarts
=
map
.
getNbDarts
()
;
//vector containing the degree of faces
std
::
vector
<
unsigned
int
>
facesSize
;
//vector containing the list of index of vertices
std
::
vector
<
std
::
vector
<
unsigned
int
>
>
facesIdx
;
facesSize
.
reserve
(
nbDarts
/
3
)
;
facesIdx
.
reserve
(
nbDarts
/
3
)
;
//map : attribute place / index in declaration (for vertices and normals)
std
::
map
<
unsigned
int
,
unsigned
int
>
vIndex
;
//index : start from 0 and increase (used to ignore the gaps potentially present in the container)
unsigned
int
vCpt
=
0
;
//remember the attribute lines
std
::
vector
<
unsigned
int
>
vertices
;
std
::
vector
<
VEC3
>
normals
;
vertices
.
reserve
(
nbDarts
/
6
)
;
normals
.
reserve
(
nbDarts
/
6
)
;
CellMarker
markV
(
map
,
VERTEX
)
;
DartMarker
markF
(
map
)
;
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
{
if
(
good
(
d
)
&&
!
markF
.
isMarked
(
d
)
&&
map
.
phi3
(
d
)
==
d
)
{
markF
.
markOrbit
(
FACE
,
d
)
;
std
::
vector
<
unsigned
int
>
fidx
;
fidx
.
reserve
(
4
)
;
Dart
dd
=
d
;
do
{
unsigned
int
vNum
=
map
.
getEmbedding
(
VERTEX
,
dd
)
;
if
(
!
markV
.
isMarked
(
dd
))
{
markV
.
mark
(
dd
)
;
VEC3
norm
=
Algo
::
Geometry
::
vertexBorderNormal
<
PFP
>
(
map
,
dd
,
position
);
vIndex
[
vNum
]
=
vCpt
++
;
vertices
.
push_back
(
vNum
)
;
normals
.
push_back
(
norm
)
;
}
fidx
.
push_back
(
vIndex
[
vNum
])
;
dd
=
map
.
phi1
(
dd
)
;
}
while
(
dd
!=
d
)
;
facesSize
.
push_back
(
map
.
faceDegree
(
d
))
;
facesIdx
.
push_back
(
fidx
)
;
}
}
//export all vertices
out
<<
"vertex_vectors {"
<<
std
::
endl
;
out
<<
vertices
.
size
()
<<
","
<<
std
::
endl
;
for
(
unsigned
int
i
=
0
;
i
<
vertices
.
size
();
++
i
)
{
const
VEC3
&
v
=
position
[
vertices
[
i
]]
;
out
<<
"<"
<<
v
[
0
]
<<
", "
<<
v
[
1
]
<<
", "
<<
v
[
2
]
<<
">"
<<
std
::
endl
;
}
out
<<
"}"
<<
std
::
endl
;
//export all normals
out
<<
"normal_vectors {"
<<
std
::
endl
;
out
<<
normals
.
size
()
<<
","
<<
std
::
endl
;
for
(
unsigned
int
i
=
0
;
i
<
normals
.
size
();
++
i
)
{
const
VEC3
&
v
=
normals
[
i
];
out
<<
"<"
<<
v
[
0
]
<<
", "
<<
v
[
1
]
<<
", "
<<
v
[
2
]
<<
">"
<<
std
::
endl
;
}
out
<<
"}"
<<
std
::
endl
;
//export all faces
out
<<
"face_indices {"
<<
std
::
endl
;
out
<<
facesSize
.
size
()
<<
","
<<
std
::
endl
;
for
(
unsigned
int
i
=
0
;
i
<
facesSize
.
size
();
++
i
)
{
out
<<
"<"
<<
facesIdx
[
i
][
0
];
for
(
unsigned
int
j
=
1
;
j
<
facesIdx
[
i
].
size
();
++
j
)
out
<<
", "
<<
facesIdx
[
i
][
j
]
;
out
<<
">"
<<
std
::
endl
;
}
out
<<
"}"
<<
std
::
endl
;
out
<<
"}"
<<
std
::
endl
;
}
template
<
typename
PFP
>
void
exportMeshWire
(
std
::
ofstream
&
out
,
typename
PFP
::
MAP
&
map
,
typename
PFP
::
TVEC3
&
position
,
const
std
::
string
&
meshName
,
const
FunctorSelect
&
good
=
SelectorTrue
())
{
...
...
@@ -134,7 +233,8 @@ bool exportScenePov(typename PFP::MAP& map, typename PFP::TVEC3& position, const
out
<<
"global_settings {"
<<
std
::
endl
;
out
<<
"radiosity {"
<<
std
::
endl
;
out
<<
"pretrace_start 0.08 pretrace_end 0.04"
<<
std
::
endl
;
out
<<
"count 100 nearest_count 10 error_bound 0.15 recursion_limit 1 low_error_factor 0.2 gray_threshold 0.0 minimum_reuse 0.015 brightness 1 adc_bailout 0.01/2 normal off media off} max_trace_level 255}"
<<
std
::
endl
;
out
<<
"count 100 nearest_count 10 error_bound 0.15 recursion_limit 1 low_error_factor 0.2 gray_threshold 0.0 minimum_reuse 0.015 brightness 1 adc_bailout 0.01/2 normal off media off}"
<<
std
::
endl
;
out
<<
"max_trace_level 255}"
<<
std
::
endl
;
Algo
::
ExportPov
::
exportMeshPlain
<
PFP
>
(
out
,
map
,
position
,
"myMesh"
,
good
);
...
...
@@ -147,6 +247,51 @@ bool exportScenePov(typename PFP::MAP& map, typename PFP::TVEC3& position, const
return
true
;
}
template
<
typename
PFP
>
bool
exportScenePovSmooth
(
typename
PFP
::
MAP
&
map
,
typename
PFP
::
TVEC3
&
position
,
const
std
::
string
&
filename
,
typename
PFP
::
VEC3
cameraPos
,
typename
PFP
::
VEC3
cameraLook
,
typename
PFP
::
VEC3
translate
,
float
angle_X
,
float
angle_Y
,
float
angle_Z
,
const
FunctorSelect
&
good
=
SelectorTrue
())
{
std
::
ofstream
out
(
filename
.
c_str
(),
std
::
ios
::
out
);
if
(
!
out
.
good
())
{
CGoGNerr
<<
"(export) Unable to open file "
<<
filename
<<
CGoGNendl
;
return
false
;
}
float
angleX
=
angle_X
;
float
angleY
=
angle_Y
;
float
angleZ
=
angle_Z
;
//define the camera position
out
<<
"camera { location <"
<<
cameraPos
[
0
]
<<
","
<<
cameraPos
[
1
]
<<
","
<<
cameraPos
[
2
]
<<
"> look_at <"
<<
cameraLook
[
0
]
<<
","
<<
cameraLook
[
1
]
<<
","
<<
cameraLook
[
2
]
<<
">}"
<<
std
::
endl
;
//set a "infinite" plane
// out << "plane { y, -1 pigment { color rgb 1 } }" << std::endl;
//set a sky sphere
out
<<
"sphere { <0, 0, 0>, 5000"
;
out
<<
"texture{ pigment { color rgb <1, 1, 1>} finish { ambient 1 diffuse 0 } } }"
<<
std
::
endl
;
//put some lights
out
<<
"light_source { <"
<<
cameraPos
[
0
]
<<
","
<<
cameraPos
[
1
]
<<
","
<<
cameraPos
[
2
]
<<
"> color rgb 0.45}"
<<
std
::
endl
;
//set a high quality rendering
out
<<
"global_settings {"
<<
std
::
endl
;
// out << "radiosity {" << std::endl;
// out << "pretrace_start 0.08 pretrace_end 0.04" << std::endl;
// out << "count 300 nearest_count 10 error_bound 0.15 recursion_limit 1 low_error_factor 0.2 gray_threshold 0.0 minimum_reuse 0.015 brightness 1 adc_bailout 0.01/2 normal off media off}" << std::endl;
out
<<
"max_trace_level 60}"
<<
std
::
endl
;
Algo
::
ExportPov
::
export3MeshPlainSmooth
<
PFP
>
(
out
,
map
,
position
,
"myMesh"
,
good
);
out
<<
"object {myMesh"
<<
std
::
endl
;
out
<<
"translate <"
<<
translate
[
0
]
<<
","
<<
translate
[
1
]
<<
","
<<
translate
[
2
]
<<
">"
<<
std
::
endl
;
out
<<
"rotate <"
<<
angleX
<<
","
<<
angleY
<<
","
<<
angleZ
<<
"> "
<<
std
::
endl
;
out
<<
"double_illuminate"
<<
std
::
endl
;
out
<<
"texture{ pigment{ color rgb <0.5,1.0,0.5>} finish { ambient 0.5 roughness 0.2 } } }"
<<
std
::
endl
;
out
.
close
();
return
true
;
}
}
}
...
...
include/Algo/Geometry/normal.h
View file @
c3509197
...
...
@@ -39,12 +39,18 @@ namespace Geometry
template
<
typename
PFP
>
typename
PFP
::
VEC3
triangleNormal
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
position
)
;
template
<
typename
PFP
>
typename
PFP
::
VEC3
newellNormal
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
position
);
template
<
typename
PFP
>
typename
PFP
::
VEC3
faceNormal
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
position
)
;
template
<
typename
PFP
>
typename
PFP
::
VEC3
vertexNormal
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
position
)
;
template
<
typename
PFP
>
typename
PFP
::
VEC3
vertexBorderNormal
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
position
)
;
template
<
typename
PFP
>
void
computeNormalFaces
(
typename
PFP
::
MAP
&
map
,
const
typename
PFP
::
TVEC3
&
position
,
typename
PFP
::
TVEC3
&
face_normal
,
const
FunctorSelect
&
select
=
SelectorTrue
(),
unsigned
int
thread
=
0
)
;
...
...
include/Algo/Geometry/normal.hpp
View file @
c3509197
...
...
@@ -116,6 +116,40 @@ typename PFP::VEC3 vertexNormal(typename PFP::MAP& map, Dart d, const typename P
return
N
;
}
template
<
typename
PFP
>
typename
PFP
::
VEC3
vertexBorderNormal
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
position
)
{
assert
(
map
.
dimension
()
==
3
);
typedef
typename
PFP
::
VEC3
VEC3
;
VEC3
N
(
0
)
;
std
::
vector
<
Dart
>
faces
;
CellMarker
f
(
map
,
FACE
);
FunctorStore
fs
(
faces
);
map
.
foreach_dart_of_oriented_vertex
(
d
,
fs
);
for
(
std
::
vector
<
Dart
>::
iterator
it
=
faces
.
begin
()
;
it
!=
faces
.
end
()
;
++
it
)
{
if
(
!
f
.
isMarked
(
*
it
)
&&
map
.
phi3
(
*
it
)
==*
it
)
{
f
.
mark
(
*
it
);
VEC3
n
=
faceNormal
<
PFP
>
(
map
,
*
it
,
position
);
if
(
!
n
.
hasNan
())
{
VEC3
v1
=
vectorOutOfDart
<
PFP
>
(
map
,
*
it
,
position
);
VEC3
v2
=
vectorOutOfDart
<
PFP
>
(
map
,
map
.
phi_1
(
*
it
),
position
);
n
*=
convexFaceArea
<
PFP
>
(
map
,
*
it
,
position
)
/
(
v1
.
norm2
()
*
v2
.
norm2
());
N
+=
n
;
}
}
}
N
.
normalize
()
;
return
N
;
}
template
<
typename
PFP
>
void
computeNormalFaces
(
typename
PFP
::
MAP
&
map
,
const
typename
PFP
::
TVEC3
&
position
,
typename
PFP
::
TVEC3
&
face_normal
,
const
FunctorSelect
&
select
,
unsigned
int
thread
)
{
...
...
include/Algo/Import/importObjEle.hpp
View file @
c3509197
...
...
@@ -146,8 +146,8 @@ bool importOFFWithELERegions(typename PFP::MAP& map, const std::string& filename
oss
>>
nbe
;
// CGoGNout << "tetra number : " << nbe << CGoGNendl;
//Algo::Modelisation::Polyhedron<PFP>::create
Oriented
Tetra(map);
Dart
d
=
Algo
::
Modelisation
::
Polyhedron
<
PFP
>::
create
Oriented
Polyhedron
(
map
,
4
);
//Algo::Modelisation::Polyhedron<PFP>::createTetra(map);
Dart
d
=
Algo
::
Modelisation
::
Polyhedron
<
PFP
>::
createPolyhedron
(
map
,
4
);
Geom
::
Vec4ui
pt
;
oss
>>
pt
[
0
];
oss
>>
pt
[
1
];
...
...
include/Algo/Import/importTet.hpp
View file @
c3509197
...
...
@@ -43,10 +43,10 @@ bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector<
AttributeContainer
&
container
=
map
.
getAttributeContainer
(
VERTEX
)
;
unsigned
int
m_nbVertices
=
0
,
m_nbFaces
=
0
,
m_nbEdges
=
0
,
m_nbVolumes
=
0
;
unsigned
int
m_nbVertices
=
0
,
m_nbVolumes
=
0
;
AutoAttributeHandler
<
NoMathIONameAttribute
<
std
::
vector
<
Dart
>
>
>
vecDartsPerVertex
(
map
,
VERTEX
,
"incidents"
);
//
open file
//open file
std
::
ifstream
fp
(
filename
.
c_str
(),
std
::
ios
::
in
);
if
(
!
fp
.
good
())
{
...
...
@@ -56,20 +56,17 @@ bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector<
std
::
string
ligne
;
unsigned
int
nbv
,
nbt
;
//
lecture des
n
o
mb
res de sommets/tetra
//
reading
n
u
mb
er of vertices
std
::
getline
(
fp
,
ligne
);
std
::
stringstream
oss
(
ligne
);
oss
>>
nbv
;
//CGoGNout << "nbV = " << nbv << CGoGNendl;
// reading number of tetrahedra
std
::
getline
(
fp
,
ligne
);
std
::
stringstream
oss2
(
ligne
);
oss2
>>
nbt
;
//CGoGNout << "nbT = " << nbt << CGoGNendl;
//lecture sommets
//reading vertices
std
::
vector
<
unsigned
int
>
verticesID
;
verticesID
.
reserve
(
nbv
);
for
(
unsigned
int
i
=
0
;
i
<
nbv
;
++
i
)
...
...
@@ -85,32 +82,27 @@ bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector<
oss
>>
x
;
oss
>>
y
;
oss
>>
z
;
//
on peut ajouter ici la lecture de couleur si elle exist
e
//
TODO : if required read other vertices attributes her
e
VEC3
pos
(
x
*
scaleFactor
,
y
*
scaleFactor
,
z
*
scaleFactor
);
//CGoGNout << "VEC3 = " << pos << CGoGNendl;
//
CGoGNout << "VEC3 = " << pos << CGoGNendl;
unsigned
int
id
=
container
.
insertLine
();
position
[
id
]
=
pos
;
verticesID
.
push_back
(
id
);
}
m_nbVertices
=
verticesID
.
size
()
;
m_nbVertices
=
nbv
;
//CGoGNout << "nbVertices = " << m_nbVertices << CGoGNendl;
m_nbVolumes
=
nbt
;
//CGoGNout << "nbVolumes = " << m_nbVolumes << CGoGNendl;
// lecture tetra
// normalement m_nbVolumes*12 (car on ne charge que des tetra)
m_nbFaces
=
nbt
*
4
;
CGoGNout
<<
"nb points = "
<<
m_nbVertices
<<
" / nb faces = "
<<
m_nbFaces
<<
" / nb edges = "
<<
m_nbEdges
<<
" / nb tet = "
<<
m_nbVolumes
<<
CGoGNendl
;
CGoGNout
<<
"nb points = "
<<
m_nbVertices
<<
" / nb tet = "
<<
m_nbVolumes
<<
CGoGNendl
;
//Read and embed tetrahedr
a TODO
//Read and embed
all
tetrahedr
ons
for
(
unsigned
int
i
=
0
;
i
<
m_nbVolumes
;
++
i
)
{
//start one tetra
int
nbe
;
do
{
...
...
@@ -118,59 +110,53 @@ bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector<
}
while
(
ligne
.
size
()
==
0
);
std
::
stringstream
oss
(
ligne
);
oss
>>
nbe
;
// CGoGNout << "tetra number : " << nbe << CGoGNendl
;
oss
>>
nbe
;
//number of vertices =4
assert
(
nbe
==
4
)
;
//Algo::Modelisation::Polyhedron<PFP>::createOrientedTetra(map);
Dart
d
=
Algo
::
Modelisation
::
Polyhedron
<
PFP
>::
createOrientedPolyhedron
(
map
,
4
);
Dart
d
=
Algo
::
Modelisation
::
Polyhedron
<
PFP
>::
createPolyhedron
(
map
,
4
);
Geom
::
Vec4ui
pt
;
oss
>>
pt
[
0
];
oss
>>
pt
[
1
];
oss
>>
pt
[
2
];
oss
>>
pt
[
3
];
//regions
?
oss
>>
nbe
;
//
if
regions
are defined use this number
oss
>>
nbe
;
//ignored here
// CGoGNout << "\t embedding number : " << pt[0] << " " << pt[1] << " " << pt[2] << " " << pt[3] << CGoGNendl;
// Embed three vertices
// Embed three
"base"
vertices
for
(
unsigned
int
j
=
0
;
j
<
3
;
++
j
)
{
// CGoGNout << "\t embedding number : " << pt[j];
FunctorSetEmb
<
typename
PFP
::
MAP
>
femb
(
map
,
VERTEX
,
verticesID
[
pt
[
j
]]);
map
.
foreach_dart_of_vertex
(
d
,
femb
);
//apply foreach for gmaps : cannot be included in the following loop
//store darts per vertices to optimize reconstruction
Dart
dd
=
d
;
do
{
femb
(
dd
);
//vecDartPtrEmb[pt[j]].push_back(dd);
vecDartsPerVertex
[
pt
[
j
]].
push_back
(
dd
);
dd
=
map
.
phi1
(
map
.
phi2
(
dd
));
}
while
(
dd
!=
d
);
d
=
map
.
phi1
(
d
);
// CGoGNout << " done" << CGoGNendl;
}
//Embed the last vertex
// CGoGNout << "\t embedding number : " << pt[3] << CGoGNendl;
//Embed the last "top" vertex
d
=
map
.
phi_1
(
map
.
phi2
(
d
));
FunctorSetEmb
<
typename
PFP
::
MAP
>
femb
(
map
,
VERTEX
,
verticesID
[
pt
[
3
]]);
map
.
foreach_dart_of_vertex
(
d
,
femb
);
//apply foreach for gmaps : cannot be included in the following loop
//store darts per vertices to optimize reconstruction
Dart
dd
=
d
;
do
{
femb
(
dd
);
// CGoGNout << "embed" << CGoGNendl;
//vecDartPtrEmb[pt[3]].push_back(dd);
vecDartsPerVertex
[
pt
[
3
]].
push_back
(
dd
);
dd
=
map
.
phi1
(
map
.
phi2
(
dd
));
}
while
(
dd
!=
d
);
//
CGoGNout << "
end tetra
" << CGoGNendl;
//end
of
tetra
}
// CGoGNout << "end 1/2" << CGoGNendl;
...
...
include/Algo/Import/importTs.hpp
View file @
c3509197
...
...
@@ -131,8 +131,8 @@ bool importTs(typename PFP::MAP& map, const std::string& filename, std::vector<s
std
::
stringstream
oss
(
ligne
);
// CGoGNout << "tetra number : " << nbe << CGoGNendl;
//Algo::Modelisation::Polyhedron<PFP>::create
Oriented
Tetra(map);
Dart
d
=
Algo
::
Modelisation
::
Polyhedron
<
PFP
>::
create
Oriented
Polyhedron
(
map
,
4
);
//Algo::Modelisation::Polyhedron<PFP>::createTetra(map);
Dart
d
=
Algo
::
Modelisation
::
Polyhedron
<
PFP
>::
createPolyhedron
(
map
,
4
);
Geom
::
Vec4ui
pt
;
oss
>>
pt
[
0
];
oss
>>
pt
[
1
];
...
...
include/Algo/Modelisation/polyhedron.h
View file @
c3509197
...
...
@@ -170,27 +170,27 @@ public:
/**
* create simple simple polyhedron (not handled by Polyhedron object)
*/
static
Dart
create
Oriented
Polyhedron
(
typename
PFP
::
MAP
&
the_map
,
int
nbFaces
);
static
Dart
createPolyhedron
(
typename
PFP
::
MAP
&
the_map
,
int
nbFaces
);
/**
* create simple simple tetrahedron (not handled by Polyhedron object)
*/
static
Dart
create
Oriented
Tetra
(
typename
PFP
::
MAP
&
the_map
);
static
Dart
createTetra
(
typename
PFP
::
MAP
&
the_map
);
/**
* create simple simple pyramid (not handled by Polyhedron object)
*/
static
Dart
create
Oriented
Pyra
(
typename
PFP
::
MAP
&
the_map
);
static
Dart
createPyra
(
typename
PFP
::
MAP
&
the_map
);
/**
* create simple simple hexaedron (not handled by Polyhedron object)
*/
static
Dart
create
Oriented
Hexa
(
typename
PFP
::
MAP
&
the_map
);
static
Dart
createHexa
(
typename
PFP
::
MAP
&
the_map
);
/**
* create simple simple prism (not handled by Polyhedron object)
*/
static
Dart
create
Oriented
Prism
(
typename
PFP
::
MAP
&
the_map
);
static
Dart
createPrism
(
typename
PFP
::
MAP
&
the_map
);
/*
* get the reference dart
...
...
include/Algo/Modelisation/polyhedron.hpp
View file @
c3509197
...
...
@@ -167,7 +167,7 @@ m_positions(p1.m_positions)
}
template
<
typename
PFP
>
Dart
Polyhedron
<
PFP
>::
create
Oriented
Tetra
(
typename
PFP
::
MAP
&
the_map
)
Dart
Polyhedron
<
PFP
>::
createTetra
(
typename
PFP
::
MAP
&
the_map
)
{
Dart
base
=
the_map
.
newFace
(
3
);
...
...
@@ -188,22 +188,22 @@ Dart Polyhedron<PFP>::createOrientedTetra(typename PFP::MAP& the_map)
}
template
<
typename
PFP
>
Dart
Polyhedron
<
PFP
>::
create
Oriented
Pyra
(
typename
PFP
::
MAP
&
the_map
)
Dart
Polyhedron
<
PFP
>::
createPyra
(
typename
PFP
::
MAP
&
the_map
)
{
Dart
base
=
the_map
.
new
Oriented
Face
(
4
);
Dart
base
=
the_map
.
newFace
(
4
);
Dart
side1
=
the_map
.
new
Oriented
Face
(
3
);
Dart
side1
=
the_map
.
newFace
(
3
);
the_map
.
sewFaces
(
base
,
side1
);
Dart
side2
=
the_map
.
new
Oriented
Face
(
3
);
Dart
side2
=
the_map
.
newFace
(
3
);
the_map
.
sewFaces
(
the_map
.
phi1
(
base
),
side2
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side1
),
the_map
.
phi1
(
side2
));
Dart
side3
=
the_map
.
new
Oriented
Face
(
3
);
Dart
side3
=
the_map
.
newFace
(
3
);
the_map
.
sewFaces
(
the_map
.
phi1
(
the_map
.
phi1
(
base
)),
side3
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side2
),
the_map
.
phi1
(
side3
));
Dart
side4
=
the_map
.
new
Oriented
Face
(
3
);
Dart
side4
=
the_map
.
newFace
(
3
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
base
),
side4
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side3
),
the_map
.
phi1
(
side4
));
...
...
@@ -213,28 +213,28 @@ Dart Polyhedron<PFP>::createOrientedPyra(typename PFP::MAP& the_map)
}
template
<
typename
PFP
>
Dart
Polyhedron
<
PFP
>::
create
Oriented
Hexa
(
typename
PFP
::
MAP
&
the_map
)
Dart
Polyhedron
<
PFP
>::
createHexa
(
typename
PFP
::
MAP
&
the_map
)
{
Dart
base
=
the_map
.
new
Oriented
Face
(
4
);
Dart
base
=
the_map
.
newFace
(
4
);
Dart
side1
=
the_map
.
new
Oriented
Face
(
4
);
Dart
side1
=
the_map
.
newFace
(
4
);
the_map
.
sewFaces
(
base
,
side1
);
Dart
side2
=
the_map
.
new
Oriented
Face
(
4
);
Dart
side2
=
the_map
.
newFace
(
4
);
the_map
.
sewFaces
(
the_map
.
phi1
(
base
),
side2
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side1
),
the_map
.
phi1
(
side2
));
Dart
side3
=
the_map
.
new
Oriented
Face
(
4
);
Dart
side3
=
the_map
.
newFace
(
4
);
the_map
.
sewFaces
(
the_map
.
phi1
(
the_map
.
phi1
(
base
)),
side3
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side2
),
the_map
.
phi1
(
side3
));
Dart
side4
=
the_map
.
new
Oriented
Face
(
4
);
Dart
side4
=
the_map
.
newFace
(
4
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
base
),
side4
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side3
),
the_map
.
phi1
(
side4
));
the_map
.
sewFaces
(
the_map
.
phi_1
(
side4
),
the_map
.
phi1
(
side1
));
Dart
top
=
the_map
.
new
Oriented
Face
(
4
);
Dart
top
=
the_map
.
newFace
(
4
);
the_map
.
sewFaces
(
top
,
the_map
.
phi1
(
the_map
.
phi1
(
side1
)));
the_map
.
sewFaces
(
the_map
.
phi_1
(
top
),
the_map
.
phi1
(
the_map
.
phi1
(
side2
)));
the_map
.
sewFaces
(
the_map
.
phi1
(
the_map
.
phi1
(
top
)),
the_map
.
phi1
(
the_map
.
phi1
(
side3
)));
...
...
@@ -244,24 +244,24 @@ Dart Polyhedron<PFP>::createOrientedHexa(typename PFP::MAP& the_map)
}
template
<
typename
PFP
>
Dart
Polyhedron
<
PFP
>::
create
Oriented
Prism
(
typename
PFP
::
MAP
&
the_map
)
Dart
Polyhedron
<
PFP
>::
createPrism
(
typename
PFP
::
MAP
&
the_map
)
{
Dart
base
=
the_map
.
new
Oriented
Face
(
3
);
Dart
base
=
the_map
.
newFace
(
3
);
Dart
side1
=
the_map
.
new
Oriented
Face
(
4
);
Dart
side1
=
the_map
.
newFace
(
4
);
the_map
.
sewFaces
(
base
,
side1
);
Dart
side2
=
the_map
.
new
Oriented
Face
(
4
);
Dart
side2
=
the_map
.
newFace
(
4
);
the_map
.
sewFaces
(
the_map
.
phi1
(
base
),
side2
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side1
),
the_map
.
phi1
(
side2
));
Dart
side3
=
the_map
.
new
Oriented
Face
(
4
);
Dart
side3
=
the_map
.
newFace
(
4
);
the_map
.
sewFaces
(
the_map
.
phi1
(
the_map
.
phi1
(
base
)),
side3
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side2
),
the_map
.
phi1
(
side3
));
the_map
.
sewFaces
(
the_map
.
phi_1
(
side3
),
the_map
.
phi1
(
side1
));
Dart
top
=
the_map
.
new
Oriented
Face
(
3
);
Dart
top
=
the_map
.
newFace
(
3
);
the_map
.
sewFaces
(
top
,
the_map
.
phi1
(
the_map
.
phi1
(
side1
)));
the_map
.
sewFaces
(
the_map
.
phi_1
(
top
),
the_map
.
phi1
(
the_map
.
phi1
(
side2
)));
the_map
.
sewFaces
(
the_map
.
phi1
(
top
),
the_map
.
phi1
(
the_map
.
phi1
(
side3
)));
...
...
@@ -270,17 +270,17 @@ Dart Polyhedron<PFP>::createOrientedPrism(typename PFP::MAP& the_map)