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
742d8e66
Commit
742d8e66
authored
Feb 15, 2011
by
Pierre Kraemer
Browse files
operator const dans les Dart + micro optim oldest dart IHM
parent
ce36e5a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/Topology/generic/dart.h
View file @
742d8e66
...
...
@@ -54,19 +54,19 @@ struct Dart
* equality operator
* @param d the dart to compare with
*/
bool
operator
==
(
Dart
d
)
{
return
d
.
index
==
index
;
}
bool
operator
==
(
Dart
d
)
const
{
return
d
.
index
==
index
;
}
/**
* different operator
* @param d the dart to compare with
*/
bool
operator
!=
(
Dart
d
)
{
return
d
.
index
!=
index
;
}
bool
operator
!=
(
Dart
d
)
const
{
return
d
.
index
!=
index
;
}
/**
* less operator, can be used for sorting
* @param d the dart to compare with
*/
bool
operator
<
(
Dart
d
)
{
return
d
.
index
<
index
;
}
bool
operator
<
(
Dart
d
)
const
{
return
index
<
d
.
index
;
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
Dart
&
fa
)
{
return
out
<<
fa
.
index
;
}
friend
std
::
istream
&
operator
>>
(
std
::
istream
&
in
,
Dart
&
fa
)
{
in
>>
fa
.
index
;
return
in
;
}
...
...
src/Algo/ImplicitHierarchicalMesh/ihm.cpp
View file @
742d8e66
...
...
@@ -81,6 +81,7 @@ void ImplicitHierarchicalMap::initEdgeId()
unsigned
int
ImplicitHierarchicalMap
::
faceLevel
(
Dart
d
)
{
assert
(
m_dartLevel
[
d
]
<=
m_curLevel
||
!
"Access to a dart introduced after current level"
)
;
if
(
m_curLevel
==
0
)
return
0
;
...
...
@@ -126,14 +127,19 @@ unsigned int ImplicitHierarchicalMap::faceLevel(Dart d)
Dart
it
=
d
;
Dart
old
=
it
;
unsigned
int
l_old
=
m_dartLevel
[
old
]
;
unsigned
int
fLevel
=
edgeLevel
(
it
)
;
do
{
it
=
phi1
(
it
)
;
if
(
m_dartLevel
[
it
]
<
m_dartLevel
[
old
])
// in a first time, the level of a face
old
=
it
;
// is the minimum of the levels
unsigned
int
l
=
edgeLevel
(
it
)
;
// of its edges
fLevel
=
l
<
fLevel
?
l
:
fLevel
;
unsigned
int
dl
=
m_dartLevel
[
it
]
;
if
(
dl
<
l_old
)
// compute the oldest dart of the face
{
// in the same time
old
=
it
;
l_old
=
dl
;
}
// in a first time, the level of a face
unsigned
int
l
=
edgeLevel
(
it
)
;
// is the minimum of the levels
fLevel
=
l
<
fLevel
?
l
:
fLevel
;
// of its edges
}
while
(
it
!=
d
)
;
unsigned
int
cur
=
m_curLevel
;
...
...
@@ -180,11 +186,16 @@ Dart ImplicitHierarchicalMap::faceOldestDart(Dart d)
assert
(
m_dartLevel
[
d
]
<=
m_curLevel
||
!
"Access to a dart introduced after current level"
)
;
Dart
it
=
d
;
Dart
oldest
=
it
;
unsigned
int
l_old
=
m_dartLevel
[
oldest
]
;
do
{
it
=
phi1
(
it
)
;
if
(
m_dartLevel
[
it
]
<
m_dartLevel
[
oldest
])
unsigned
int
l
=
m_dartLevel
[
it
]
;
if
(
l
<
l_old
||
(
l
==
l_old
&&
it
<
oldest
))
{
oldest
=
it
;
l_old
=
l
;
}
it
=
phi1
(
it
)
;
}
while
(
it
!=
d
)
;
return
oldest
;
}
...
...
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