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
CGoGN
CGoGN
Commits
4797d495
Commit
4797d495
authored
Feb 06, 2012
by
Sylvain Thery
Browse files
replace alpha1 by phi2_1 and alpha_1 by phi12 in 2D Algorithms
parent
c6dfffb5
Changes
21
Hide whitespace changes
Inline
Side-by-side
Apps/Examples/Tests/test_compact.cpp
View file @
4797d495
...
...
@@ -103,7 +103,7 @@ void test_compact_map(const std::string& name)
do
// mark all edges incident to vertex;
{
dm
.
markOrbit
(
EDGE
,
e
);
e
=
myMap
.
alpha
1
(
e
);
e
=
myMap
.
phi2_
1
(
e
);
}
while
(
e
!=
d
);
}
i
++
;
...
...
include/Algo/BooleanOperator/mergeVertices.hpp
View file @
4797d495
...
...
@@ -38,17 +38,17 @@ void mergeVertex(typename PFP::MAP& map, const typename PFP::TVEC3& positions, D
Dart
dd
;
do
{
dd
=
map
.
alpha
1
(
d
);
dd
=
map
.
phi2_
1
(
d
);
map
.
removeEdgeFromVertex
(
dd
);
Dart
ee
=
e
;
do
{
if
(
Geom
::
testOrientation2D
(
positions
[
map
.
phi1
(
dd
)],
positions
[
ee
],
positions
[
map
.
phi1
(
ee
)])
!=
Geom
::
RIGHT
&&
Geom
::
testOrientation2D
(
positions
[
map
.
phi1
(
dd
)],
positions
[
ee
],
positions
[
map
.
phi1
(
map
.
alpha
1
(
ee
))])
==
Geom
::
RIGHT
)
&&
Geom
::
testOrientation2D
(
positions
[
map
.
phi1
(
dd
)],
positions
[
ee
],
positions
[
map
.
phi1
(
map
.
phi2_
1
(
ee
))])
==
Geom
::
RIGHT
)
{
break
;
}
ee
=
map
.
alpha
1
(
ee
);
ee
=
map
.
phi2_
1
(
ee
);
}
while
(
ee
!=
e
);
map
.
insertEdgeInVertex
(
ee
,
dd
);
}
while
(
dd
!=
d
);
...
...
include/Algo/Decimation/basic.h
View file @
4797d495
...
...
@@ -56,18 +56,18 @@ bool edgeCanCollapse(typename PFP::MAP& map, Dart d, AttributeHandler<unsigned i
unsigned
int
vu1
[
32
];
// pas de vector mais un tableau (find a la main, mais pas d'allocation par reserve)
val_vd
-=
3
;
// evite le -3 dans la boucle
val_vdd
-=
3
;
Dart
vit1
=
map
.
alpha
1
(
map
.
alpha
1
(
d
));
Dart
vit1
=
map
.
phi2_
1
(
map
.
phi2_
1
(
d
));
for
(
unsigned
int
i
=
0
;
i
<
val_vd
;
++
i
)
{
unsigned
int
ve
=
map
.
getEmbedding
(
map
.
phi2
(
vit1
),
VERTEX
);
vu1
[
i
]
=
ve
;
vit1
=
map
.
alpha
1
(
vit1
);
vit1
=
map
.
phi2_
1
(
vit1
);
}
val_vd
--
;
// pour le parcours avec while >=0
Dart
vit2
=
map
.
alpha
1
(
map
.
alpha
1
(
dd
));
Dart
vit2
=
map
.
phi2_
1
(
map
.
phi2_
1
(
dd
));
for
(
unsigned
int
i
=
0
;
i
<
val_vdd
;
++
i
)
{
unsigned
int
ve
=
map
.
getEmbedding
(
map
.
phi2
(
vit2
),
VERTEX
);
...
...
@@ -79,7 +79,7 @@ bool edgeCanCollapse(typename PFP::MAP& map, Dart d, AttributeHandler<unsigned i
return
false
;
--
j
;
}
vit2
=
map
.
alpha
1
(
vit2
);
vit2
=
map
.
phi2_
1
(
vit2
);
}
return
true
;
...
...
@@ -96,16 +96,16 @@ bool edgeCanCollapse(typename PFP::MAP& map, Dart d)
int
val_vd
=
0
;
Dart
tmp
=
d
;
do
{
++
val_vd
;
tmp
=
map
.
alpha
1
(
tmp
)
;
}
while
(
tmp
!=
d
)
;
do
{
++
val_vd
;
tmp
=
map
.
phi2_
1
(
tmp
)
;
}
while
(
tmp
!=
d
)
;
int
val_vdd
=
0
;
tmp
=
dd
;
do
{
++
val_vdd
;
tmp
=
map
.
alpha
1
(
tmp
)
;
}
while
(
tmp
!=
dd
)
;
do
{
++
val_vdd
;
tmp
=
map
.
phi2_
1
(
tmp
)
;
}
while
(
tmp
!=
dd
)
;
int
val_vdp
=
0
;
tmp
=
dp
;
do
{
++
val_vdp
;
tmp
=
map
.
alpha
1
(
tmp
)
;
}
while
(
tmp
!=
dp
)
;
do
{
++
val_vdp
;
tmp
=
map
.
phi2_
1
(
tmp
)
;
}
while
(
tmp
!=
dp
)
;
int
val_vddp
=
0
;
tmp
=
ddp
;
do
{
++
val_vddp
;
tmp
=
map
.
alpha
1
(
tmp
)
;
}
while
(
tmp
!=
ddp
)
;
do
{
++
val_vddp
;
tmp
=
map
.
phi2_
1
(
tmp
)
;
}
while
(
tmp
!=
ddp
)
;
if
(
val_vd
+
val_vdd
<
8
||
val_vd
+
val_vdd
>
11
||
val_vdp
<
5
||
val_vddp
<
5
)
return
false
;
...
...
@@ -115,18 +115,18 @@ bool edgeCanCollapse(typename PFP::MAP& map, Dart d)
unsigned
int
vu1
[
32
];
// pas de vector mais un tableau (find a la main, mais pas d'allocation par reserve)
val_vd
-=
3
;
// evite le -3 dans la boucle
val_vdd
-=
3
;
Dart
vit1
=
map
.
alpha
1
(
map
.
alpha
1
(
d
));
Dart
vit1
=
map
.
phi2_
1
(
map
.
phi2_
1
(
d
));
for
(
int
i
=
0
;
i
<
val_vd
;
++
i
)
{
unsigned
int
ve
=
map
.
getEmbedding
(
map
.
phi2
(
vit1
),
VERTEX
);
vu1
[
i
]
=
ve
;
vit1
=
map
.
alpha
1
(
vit1
);
vit1
=
map
.
phi2_
1
(
vit1
);
}
val_vd
--
;
// pour le parcours avec while >=0
Dart
vit2
=
map
.
alpha
1
(
map
.
alpha
1
(
dd
));
Dart
vit2
=
map
.
phi2_
1
(
map
.
phi2_
1
(
dd
));
for
(
int
i
=
0
;
i
<
val_vdd
;
++
i
)
{
unsigned
int
ve
=
map
.
getEmbedding
(
map
.
phi2
(
vit2
),
VERTEX
);
...
...
@@ -138,7 +138,7 @@ bool edgeCanCollapse(typename PFP::MAP& map, Dart d)
return
false
;
--
j
;
}
vit2
=
map
.
alpha
1
(
vit2
);
vit2
=
map
.
phi2_
1
(
vit2
);
}
return
true
;
...
...
include/Algo/Decimation/edgeSelector.hpp
View file @
4797d495
...
...
@@ -204,19 +204,19 @@ void EdgeSelector_Length<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
{
initEdgeInfo
(
vit
)
;
// various optimizations are applied here by
// treating differently :
Dart
vit2
=
m
.
alpha_1
(
m
.
phi1
(
vit
))
;
// - edges for which the criteria must be recomputed
Dart
vit2
=
m
.
phi12
(
m
.
phi1
(
vit
))
;
// - edges for which the criteria must be recomputed
Dart
stop
=
m
.
phi2
(
vit
)
;
// - edges that must be re-embedded
do
// - edges for which only the collapsibility must be re-tested
{
updateEdgeInfo
(
vit2
,
false
)
;
updateEdgeInfo
(
m
.
phi1
(
vit2
),
false
)
;
vit2
=
m
.
alpha_1
(
vit2
)
;
vit2
=
m
.
phi12
(
vit2
)
;
}
while
(
vit2
!=
stop
)
;
}
else
updateEdgeInfo
(
vit
,
true
)
;
vit
=
m
.
alpha
1
(
vit
)
;
vit
=
m
.
phi2_
1
(
vit
)
;
}
while
(
vit
!=
d2
)
;
cur
=
edges
.
begin
()
;
// set the current edge to the first one
...
...
@@ -399,19 +399,19 @@ void EdgeSelector_QEM<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
{
initEdgeInfo
(
vit
)
;
// various optimizations are applied here by
// treating differently :
Dart
vit2
=
m
.
alpha_1
(
m
.
phi1
(
vit
))
;
// - edges for which the criteria must be recomputed
Dart
vit2
=
m
.
phi12
(
m
.
phi1
(
vit
))
;
// - edges for which the criteria must be recomputed
Dart
stop
=
m
.
phi2
(
vit
)
;
// - edges that must be re-embedded
do
// - edges for which only the collapsibility must be re-tested
{
updateEdgeInfo
(
vit2
,
false
)
;
updateEdgeInfo
(
m
.
phi1
(
vit2
),
false
)
;
vit2
=
m
.
alpha_1
(
vit2
)
;
vit2
=
m
.
phi12
(
vit2
)
;
}
while
(
vit2
!=
stop
)
;
}
else
updateEdgeInfo
(
vit
,
true
)
;
vit
=
m
.
alpha
1
(
vit
)
;
vit
=
m
.
phi2_
1
(
vit
)
;
}
while
(
vit
!=
d2
)
;
cur
=
edges
.
begin
()
;
// set the current edge to the first one
...
...
@@ -604,7 +604,7 @@ void EdgeSelector_QEMml<PFP>::recomputeQuadric(const Dart d, const bool recomput
do
{
// Make step
dBack
=
this
->
m_map
.
phi2
(
dFront
)
;
dFront
=
this
->
m_map
.
alpha
1
(
dFront
)
;
dFront
=
this
->
m_map
.
phi2_
1
(
dFront
)
;
if
(
dBack
!=
dFront
)
{
// if dFront is no border
quadric
[
d
]
+=
Quadric
<
REAL
>
(
this
->
m_position
[
d
],
this
->
m_position
[
this
->
m_map
.
phi2
(
dFront
)],
this
->
m_position
[
dBack
])
;
...
...
@@ -633,16 +633,16 @@ void EdgeSelector_QEMml<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
else
// treating differently :
updateEdgeInfo
(
vit
,
true
)
;
Dart
vit2
=
m
.
alpha_1
(
m
.
phi1
(
vit
))
;
// - edges for which the criteria must be recomputed
Dart
vit2
=
m
.
phi12
(
m
.
phi1
(
vit
))
;
// - edges for which the criteria must be recomputed
Dart
stop
=
m
.
phi2
(
vit
)
;
// - edges that must be re-embedded
do
// - edges for which only the collapsibility must be re-tested
{
updateEdgeInfo
(
vit2
,
true
)
;
updateEdgeInfo
(
m
.
phi1
(
vit2
),
false
)
;
vit2
=
m
.
alpha_1
(
vit2
)
;
vit2
=
m
.
phi12
(
vit2
)
;
}
while
(
vit2
!=
stop
)
;
vit
=
m
.
alpha
1
(
vit
)
;
vit
=
m
.
phi2_
1
(
vit
)
;
}
while
(
vit
!=
d2
)
;
cur
=
edges
.
begin
()
;
// set the current edge to the first one
...
...
@@ -809,19 +809,19 @@ void EdgeSelector_Curvature<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
{
initEdgeInfo
(
vit
)
;
// various optimizations are applied here by
// treating differently :
Dart
vit2
=
m
.
alpha_1
(
m
.
phi1
(
vit
))
;
// - edges for which the criteria must be recomputed
Dart
vit2
=
m
.
phi12
(
m
.
phi1
(
vit
))
;
// - edges for which the criteria must be recomputed
Dart
stop
=
m
.
phi2
(
vit
)
;
// - edges that must be re-embedded
do
// - edges for which only the collapsibility must be re-tested
{
updateEdgeInfo
(
vit2
,
false
)
;
updateEdgeInfo
(
m
.
phi1
(
vit2
),
false
)
;
vit2
=
m
.
alpha_1
(
vit2
)
;
vit2
=
m
.
phi12
(
vit2
)
;
}
while
(
vit2
!=
stop
)
;
}
else
updateEdgeInfo
(
vit
,
true
)
;
vit
=
m
.
alpha
1
(
vit
)
;
vit
=
m
.
phi2_
1
(
vit
)
;
}
while
(
vit
!=
d2
)
;
cur
=
edges
.
begin
()
;
// set the current edge to the first one
...
...
@@ -1013,19 +1013,19 @@ void EdgeSelector_MinDetail<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
{
initEdgeInfo
(
vit
)
;
// various optimizations are applied here by
// treating differently :
Dart
vit2
=
m
.
alpha_1
(
m
.
phi1
(
vit
))
;
// - edges for which the criteria must be recomputed
Dart
vit2
=
m
.
phi12
(
m
.
phi1
(
vit
))
;
// - edges for which the criteria must be recomputed
Dart
stop
=
m
.
phi2
(
vit
)
;
// - edges that must be re-embedded
do
// - edges for which only the collapsibility must be re-tested
{
updateEdgeInfo
(
vit2
,
false
)
;
updateEdgeInfo
(
m
.
phi1
(
vit2
),
false
)
;
vit2
=
m
.
alpha_1
(
vit2
)
;
vit2
=
m
.
phi12
(
vit2
)
;
}
while
(
vit2
!=
stop
)
;
}
else
updateEdgeInfo
(
vit
,
true
)
;
vit
=
m
.
alpha
1
(
vit
)
;
vit
=
m
.
phi2_
1
(
vit
)
;
}
while
(
vit
!=
d2
)
;
cur
=
edges
.
begin
()
;
// set the current edge to the first one
...
...
include/Algo/Decimation/geometryApproximator.hpp
View file @
4797d495
...
...
@@ -64,7 +64,7 @@ void Approximator_QEM<PFP>::approximate(Dart d)
{
Quadric
<
REAL
>
q
(
this
->
m_attrV
[
it
],
this
->
m_attrV
[
m
.
phi1
(
it
)],
this
->
m_attrV
[
m
.
phi_1
(
it
)])
;
q1
+=
q
;
it
=
m
.
alpha
1
(
it
)
;
it
=
m
.
phi2_
1
(
it
)
;
}
while
(
it
!=
d
)
;
// compute the error quadric associated to v2
...
...
@@ -73,7 +73,7 @@ void Approximator_QEM<PFP>::approximate(Dart d)
{
Quadric
<
REAL
>
q
(
this
->
m_attrV
[
it
],
this
->
m_attrV
[
m
.
phi1
(
it
)],
this
->
m_attrV
[
m
.
phi_1
(
it
)])
;
q2
+=
q
;
it
=
m
.
alpha
1
(
it
)
;
it
=
m
.
phi2_
1
(
it
)
;
}
while
(
it
!=
dd
)
;
}
else
// if the selector is QEM, use the error quadrics computed by the selector
...
...
@@ -138,7 +138,7 @@ void Approximator_QEMhalfEdge<PFP>::approximate(Dart d)
{
Quadric
<
REAL
>
q
(
this
->
m_attrV
[
it
],
this
->
m_attrV
[
m
.
phi1
(
it
)],
this
->
m_attrV
[
m
.
phi_1
(
it
)])
;
q1
+=
q
;
it
=
m
.
alpha
1
(
it
)
;
it
=
m
.
phi2_
1
(
it
)
;
}
while
(
it
!=
d
)
;
// compute the error quadric associated to v2
...
...
@@ -147,7 +147,7 @@ void Approximator_QEMhalfEdge<PFP>::approximate(Dart d)
{
Quadric
<
REAL
>
q
(
this
->
m_attrV
[
it
],
this
->
m_attrV
[
m
.
phi1
(
it
)],
this
->
m_attrV
[
m
.
phi_1
(
it
)])
;
q2
+=
q
;
it
=
m
.
alpha
1
(
it
)
;
it
=
m
.
phi2_
1
(
it
)
;
}
while
(
it
!=
dd
)
;
}
else
// if the selector is QEM, use the error quadrics computed by the selector
...
...
@@ -312,14 +312,14 @@ void Approximator_CornerCutting<PFP>::approximate(Dart d)
do
{
++
k1
;
it
=
m
.
alpha
1
(
it
)
;
it
=
m
.
phi2_
1
(
it
)
;
}
while
(
it
!=
d
)
;
REAL
k2
=
0
;
it
=
dd
;
do
{
++
k2
;
it
=
m
.
alpha
1
(
it
)
;
it
=
m
.
phi2_
1
(
it
)
;
}
while
(
it
!=
dd
)
;
REAL
alpha
=
(
k1
-
1
)
*
(
k2
-
1
)
/
(
k1
*
k2
-
1
)
;
...
...
@@ -330,7 +330,7 @@ void Approximator_CornerCutting<PFP>::approximate(Dart d)
do
{
m1
+=
this
->
m_attrV
[
m
.
phi1
(
it
)]
;
it
=
m
.
alpha
1
(
it
)
;
it
=
m
.
phi2_
1
(
it
)
;
++
count
;
}
while
(
it
!=
d
)
;
m1
/=
REAL
(
count
)
;
...
...
@@ -342,7 +342,7 @@ void Approximator_CornerCutting<PFP>::approximate(Dart d)
do
{
m2
+=
this
->
m_attrV
[
m
.
phi1
(
it
)]
;
it
=
m
.
alpha
1
(
it
)
;
it
=
m
.
phi2_
1
(
it
)
;
++
count
;
}
while
(
it
!=
dd
)
;
m2
/=
REAL
(
count
)
;
...
...
include/Algo/Decimation/geometryPredictor.hpp
View file @
4797d495
...
...
@@ -51,7 +51,7 @@ void Predictor_HalfCollapse<PFP>::predict(Dart d2, Dart dd2)
Dart
it
=
dd2
;
do
{
s2_1
+=
this
->
m_attrV
[
m
.
phi1
(
it
)]
;
it
=
m
.
alpha
1
(
it
)
;
it
=
m
.
phi2_
1
(
it
)
;
++
k2
;
}
while
(
m
.
phi2
(
it
)
!=
m
.
phi_1
(
d2
))
;
...
...
@@ -84,12 +84,12 @@ typename PFP::REAL Predictor_CornerCutting<PFP>::autoAlpha(Dart d2, Dart dd2)
do
{
++
k1
;
it
=
m
.
alpha
1
(
it
)
;
it
=
m
.
phi2_
1
(
it
)
;
}
while
(
it
!=
dd2
)
;
do
{
++
k2
;
it
=
m
.
alpha
1
(
it
)
;
it
=
m
.
phi2_
1
(
it
)
;
}
while
(
it
!=
d2
)
;
return
(
k1
-
1
)
*
(
k2
-
1
)
/
(
k1
*
k2
-
1
)
;
}
...
...
@@ -116,7 +116,7 @@ void Predictor_CornerCutting<PFP>::predict(Dart d2, Dart dd2)
Dart
it
=
d2
;
do
{
m1
+=
this
->
m_attrV
[
m
.
phi1
(
it
)]
;
it
=
m
.
alpha
1
(
it
)
;
it
=
m
.
phi2_
1
(
it
)
;
++
count
;
}
while
(
m
.
phi2
(
it
)
!=
m
.
phi_1
(
dd2
))
;
m1
/=
REAL
(
count
)
;
...
...
@@ -130,7 +130,7 @@ void Predictor_CornerCutting<PFP>::predict(Dart d2, Dart dd2)
it
=
dd2
;
do
{
m2
+=
this
->
m_attrV
[
m
.
phi1
(
it
)]
;
it
=
m
.
alpha
1
(
it
)
;
it
=
m
.
phi2_
1
(
it
)
;
++
count
;
}
while
(
m
.
phi2
(
it
)
!=
m
.
phi_1
(
d2
))
;
m2
/=
REAL
(
count
)
;
...
...
@@ -155,7 +155,7 @@ void Predictor_TangentPredict1<PFP>::predictedTangent(Dart d2, Dart dd2, VEC3& d
Dart
it
=
d2
;
do
{
s1_1
+=
this
->
m_attrV
[
m
.
phi1
(
it
)]
;
it
=
m
.
alpha
1
(
it
)
;
it
=
m
.
phi2_
1
(
it
)
;
++
k1
;
}
while
(
m
.
phi2
(
it
)
!=
m
.
phi_1
(
dd2
))
;
...
...
@@ -163,7 +163,7 @@ void Predictor_TangentPredict1<PFP>::predictedTangent(Dart d2, Dart dd2, VEC3& d
it
=
dd2
;
do
{
s2_1
+=
this
->
m_attrV
[
m
.
phi1
(
it
)]
;
it
=
m
.
alpha
1
(
it
)
;
it
=
m
.
phi2_
1
(
it
)
;
++
k2
;
}
while
(
m
.
phi2
(
it
)
!=
m
.
phi_1
(
d2
))
;
...
...
@@ -210,7 +210,7 @@ void Predictor_TangentPredict2<PFP>::predictedTangent(Dart d2, Dart dd2, VEC3& d
Dart
it
=
d2
;
do
{
s1_1
+=
this
->
m_attrV
[
m
.
phi1
(
it
)]
;
it
=
m
.
alpha
1
(
it
)
;
it
=
m
.
phi2_
1
(
it
)
;
++
k1
;
}
while
(
m
.
phi2
(
it
)
!=
m
.
phi_1
(
dd2
))
;
...
...
@@ -221,7 +221,7 @@ void Predictor_TangentPredict2<PFP>::predictedTangent(Dart d2, Dart dd2, VEC3& d
Dart
p2
=
m
.
phi2
(
p1
)
;
if
(
p2
!=
p1
)
s1_2
+=
this
->
m_attrV
[
m
.
phi_1
(
p2
)]
;
it
=
m
.
alpha
1
(
it
)
;
it
=
m
.
phi2_
1
(
it
)
;
}
while
(
it
!=
dd2
)
;
s1_2
+=
this
->
m_attrV
[
m
.
phi_1
(
d1
)]
;
s1_2
+=
this
->
m_attrV
[
m
.
phi_1
(
dd2
)]
;
...
...
@@ -230,7 +230,7 @@ void Predictor_TangentPredict2<PFP>::predictedTangent(Dart d2, Dart dd2, VEC3& d
it
=
dd2
;
do
{
s2_1
+=
this
->
m_attrV
[
m
.
phi2
(
it
)]
;
it
=
m
.
alpha
1
(
it
)
;
it
=
m
.
phi2_
1
(
it
)
;
++
k2
;
}
while
(
m
.
phi2
(
it
)
!=
m
.
phi_1
(
d2
))
;
...
...
@@ -241,7 +241,7 @@ void Predictor_TangentPredict2<PFP>::predictedTangent(Dart d2, Dart dd2, VEC3& d
Dart
p2
=
m
.
phi2
(
p1
)
;
if
(
p2
!=
p1
)
s2_2
+=
this
->
m_attrV
[
m
.
phi_1
(
p2
)]
;
it
=
m
.
alpha
1
(
it
)
;
it
=
m
.
phi2_
1
(
it
)
;
}
while
(
it
!=
d2
)
;
s2_2
+=
this
->
m_attrV
[
m
.
phi_1
(
dd1
)]
;
s2_2
+=
this
->
m_attrV
[
m
.
phi_1
(
d2
)]
;
...
...
include/Algo/Decimation/halfEdgeSelector.hpp
View file @
4797d495
...
...
@@ -161,7 +161,7 @@ void HalfEdgeSelector_QEMml<PFP>::recomputeQuadric(const Dart d, const bool reco
do
{
// Make step
dBack
=
this
->
m_map
.
phi1
(
dFront
)
;
dFront
=
this
->
m_map
.
alpha
1
(
dFront
)
;
dFront
=
this
->
m_map
.
phi2_
1
(
dFront
)
;
if
(
this
->
m_map
.
phi2
(
dFront
)
!=
dFront
)
{
// if dFront is no border
quadric
[
d
]
+=
Quadric
<
REAL
>
(
this
->
m_position
[
d
],
this
->
m_position
[
dBack
],
this
->
m_position
[
this
->
m_map
.
phi1
(
dFront
)])
;
...
...
@@ -195,7 +195,7 @@ void HalfEdgeSelector_QEMml<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
Dart
stop
=
m
.
phi2
(
vit
)
;
assert
(
stop
!=
vit
)
;
Dart
vit2
=
m
.
alpha_1
(
m
.
phi1
(
vit
))
;
Dart
vit2
=
m
.
phi12
(
m
.
phi1
(
vit
))
;
do
{
updateHalfEdgeInfo
(
vit2
,
true
)
;
d
=
m
.
phi2
(
vit2
)
;
...
...
@@ -207,9 +207,9 @@ void HalfEdgeSelector_QEMml<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
if
(
d
!=
m
.
phi1
(
vit2
))
;
updateHalfEdgeInfo
(
d
,
false
)
;
vit2
=
m
.
alpha_1
(
vit2
)
;
vit2
=
m
.
phi12
(
vit2
)
;
}
while
(
stop
!=
vit2
)
;
vit
=
m
.
alpha
1
(
vit
)
;
vit
=
m
.
phi2_
1
(
vit
)
;
}
while
(
vit
!=
d2
)
;
cur
=
halfEdges
.
begin
()
;
// set the current edge to the first one
...
...
@@ -418,7 +418,7 @@ void HalfEdgeSelector_Lightfield<PFP>::recomputeQuadric(const Dart d, const bool
do
{
// Make step
dBack
=
this
->
m_map
.
phi1
(
dFront
)
;
dFront
=
this
->
m_map
.
alpha
1
(
dFront
)
;
dFront
=
this
->
m_map
.
phi2_
1
(
dFront
)
;
if
(
dBack
!=
dFront
)
{
// if dFront is no border
quadric
[
d
]
+=
Quadric
<
REAL
>
(
this
->
m_position
[
d
],
this
->
m_position
[
this
->
m_map
.
phi1
(
dFront
)],
this
->
m_position
[
dBack
])
;
...
...
@@ -451,7 +451,7 @@ void HalfEdgeSelector_Lightfield<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
Dart
stop
=
m
.
phi2
(
vit
)
;
assert
(
stop
!=
vit
)
;
Dart
vit2
=
m
.
alpha_1
(
m
.
phi1
(
vit
))
;
Dart
vit2
=
m
.
phi12
(
m
.
phi1
(
vit
))
;
do
{
updateHalfEdgeInfo
(
vit2
,
true
)
;
d
=
m
.
phi2
(
vit2
)
;
...
...
@@ -463,9 +463,9 @@ void HalfEdgeSelector_Lightfield<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
if
(
d
!=
m
.
phi1
(
vit2
))
;
updateHalfEdgeInfo
(
d
,
false
)
;
vit2
=
m
.
alpha_1
(
vit2
)
;
vit2
=
m
.
phi12
(
vit2
)
;
}
while
(
stop
!=
vit2
)
;
vit
=
m
.
alpha
1
(
vit
)
;
vit
=
m
.
phi2_
1
(
vit
)
;
}
while
(
vit
!=
d2
)
;
...
...
@@ -694,19 +694,19 @@ void EdgeSelector_Lightfield<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
{
initEdgeInfo(vit) ; // various optimizations are applied here by
// treating differently :
Dart vit2 = m.
alpha_1
(m.phi1(vit)) ; // - edges for which the criteria must be recomputed
Dart vit2 = m.
phi12
(m.phi1(vit)) ; // - edges for which the criteria must be recomputed
Dart stop = m.phi2(vit) ; // - edges that must be re-embedded
do // - edges for which only the collapsibility must be re-tested
{
updateEdgeInfo(vit2, false) ;
updateEdgeInfo(m.phi1(vit2), false) ;
vit2 = m.
alpha_1
(vit2) ;
vit2 = m.
phi12
(vit2) ;
} while(vit2 != stop) ;
}
else
updateEdgeInfo(vit, true) ;
vit = m.
alpha
1(vit) ;
vit = m.
phi2_
1(vit) ;
} while(vit != d2) ;
cur = edges.begin() ; // set the current edge to the first one
...
...
include/Algo/Decimation/lightfieldApproximator.hpp
View file @
4797d495
...
...
@@ -108,16 +108,16 @@ void Approximator_RGBfunctionsHalf<PFP>::approximate(Dart d)
// REAL gamma1 = ((j1 * i) > 0 ? 1 : -1) * acos( std::max(std::min(1.0f, i1 * i ), -1.0f)) ; // angle positif ssi
REAL
gamma2
=
((
j2
*
i
)
>
0
?
1
:
-
1
)
*
acos
(
std
::
max
(
std
::
min
(
1.0
f
,
i2
*
i
),
-
1.0
f
))
;
// -PI/2 < angle(i,j1) < PI/2 ssi i*j1 > 0
// Rotation dans le sens trigo autour de l'axe i (n1->n)
// REAL
alpha
1 = ((n * j1pr) > 0 ? -1 : 1) * acos( std::max(std::min(1.0f, n * n1), -1.0f) ) ; // angle positif ssi
// REAL
phi2_
1 = ((n * j1pr) > 0 ? -1 : 1) * acos( std::max(std::min(1.0f, n * n1), -1.0f) ) ; // angle positif ssi
REAL
alpha2
=
((
n
*
j2pr
)
>
0
?
-
1
:
1
)
*
acos
(
std
::
max
(
std
::
min
(
1.0
f
,
n
*
n2
),
-
1.0
f
)
)
;
// PI/2 < angle(j1',n) < -PI/2 ssi j1'*n < 0
// assert (-0.01 < gamma1 && gamma1 < 0.01) ;
// assert (-0.01 <
alpha1 && alpha
1 < 0.01) ;
// assert (-0.01 <
phi2_1 && phi2_
1 < 0.01) ;
REAL
gamma1
=
REAL
(
0
)
;
REAL
alpha
1
=
REAL
(
0
)
;
REAL
phi2_
1
=
REAL
(
0
)
;
// Create and sum quadrics
m_quadricRGBfunctions
[
d
]
+=
QuadricRGBfunctions
<
REAL
>
(
this
->
m_attrV
[
d
],
gamma1
,
alpha
1
)
;
m_quadricRGBfunctions
[
d
]
+=
QuadricRGBfunctions
<
REAL
>
(
this
->
m_attrV
[
d
],
gamma1
,
phi2_
1
)
;
m_quadricRGBfunctions
[
d
]
+=
QuadricRGBfunctions
<
REAL
>
(
this
->
m_attrV
[
dd
],
gamma2
,
alpha2
)
;
}
...
...
@@ -246,12 +246,12 @@ void Approximator_RGBfunctions<PFP>::approximate(Dart d)
REAL
gamma1
=
((
j1
*
i
)
>
0
?
1
:
-
1
)
*
acos
(
std
::
max
(
std
::
min
(
1.0
f
,
i1
*
i
),
-
1.0
f
))
;
// angle positif ssi
REAL
gamma2
=
((
j2
*
i
)
>
0
?
1
:
-
1
)
*
acos
(
std
::
max
(
std
::
min
(
1.0
f
,
i2
*
i
),
-
1.0
f
))
;
// -PI/2 < angle(i,j1) < PI/2 ssi i*j1 > 0
// Rotation dans le sens trigo autour de l'axe i (n1->n)
REAL
alpha
1
=
((
n
*
j1pr
)
>
0
?
-
1
:
1
)
*
acos
(
std
::
max
(
std
::
min
(
1.0
f
,
n
*
n1
),
-
1.0
f
)
)
;
// angle positif ssi
REAL
phi2_
1
=
((
n
*
j1pr
)
>
0
?
-
1
:
1
)
*
acos
(
std
::
max
(
std
::
min
(
1.0
f
,
n
*
n1
),
-
1.0
f
)
)
;
// angle positif ssi
REAL
alpha2
=
((
n
*
j2pr
)
>
0
?
-
1
:
1
)
*
acos
(
std
::
max
(
std
::
min
(
1.0
f
,
n
*
n2
),
-
1.0
f
)
)
;
// PI/2 < angle(j1',n) < -PI/2 ssi j1'*n < 0
// assert (-3.15 < gamma1 && gamma1 <= 3.15) ;
// assert (-3.15 < gamma2 && gamma2 <= 3.15) ;
// assert (-3.15 <
alpha1 && alpha
1 <= 3.15) ;
// assert (-3.15 <
phi2_1 && phi2_
1 <= 3.15) ;
// assert (-3.15 < alpha2 && alpha2 <= 3.15) ;
// MATRIX36 &f1 = this->m_attrV[d] ;
...
...
@@ -259,7 +259,7 @@ void Approximator_RGBfunctions<PFP>::approximate(Dart d)
// Create and sum quadrics
m_quadricRGBfunctions
[
d
].
zero
()
;
m_quadricRGBfunctions
[
d
]
+=
QuadricRGBfunctions
<
REAL
>
(
this
->
m_attrV
[
d
],
gamma1
,
alpha
1
)
;
m_quadricRGBfunctions
[
d
]
+=
QuadricRGBfunctions
<
REAL
>
(
this
->
m_attrV
[
d
],
gamma1
,
phi2_
1
)
;
m_quadricRGBfunctions
[
d
]
+=
QuadricRGBfunctions
<
REAL
>
(
this
->
m_attrV
[
dd
],
gamma2
,
alpha2
)
;
// Compute new function
...
...
include/Algo/Decimation/simplifMesh.hpp
View file @
4797d495
...
...
@@ -181,7 +181,7 @@ void SimplifTrian<PFP>::updateCriterias(Dart d)
m_protectMarker
.
mark
(
em
)
;
// next edge
d
=
m_map
.
alpha
1
(
d
);
d
=
m_map
.
phi2_
1
(
d
);
}
while
(
d
!=
dd
);
}
...
...
@@ -212,15 +212,15 @@ Dart SimplifTrian<PFP>::edgeCollapse(Dart d, typename PFP::VEC3& newPos)
{
CRIT
*
cr
=
getCrit
(
xd
);
cr
->
tagDirty
();
xd
=
m_map
.
alpha
1
(
xd
);
xd
=
m_map
.
phi2_
1
(
xd
);
}
while
(
xd
!=
d
);
xd
=
m_map
.
alpha
1
(
dd
);
//
alpha
1 pour ne pas repasser sur l'arete d/dd
xd
=
m_map
.
phi2_
1
(
dd
);
//
phi2_
1 pour ne pas repasser sur l'arete d/dd
do
{
CRIT
*
cr
=
getCrit
(
xd
);
cr
->
tagDirty
();
xd
=
m_map
.
alpha
1
(
xd
);
xd
=
m_map
.
phi2_
1
(
xd
);
}
while
(
xd
!=
dd
);
// store old valences
...
...
include/Algo/Geometry/stats.h
View file @
4797d495
...
...
@@ -125,7 +125,7 @@ void statModele(typename PFP::MAP& map, const typename PFP::TVEC3& position)
// do
// {
// nbEdgePerVertex++ ;
// e = map.
alpha
1(e) ;
// e = map.
phi2_
1(e) ;
// }
// while (e != d) ;
// }
...
...
include/Algo/Import/importSvg.hpp
View file @
4797d495
...
...
@@ -518,7 +518,7 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, typename PFP
//if the valence of one of the vertex is equal to one
//cut the edge to insert the quadrangular face
if
(
map
.
alpha
1
(
d1
)
==
d1
)
if
(
map
.
phi2_
1
(
d1
)
==
d1
)
{
map
.
cutEdge
(
d2
);
...
...
@@ -530,7 +530,7 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, typename PFP
edgePlanes
[
map
.
phi_1
(
d1
)]
=
Geom
::
Plane3D
<
typename
PFP
::
REAL
>
(
v
,
p1
);
}
if
(
map
.
alpha
1
(
d2
)
==
d2
)
if
(
map
.
phi2_
1
(
d2
)
==
d2
)
{
map
.
cutEdge
(
d1
);
brokenL
.
mark
(
map
.
phi1
(
d1
));
...
...
include/Algo/LinearSolving/matrixSetup.h
View file @
4797d495
...
...
@@ -327,7 +327,7 @@ public:
REAL
aij
=
edgeWeight
[
it
]
/
vArea
;
aii
+=
aij
;
solver
->
add_coefficient
(
indexTable
[
this
->
m_map
.
phi1
(
it
)],
aij
)
;
it
=
this
->
m_map
.
alpha
1
(
it
)
;
it
=
this
->
m_map
.
phi2_
1
(
it
)
;
}
while
(
it
!=
d
)
;
solver
->
add_coefficient
(
indexTable
[
d
],
-
aii
)
;
solver
->
normalize_row
()
;
...
...
include/Algo/Modelisation/extrusion.hpp