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
CGoGN
CGoGN
Commits
623c59a0
Commit
623c59a0
authored
Nov 16, 2011
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'no_boundary' of cgogn:~thery/CGoGN into no_boundary
parents
c7005e0b
1b28477f
Changes
34
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
245 additions
and
628 deletions
+245
-628
Apps/Examples/Debug/CMakeLists.txt
Apps/Examples/Debug/CMakeLists.txt
+1
-1
Apps/Examples/Release/CMakeLists.txt
Apps/Examples/Release/CMakeLists.txt
+1
-1
Apps/Examples/clipping.cpp
Apps/Examples/clipping.cpp
+1
-4
Apps/Tuto/CMakeLists.txt
Apps/Tuto/CMakeLists.txt
+1
-1
Apps/Tuto/tp_master.cpp
Apps/Tuto/tp_master.cpp
+1
-1
build/CMakeLists.txt
build/CMakeLists.txt
+1
-1
build/Debug/CMakeLists.txt
build/Debug/CMakeLists.txt
+1
-1
build/Release/CMakeLists.txt
build/Release/CMakeLists.txt
+1
-1
include/Algo/Import/importMesh.hpp
include/Algo/Import/importMesh.hpp
+6
-3
include/Algo/Modelisation/polyhedron.hpp
include/Algo/Modelisation/polyhedron.hpp
+83
-79
include/Algo/Modelisation/triangulation.h
include/Algo/Modelisation/triangulation.h
+2
-1
include/Algo/Modelisation/triangulation.hpp
include/Algo/Modelisation/triangulation.hpp
+26
-15
include/Algo/Optimized/optimizedMap.hpp
include/Algo/Optimized/optimizedMap.hpp
+0
-399
include/Algo/Render/GL2/mapRender.hpp
include/Algo/Render/GL2/mapRender.hpp
+1
-1
include/Topology/generic/attribmap.h
include/Topology/generic/attribmap.h
+6
-0
include/Topology/generic/attributeHandler.h
include/Topology/generic/attributeHandler.h
+1
-1
include/Topology/generic/attributeHandler.hpp
include/Topology/generic/attributeHandler.hpp
+1
-1
include/Topology/gmap/embeddedGMap2.h
include/Topology/gmap/embeddedGMap2.h
+2
-2
include/Topology/gmap/gmap1.h
include/Topology/gmap/gmap1.h
+2
-1
include/Topology/gmap/gmap2.h
include/Topology/gmap/gmap2.h
+2
-1
include/Topology/map/embeddedMap2.h
include/Topology/map/embeddedMap2.h
+2
-2
include/Topology/map/map1.h
include/Topology/map/map1.h
+3
-13
include/Topology/map/map1.hpp
include/Topology/map/map1.hpp
+1
-14
include/Topology/map/map2.h
include/Topology/map/map2.h
+11
-12
include/Topology/map/map2.hpp
include/Topology/map/map2.hpp
+0
-8
src/Algo/Render/topoRender.cpp
src/Algo/Render/topoRender.cpp
+1
-1
src/Topology/generic/attribmap.cpp
src/Topology/generic/attribmap.cpp
+30
-1
src/Topology/gmap/embeddedGMap2.cpp
src/Topology/gmap/embeddedGMap2.cpp
+7
-3
src/Topology/gmap/gmap1.cpp
src/Topology/gmap/gmap1.cpp
+1
-1
src/Topology/gmap/gmap2.cpp
src/Topology/gmap/gmap2.cpp
+1
-1
src/Topology/map/embeddedMap2.cpp
src/Topology/map/embeddedMap2.cpp
+8
-4
src/Topology/map/map1.cpp
src/Topology/map/map1.cpp
+3
-3
src/Topology/map/map2.cpp
src/Topology/map/map2.cpp
+35
-48
src/Topology/map/map3.cpp
src/Topology/map/map3.cpp
+2
-2
No files found.
Apps/Examples/Debug/CMakeLists.txt
View file @
623c59a0
cmake_minimum_required
(
VERSION 2.
6
)
cmake_minimum_required
(
VERSION 2.
8
)
project
(
examplesD
)
...
...
Apps/Examples/Release/CMakeLists.txt
View file @
623c59a0
cmake_minimum_required
(
VERSION 2.
6
)
cmake_minimum_required
(
VERSION 2.
8
)
project
(
examples
)
...
...
Apps/Examples/clipping.cpp
View file @
623c59a0
...
...
@@ -186,10 +186,7 @@ void Clipping::slot_spinBox_GridResolution(int i)
void
Clipping
::
slot_pushButton_changePlanesColor
()
{
QColor
NewColor
;
QColorDialog
ColDialog
;
NewColor
=
ColDialog
.
getColor
();
QColor
NewColor
=
QColorDialog
::
getColor
();
int
r
,
g
,
b
;
NewColor
.
getRgb
(
&
r
,
&
g
,
&
b
);
...
...
Apps/Tuto/CMakeLists.txt
View file @
623c59a0
cmake_minimum_required
(
VERSION 2.
6
)
cmake_minimum_required
(
VERSION 2.
8
)
project
(
Tutos
)
...
...
Apps/Tuto/tp_master.cpp
View file @
623c59a0
...
...
@@ -447,7 +447,7 @@ void MyQT::cb_keyPress(int keycode)
ss
<<
"dart:"
<<
darts
[
0
].
index
<<
" /phi1:"
<<
d1
.
index
<<
" /phi2:"
<<
d2
.
index
;
const
PFP
::
VEC3
&
P
=
position
[
darts
[
0
]];
ss
<<
" /Emb:"
<<
P
;
ss
<<
" /Emb:"
<<
myMap
.
getEmbedding
(
VERTEX
,
darts
[
0
])
<<
"/"
<<
P
;
statusMsg
(
ss
.
str
().
c_str
());
}
break
;
...
...
build/CMakeLists.txt
View file @
623c59a0
cmake_minimum_required
(
VERSION 2.
6
)
cmake_minimum_required
(
VERSION 2.
8
)
project
(
CGoGN
)
...
...
build/Debug/CMakeLists.txt
View file @
623c59a0
cmake_minimum_required
(
VERSION 2.
6
)
cmake_minimum_required
(
VERSION 2.
8
)
project
(
CGoGNDebug
)
...
...
build/Release/CMakeLists.txt
View file @
623c59a0
cmake_minimum_required
(
VERSION 2.
6
)
cmake_minimum_required
(
VERSION 2.
8
)
project
(
CGoGNRelease
)
...
...
include/Algo/Import/importMesh.hpp
View file @
623c59a0
...
...
@@ -74,7 +74,7 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
nbe
=
edgesBuffer
.
size
();
if
(
nbe
>
2
)
{
Dart
d
=
map
.
new
Oriented
Face
(
nbe
);
Dart
d
=
map
.
newFace
(
nbe
,
false
);
for
(
unsigned
int
j
=
0
;
j
<
nbe
;
++
j
)
{
unsigned
int
em
=
edgesBuffer
[
j
];
// get embedding
...
...
@@ -97,7 +97,7 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
std
::
vector
<
Dart
>&
vec
=
vecDartsPerVertex
[
map
.
phi1
(
d
)];
unsigned
int
embd
=
map
.
getEmbedding
(
VERTEX
,
d
);
Dart
good_dart
;
Dart
good_dart
=
NIL
;
for
(
typename
std
::
vector
<
Dart
>::
iterator
it
=
vec
.
begin
();
it
!=
vec
.
end
()
&&
good_dart
==
NIL
;
++
it
)
{
if
(
map
.
getEmbedding
(
VERTEX
,
map
.
phi1
(
*
it
))
==
embd
)
...
...
@@ -108,7 +108,7 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
{
if
(
good_dart
==
map
.
phi2
(
good_dart
))
{
map
.
sew
Oriented
Faces
(
d
,
good_dart
);
map
.
sewFaces
(
d
,
good_dart
,
false
);
m
.
unmarkOrbit
(
EDGE
,
d
);
}
}
...
...
@@ -124,6 +124,9 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
{
map
.
closeMap
();
CGoGNout
<<
"Map closed ("
<<
nbnm
<<
" boundary edges)"
<<
CGoGNendl
;
// ensure bijection between topo a embedding
map
.
bijectiveOrbitEmbedding
(
VERTEX
);
}
return
true
;
...
...
include/Algo/Modelisation/polyhedron.hpp
View file @
623c59a0
...
...
@@ -169,20 +169,20 @@ m_positions(p1.m_positions)
template
<
typename
PFP
>
Dart
Polyhedron
<
PFP
>::
createOrientedTetra
(
typename
PFP
::
MAP
&
the_map
)
{
Dart
base
=
the_map
.
newFace
(
3
);
Dart
base
=
the_map
.
newFace
(
3
,
false
);
Dart
side1
=
the_map
.
newFace
(
3
);
the_map
.
sewFaces
(
base
,
side1
);
Dart
side1
=
the_map
.
newFace
(
3
,
false
);
the_map
.
sewFaces
(
base
,
side1
,
false
);
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
side2
=
the_map
.
newFace
(
3
,
false
);
the_map
.
sewFaces
(
the_map
.
phi1
(
base
),
side2
,
false
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side1
),
the_map
.
phi1
(
side2
)
,
false
);
Dart
side3
=
the_map
.
newFace
(
3
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
base
),
side3
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side2
),
the_map
.
phi1
(
side3
));
Dart
side3
=
the_map
.
newFace
(
3
,
false
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
base
),
side3
,
false
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side2
),
the_map
.
phi1
(
side3
)
,
false
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side3
),
the_map
.
phi1
(
side1
));
the_map
.
sewFaces
(
the_map
.
phi_1
(
side3
),
the_map
.
phi1
(
side1
)
,
false
);
return
base
;
}
...
...
@@ -190,24 +190,24 @@ Dart Polyhedron<PFP>::createOrientedTetra(typename PFP::MAP& the_map)
template
<
typename
PFP
>
Dart
Polyhedron
<
PFP
>::
createOrientedPyra
(
typename
PFP
::
MAP
&
the_map
)
{
Dart
base
=
the_map
.
new
Oriented
Face
(
4
);
Dart
base
=
the_map
.
newFace
(
4
,
false
);
Dart
side1
=
the_map
.
new
Oriented
Face
(
3
);
the_map
.
sewFaces
(
base
,
side1
);
Dart
side1
=
the_map
.
newFace
(
3
,
false
);
the_map
.
sewFaces
(
base
,
side1
,
false
);
Dart
side2
=
the_map
.
new
Oriented
Face
(
3
);
the_map
.
sewFaces
(
the_map
.
phi1
(
base
),
side2
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side1
),
the_map
.
phi1
(
side2
));
Dart
side2
=
the_map
.
newFace
(
3
,
false
);
the_map
.
sewFaces
(
the_map
.
phi1
(
base
),
side2
,
false
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side1
),
the_map
.
phi1
(
side2
)
,
false
);
Dart
side3
=
the_map
.
new
Oriented
Face
(
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
side3
=
the_map
.
newFace
(
3
,
false
);
the_map
.
sewFaces
(
the_map
.
phi1
(
the_map
.
phi1
(
base
)),
side3
,
false
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side2
),
the_map
.
phi1
(
side3
)
,
false
);
Dart
side4
=
the_map
.
new
Oriented
Face
(
3
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
base
),
side4
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side3
),
the_map
.
phi1
(
side4
));
Dart
side4
=
the_map
.
newFace
(
3
,
false
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
base
),
side4
,
false
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side3
),
the_map
.
phi1
(
side4
)
,
false
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side4
),
the_map
.
phi1
(
side1
));
the_map
.
sewFaces
(
the_map
.
phi_1
(
side4
),
the_map
.
phi1
(
side1
)
,
false
);
return
base
;
}
...
...
@@ -215,30 +215,30 @@ Dart Polyhedron<PFP>::createOrientedPyra(typename PFP::MAP& the_map)
template
<
typename
PFP
>
Dart
Polyhedron
<
PFP
>::
createOrientedHexa
(
typename
PFP
::
MAP
&
the_map
)
{
Dart
base
=
the_map
.
new
Oriented
Face
(
4
);
Dart
base
=
the_map
.
newFace
(
4
,
false
);
Dart
side1
=
the_map
.
new
Oriented
Face
(
4
);
the_map
.
sewFaces
(
base
,
side1
);
Dart
side1
=
the_map
.
newFace
(
4
,
false
);
the_map
.
sewFaces
(
base
,
side1
,
false
);
Dart
side2
=
the_map
.
new
Oriented
Face
(
4
);
the_map
.
sewFaces
(
the_map
.
phi1
(
base
),
side2
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side1
),
the_map
.
phi1
(
side2
));
Dart
side2
=
the_map
.
newFace
(
4
,
false
);
the_map
.
sewFaces
(
the_map
.
phi1
(
base
),
side2
,
false
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side1
),
the_map
.
phi1
(
side2
)
,
false
);
Dart
side3
=
the_map
.
new
Oriented
Face
(
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
side3
=
the_map
.
newFace
(
4
,
false
);
the_map
.
sewFaces
(
the_map
.
phi1
(
the_map
.
phi1
(
base
)),
side3
,
false
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side2
),
the_map
.
phi1
(
side3
)
,
false
);
Dart
side4
=
the_map
.
new
Oriented
Face
(
4
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
base
),
side4
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side3
),
the_map
.
phi1
(
side4
));
Dart
side4
=
the_map
.
newFace
(
4
,
false
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
base
),
side4
,
false
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side3
),
the_map
.
phi1
(
side4
)
,
false
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side4
),
the_map
.
phi1
(
side1
));
the_map
.
sewFaces
(
the_map
.
phi_1
(
side4
),
the_map
.
phi1
(
side1
)
,
false
);
Dart
top
=
the_map
.
new
Oriented
Face
(
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
)));
the_map
.
sewFaces
(
the_map
.
phi1
(
top
),
the_map
.
phi1
(
the_map
.
phi1
(
side4
)));
Dart
top
=
the_map
.
newFace
(
4
,
false
);
the_map
.
sewFaces
(
top
,
the_map
.
phi1
(
the_map
.
phi1
(
side1
))
,
false
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
top
),
the_map
.
phi1
(
the_map
.
phi1
(
side2
))
,
false
);
the_map
.
sewFaces
(
the_map
.
phi1
(
the_map
.
phi1
(
top
)),
the_map
.
phi1
(
the_map
.
phi1
(
side3
))
,
false
);
the_map
.
sewFaces
(
the_map
.
phi1
(
top
),
the_map
.
phi1
(
the_map
.
phi1
(
side4
))
,
false
);
return
base
;
}
...
...
@@ -246,25 +246,25 @@ Dart Polyhedron<PFP>::createOrientedHexa(typename PFP::MAP& the_map)
template
<
typename
PFP
>
Dart
Polyhedron
<
PFP
>::
createOrientedPrism
(
typename
PFP
::
MAP
&
the_map
)
{
Dart
base
=
the_map
.
new
Oriented
Face
(
3
);
Dart
base
=
the_map
.
newFace
(
3
,
false
);
Dart
side1
=
the_map
.
new
Oriented
Face
(
4
);
the_map
.
sewFaces
(
base
,
side1
);
Dart
side1
=
the_map
.
newFace
(
4
,
false
);
the_map
.
sewFaces
(
base
,
side1
,
false
);
Dart
side2
=
the_map
.
new
Oriented
Face
(
4
);
the_map
.
sewFaces
(
the_map
.
phi1
(
base
),
side2
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side1
),
the_map
.
phi1
(
side2
));
Dart
side2
=
the_map
.
newFace
(
4
,
false
);
the_map
.
sewFaces
(
the_map
.
phi1
(
base
),
side2
,
false
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side1
),
the_map
.
phi1
(
side2
)
,
false
);
Dart
side3
=
the_map
.
new
Oriented
Face
(
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
side3
=
the_map
.
newFace
(
4
,
false
);
the_map
.
sewFaces
(
the_map
.
phi1
(
the_map
.
phi1
(
base
)),
side3
,
false
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side2
),
the_map
.
phi1
(
side3
)
,
false
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
side3
),
the_map
.
phi1
(
side1
));
the_map
.
sewFaces
(
the_map
.
phi_1
(
side3
),
the_map
.
phi1
(
side1
)
,
false
);
Dart
top
=
the_map
.
new
Oriented
Face
(
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
)));
Dart
top
=
the_map
.
newFace
(
3
,
false
);
the_map
.
sewFaces
(
top
,
the_map
.
phi1
(
the_map
.
phi1
(
side1
))
,
false
);
the_map
.
sewFaces
(
the_map
.
phi_1
(
top
),
the_map
.
phi1
(
the_map
.
phi1
(
side2
))
,
false
);
the_map
.
sewFaces
(
the_map
.
phi1
(
top
),
the_map
.
phi1
(
the_map
.
phi1
(
side3
))
,
false
);
return
base
;
}
...
...
@@ -306,7 +306,7 @@ Dart Polyhedron<PFP>::grid_topo(unsigned int x, unsigned int y)
{
for
(
unsigned
int
j
=
1
;
j
<=
x
;
++
j
)
{
Dart
d
=
m_map
.
newFace
(
4
);
Dart
d
=
m_map
.
newFace
(
4
,
false
);
m_tableVertDarts
.
push_back
(
d
);
if
(
j
==
x
)
m_tableVertDarts
.
push_back
(
m_map
.
phi1
(
d
));
...
...
@@ -331,7 +331,7 @@ Dart Polyhedron<PFP>::grid_topo(unsigned int x, unsigned int y)
Dart
d
=
m_tableVertDarts
[
pos
];
Dart
e
=
m_tableVertDarts
[
pos
-
(
x
+
1
)];
e
=
m_map
.
phi1
(
m_map
.
phi1
(
e
));
m_map
.
sewFaces
(
d
,
e
);
m_map
.
sewFaces
(
d
,
e
,
false
);
}
if
(
j
>
0
)
// sew with preceeding column
{
...
...
@@ -340,7 +340,7 @@ Dart Polyhedron<PFP>::grid_topo(unsigned int x, unsigned int y)
d
=
m_map
.
phi_1
(
d
);
Dart
e
=
m_tableVertDarts
[
pos
-
1
];
e
=
m_map
.
phi1
(
e
);
m_map
.
sewFaces
(
d
,
e
);
m_map
.
sewFaces
(
d
,
e
,
false
);
}
}
}
...
...
@@ -374,7 +374,7 @@ Dart Polyhedron<PFP>::cylinder_topo(int n, int z, bool top_closed, bool bottom_c
{
for
(
int
j
=
0
;
j
<
n
;
++
j
)
{
Dart
d
=
m_map
.
newFace
(
4
);
Dart
d
=
m_map
.
newFace
(
4
,
false
);
m_tableVertDarts
.
push_back
(
d
);
}
}
...
...
@@ -394,7 +394,7 @@ Dart Polyhedron<PFP>::cylinder_topo(int n, int z, bool top_closed, bool bottom_c
Dart
d
=
m_tableVertDarts
[
pos
];
Dart
e
=
m_tableVertDarts
[
pos
-
n
];
e
=
m_map
.
phi1
(
m_map
.
phi1
(
e
));
m_map
.
sewFaces
(
d
,
e
);
m_map
.
sewFaces
(
d
,
e
,
false
);
}
if
(
j
>
0
)
// sew with preceeding column
{
...
...
@@ -403,7 +403,7 @@ Dart Polyhedron<PFP>::cylinder_topo(int n, int z, bool top_closed, bool bottom_c
d
=
m_map
.
phi_1
(
d
);
Dart
e
=
m_tableVertDarts
[
pos
-
1
];
e
=
m_map
.
phi1
(
e
);
m_map
.
sewFaces
(
d
,
e
);
m_map
.
sewFaces
(
d
,
e
,
false
);
}
else
{
...
...
@@ -412,7 +412,7 @@ Dart Polyhedron<PFP>::cylinder_topo(int n, int z, bool top_closed, bool bottom_c
d
=
m_map
.
phi_1
(
d
);
Dart
e
=
m_tableVertDarts
[
pos
+
(
n
-
1
)];
e
=
m_map
.
phi1
(
e
);
m_map
.
sewFaces
(
d
,
e
);
m_map
.
sewFaces
(
d
,
e
,
false
);
}
}
}
...
...
@@ -420,7 +420,7 @@ Dart Polyhedron<PFP>::cylinder_topo(int n, int z, bool top_closed, bool bottom_c
if
(
bottom_closed
)
{
Dart
d
=
m_tableVertDarts
[
0
];
if
(
m_map
.
closeHole
(
d
))
if
(
m_map
.
closeHole
(
d
,
false
))
{
d
=
m_map
.
phi2
(
d
);
if
(
!
m_map
.
isFaceTriangle
(
d
))
...
...
@@ -443,11 +443,13 @@ Dart Polyhedron<PFP>::cylinder_topo(int n, int z, bool top_closed, bool bottom_c
// d = precDV(d);
// }
}
else
m_map
.
closeHole
(
m_tableVertDarts
[
0
]);
if
(
top_closed
)
{
Dart
d
=
m_map
.
phi_1
(
m_tableVertDarts
[
n
*
z
]);
if
(
m_map
.
closeHole
(
d
))
if
(
m_map
.
closeHole
(
d
,
true
))
{
d
=
m_map
.
phi2
(
d
);
if
(
!
m_map
.
isFaceTriangle
(
d
))
...
...
@@ -471,6 +473,8 @@ Dart Polyhedron<PFP>::cylinder_topo(int n, int z, bool top_closed, bool bottom_c
// d = nextDV(d);
// }
}
else
m_map
.
closeHole
(
m_map
.
phi_1
(
m_tableVertDarts
[
n
*
z
]));
m_dart
=
m_tableVertDarts
.
front
();
return
m_dart
;
...
...
@@ -498,7 +502,7 @@ Dart Polyhedron<PFP>::cylinder_topo(int n, int z, bool top_closed, bool bottom_c
// // close bottom with one quad not three triangles
// if (bottom_closed)
// {
// Dart t= m_map.newFace(4);
// Dart t= m_map.newFace(4
,false
);
// m_map.sewFaces(m_tableVertDarts[0],t);
// t=m_map.phi_1(t);
// m_map.sewFaces(m_tableVertDarts[1],t);
...
...
@@ -517,7 +521,7 @@ Dart Polyhedron<PFP>::cylinder_topo(int n, int z, bool top_closed, bool bottom_c
// // close bottom with one triangle not three
// if (bottom_closed)
// {
// Dart t= m_map.newFace(3);
// Dart t= m_map.newFace(3
,false
);
// m_map.sewFaces(d,t);
// d=nextDV(d); t=m_map.phi_1(t);
// m_map.sewFaces(d,t);
...
...
@@ -580,7 +584,7 @@ Dart Polyhedron<PFP>::cylinder_topo(int n, int z, bool top_closed, bool bottom_c
//
// if (bottom_closed)
// {
// Dart t= m_map.newFace(4);
// Dart t= m_map.newFace(4
,false
);
// m_map.sewFaces(m_tableVertDarts[0],t);
// t=m_map.phi_1(t);
// m_map.sewFaces(m_tableVertDarts[1],t);
...
...
@@ -607,7 +611,7 @@ Dart Polyhedron<PFP>::cylinder_topo(int n, int z, bool top_closed, bool bottom_c
//
// if (bottom_closed)
// {
// Dart t= m_map.newFace(3);
// Dart t= m_map.newFace(3
,false
);
// m_map.sewFaces(m_tableVertDarts[0],t);
// t=m_map.phi_1(t);
// m_map.sewFaces(m_tableVertDarts[1],t);
...
...
@@ -645,27 +649,27 @@ Dart Polyhedron<PFP>::cube_topo(int x, int y,int z)
{
Dart
d
=
m_map
.
phi_1
(
m_tableVertDarts
[
index_side
++
]);
Dart
e
=
tableTop
[
i
];
m_map
.
sewFaces
(
d
,
e
);
m_map
.
sewFaces
(
d
,
e
,
false
);
}
for
(
int
i
=
0
;
i
<
y
;
++
i
)
{
Dart
d
=
m_map
.
phi_1
(
m_tableVertDarts
[
index_side
++
]);
Dart
e
=
tableTop
[
x
+
i
*
(
x
+
1
)];
m_map
.
sewFaces
(
d
,
e
);
m_map
.
sewFaces
(
d
,
e
,
false
);
}
for
(
int
i
=
0
;
i
<
x
;
++
i
)
{
Dart
d
=
m_map
.
phi_1
(
m_tableVertDarts
[
index_side
++
]);
Dart
e
=
tableTop
[(
x
+
1
)
*
(
y
+
1
)
-
2
-
i
];
e
=
m_map
.
phi_1
(
e
);
m_map
.
sewFaces
(
d
,
e
);
m_map
.
sewFaces
(
d
,
e
,
false
);
}
for
(
int
i
=
0
;
i
<
y
;
++
i
)
{
Dart
d
=
m_map
.
phi_1
(
m_tableVertDarts
[
index_side
++
]);
Dart
e
=
tableTop
[(
y
-
1
-
i
)
*
(
x
+
1
)];
e
=
m_map
.
phi_1
(
e
);
m_map
.
sewFaces
(
d
,
e
);
m_map
.
sewFaces
(
d
,
e
,
false
);
}
// the bottom
...
...
@@ -678,27 +682,27 @@ Dart Polyhedron<PFP>::cube_topo(int x, int y,int z)
{
Dart
d
=
m_tableVertDarts
[(
index_side
--
)
%
(
2
*
(
x
+
y
))];
Dart
e
=
tableBottom
[
i
];
m_map
.
sewFaces
(
d
,
e
);
m_map
.
sewFaces
(
d
,
e
,
false
);
}
for
(
int
i
=
0
;
i
<
y
;
++
i
)
{
Dart
d
=
m_tableVertDarts
[(
index_side
--
)
%
(
2
*
(
x
+
y
))];
Dart
e
=
tableBottom
[
x
+
i
*
(
x
+
1
)];
m_map
.
sewFaces
(
d
,
e
);
m_map
.
sewFaces
(
d
,
e
,
false
);
}
for
(
int
i
=
0
;
i
<
x
;
++
i
)
{
Dart
d
=
m_tableVertDarts
[(
index_side
--
)
%
(
2
*
(
x
+
y
))];
Dart
e
=
tableBottom
[(
x
+
1
)
*
(
y
+
1
)
-
2
-
i
];
e
=
m_map
.
phi_1
(
e
);
m_map
.
sewFaces
(
d
,
e
);
m_map
.
sewFaces
(
d
,
e
,
false
);
}
for
(
int
i
=
0
;
i
<
y
;
++
i
)
{
Dart
d
=
m_tableVertDarts
[(
index_side
--
)
%
(
2
*
(
x
+
y
))];
Dart
e
=
tableBottom
[(
y
-
1
-
i
)
*
(
x
+
1
)];
e
=
m_map
.
phi_1
(
e
);
m_map
.
sewFaces
(
d
,
e
);
m_map
.
sewFaces
(
d
,
e
,
false
);
}
// and add new vertex in m_tableVertDarts
...
...
@@ -739,7 +743,7 @@ Dart Polyhedron<PFP>::tore_topo(int m, int n)
Dart
d
=
m_tableVertDarts
[
i
];
Dart
e
=
m_tableVertDarts
[(
m
*
n
)
+
i
];
e
=
m_map
.
phi_1
(
e
);
m_map
.
sewFaces
(
d
,
e
);
m_map
.
sewFaces
(
d
,
e
,
false
);
}
// remove the last n vertex darts that are no more necessary (sewed with n first)
...
...
@@ -1186,11 +1190,11 @@ void Polyhedron<PFP>::embedHelicoid(float radius_min, float radius_max, float ma
// template <typename PFP>
// Dart triangleFan_topo(typename PFP::MAP& the_map, int n)
// {
// Dart d = the_map.newFace(3);
// Dart d = the_map.newFace(3
,false
);
// Dart e = the_map.phi1(d);
// for(int i=1;i<n;++i)
// {
// Dart f = the_map.newFace(3);
// Dart f = the_map.newFace(3
,false
);
// the_map.sewFaces(the_map.phi_1(f),e);
// e = the_map.phi1(f);
// }
...
...
include/Algo/Modelisation/triangulation.h
View file @
623c59a0
...
...
@@ -92,7 +92,8 @@ public:
m_position
=
map
.
template
getAttribute
<
typename
PFP
::
VEC3
>(
VERTEX
,
"position"
);
}
void
trianguleFace
(
Dart
d
,
DartMarker
&
mark
);
// void trianguleFace( Dart d, DartMarker& mark);
void
trianguleFace
(
Dart
d
);
void
triangule
(
const
FunctorSelect
&
good
=
allDarts
,
unsigned
int
thread
=
0
);
...
...
include/Algo/Modelisation/triangulation.hpp
View file @
623c59a0
...
...
@@ -155,7 +155,9 @@ float EarTriangulation<PFP>::computeEarInit(Dart d, const typename PFP::VEC3& no
template
<
typename
PFP
>
void
EarTriangulation
<
PFP
>::
trianguleFace
(
Dart
d
,
DartMarker
&
mark
)
//void EarTriangulation<PFP>::trianguleFace(Dart d, DartMarker& mark)
void
EarTriangulation
<
PFP
>::
trianguleFace
(
Dart
d
)
{
// compute normal to polygon
typename
PFP
::
VEC3
normalPoly
=
Algo
::
Geometry
::
newellNormal
<
PFP
>
(
m_map
,
d
,
m_position
);
...
...
@@ -167,7 +169,7 @@ void EarTriangulation<PFP>::trianguleFace(Dart d, DartMarker& mark)
if
(
m_map
.
template
phi
<
111
>(
d
)
==
d
)
{
mark
.
markOrbit
(
FACE
,
d
);
// mark the face
//
mark.markOrbit(FACE, d); // mark the face
return
;
}
...
...
@@ -196,7 +198,7 @@ void EarTriangulation<PFP>::trianguleFace(Dart d, DartMarker& mark)
Dart
e2
=
m_map
.
phi_1
(
d_e
);
m_map
.
splitFace
(
e1
,
e2
);
mark
.
markOrbit
(
FACE
,
d_e
);
//
mark.markOrbit(FACE, d_e);
nbv
--
;
if
(
nbv
>
3
)
// do not recompute if only one triangle left
...
...
@@ -211,8 +213,8 @@ void EarTriangulation<PFP>::trianguleFace(Dart d, DartMarker& mark)
convex
=
(
m_ears
.
rbegin
()
->
angle
)
<
5.0
f
;
}
else
mark
.
markOrbit
(
FACE
,
e1
);
// mark last face
//
else
//
mark.markOrbit(FACE, e1); // mark last face
}
m_ears
.
clear
();
...
...
@@ -222,18 +224,27 @@ void EarTriangulation<PFP>::trianguleFace(Dart d, DartMarker& mark)
template
<
typename
PFP
>
void
EarTriangulation
<
PFP
>::
triangule
(
const
FunctorSelect
&
good
,
unsigned
int
thread
)
{
DartMarker
m
(
m_map
,
thread
);
for
(
Dart
d
=
m_map
.
begin
();
d
!=
m_map
.
end
();
m_map
.
next
(
d
))
// DartMarker m(m_map, thread);
//
// for(Dart d = m_map.begin(); d != m_map.end(); m_map.next(d))
// {
// if(!m.isMarked(d) && good(d))
// {
// Dart e = m_map.template phi<111>(d);
// if (e!=d)
// trianguleFace(d, m);
// }
// }
// m.unmarkAll();
TraversorF
<
typename
PFP
::
MAP
>
trav
(
m_map
,
good
,
thread
);
for
(
Dart
d
=
trav
.
begin
();
d
!=
trav
.
end
();
d
=
trav
.
next
())
{
if
(
!
m
.
isMarked
(
d
)
&&
good
(
d
))
{
Dart
e
=
m_map
.
template
phi
<
111
>(
d
);
if
(
e
!=
d
)
trianguleFace
(
d
,
m
);
}
Dart
e
=
m_map
.
template
phi
<
111
>(
d
);
if
(
e
!=
d
)
trianguleFace
(
d
);
}
m
.
unmarkAll
();
}
...
...
include/Algo/Optimized/optimizedMap.hpp
deleted
100644 → 0
View file @
c7005e0b
#ifndef __OPTIMIZED_MAP_
#define __OPTIMIZED_MAP_
#include "Topology/generic/functor.h"
namespace
CGoGN
{
namespace
Algo
{
namespace
Optimiz
{
#define OPT_MAX_THREAD 8
template
<
typename
MAP
>
class
OptimizedMap2
{
typedef
typename
MAP
::
Dart
Dart
;
protected:
Dart
m_firstVertex
[
OPT_MAX_THREAD
];
int
m_nbVertices
;
Dart
m_firstFace
[
OPT_MAX_THREAD
];
Dart
m_endMap
;
Dart
m_beginMap
;