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
David Cazier
CGoGN
Commits
7bc719f8
Commit
7bc719f8
authored
Jan 31, 2011
by
Pierre Kraemer
Browse files
IHM -> test arete simplifiable
parent
0966f73e
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/Algo/ImplicitHierarchicalMesh/ihm.h
View file @
7bc719f8
...
...
@@ -174,6 +174,14 @@ public:
*/
bool
edgeIsSubdivided
(
Dart
d
)
;
/**
* Return true if the edge of d in the current level map
* is subdivided to the next level,
* none of its resulting edges is in turn subdivided to the next level
* and the middle vertex is of degree 2
*/
bool
edgeCanBeCoarsened
(
Dart
d
)
;
/**
* Return true if the face of d in the current level map
* has already been subdivided to the next level
...
...
@@ -183,7 +191,7 @@ public:
/**
* Return true if the face of d in the current level map
* is subdivided to the next level
* and none of
these
resulting faces is in turn subdivided to the next level
* and none of
its
resulting faces is in turn subdivided to the next level
*/
bool
faceIsSubdividedOnce
(
Dart
d
)
;
}
;
...
...
include/Algo/ImplicitHierarchicalMesh/subdivision.hpp
View file @
7bc719f8
...
...
@@ -144,6 +144,8 @@ template <typename PFP>
void
coarsenEdge
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
&
position
)
{
assert
(
map
.
getDartLevel
(
d
)
<=
map
.
getCurrentLevel
()
||
!
"Access to a dart introduced after current level"
)
;
assert
(
map
.
edgeCanBeCoarsened
(
d
)
||
!
"Trying to coarsen an edge that can not be coarsened"
)
;
}
template
<
typename
PFP
>
...
...
src/Algo/ImplicitHierarchicalMesh/ihm.cpp
View file @
7bc719f8
...
...
@@ -131,18 +131,10 @@ Dart ImplicitHierarchicalMap::faceOldestDart(Dart d)
bool
ImplicitHierarchicalMap
::
edgeIsSubdivided
(
Dart
d
)
{
assert
(
m_dartLevel
[
d
]
<=
m_curLevel
||
!
"Access to a dart introduced after current level"
)
;
// Dart d2 = phi2(d) ;
// ++m_curLevel ;
// Dart d2_l = phi2(d) ;
// --m_curLevel ;
// if(d2 != d2_l)
// return true ;
// else
// return false ;
Dart
d1
=
phi1
(
d
)
;
++
m_curLevel
;
// Dart d2_l = phi2(d) ;
Dart
d1_l
=
phi1
(
d
)
;
--
m_curLevel
;
if
(
d1
!=
d1_l
)
...
...
@@ -151,6 +143,28 @@ bool ImplicitHierarchicalMap::edgeIsSubdivided(Dart d)
return
false
;
}
bool
ImplicitHierarchicalMap
::
edgeCanBeCoarsened
(
Dart
d
)
{
assert
(
m_dartLevel
[
d
]
<=
m_curLevel
||
!
"Access to a dart introduced after current level"
)
;
bool
subd
=
false
;
bool
subdOnce
=
true
;
bool
degree2
=
false
;
if
(
edgeIsSubdivided
(
d
))
{
subd
=
true
;
Dart
d2
=
phi2
(
d
)
;
++
m_curLevel
;
if
(
vertexDegree
(
phi1
(
d
))
==
2
)
{
degree2
=
true
;
if
(
edgeIsSubdivided
(
d
)
||
edgeIsSubdivided
(
d2
))
subdOnce
=
false
;
}
--
m_curLevel
;
}
return
subd
&&
degree2
&&
subdOnce
;
}
bool
ImplicitHierarchicalMap
::
faceIsSubdivided
(
Dart
d
)
{
assert
(
m_dartLevel
[
d
]
<=
m_curLevel
||
!
"Access to a dart introduced after current level"
)
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment