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
35e4aa3e
Commit
35e4aa3e
authored
Apr 30, 2012
by
Pierre Kraemer
Browse files
quick traversal fixes
parent
8425dfda
Changes
4
Hide whitespace changes
Inline
Side-by-side
Apps/Examples/viewer.cpp
View file @
35e4aa3e
...
...
@@ -214,6 +214,8 @@ void Viewer::importMesh(std::string& filename)
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
}
myMap
.
enableQuickTraversal
<
VERTEX
>
()
;
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
POINTS
)
;
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
LINES
)
;
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
TRIANGLES
)
;
...
...
include/Topology/generic/genericmap.hpp
View file @
35e4aa3e
...
...
@@ -371,13 +371,15 @@ inline void GenericMap::enableQuickTraversal()
template
<
unsigned
int
ORBIT
>
inline
void
GenericMap
::
updateQuickTraversal
()
{
CellMarker
<
ORBIT
>
cm
;
assert
(
m_quickTraversal
[
ORBIT
]
!=
NULL
||
!
"updateQuickTraversal on a disabled orbit"
)
;
CellMarker
<
ORBIT
>
cm
(
*
this
)
;
for
(
Dart
d
=
begin
();
d
!=
end
();
next
(
d
))
{
if
(
!
cm
.
isMarked
(
d
))
{
cm
.
mark
(
d
)
;
(
*
m_quickTraversal
[
ORBIT
])[
d
.
index
]
=
d
;
(
*
m_quickTraversal
[
ORBIT
])[
getEmbedding
<
ORBIT
>
(
d
)
]
=
d
;
}
}
}
...
...
include/Topology/generic/traversorCell.h
View file @
35e4aa3e
...
...
@@ -37,7 +37,9 @@ class TraversorCell
{
private:
MAP
&
m
;
AttributeContainer
*
cont
;
unsigned
int
qCurrent
;
DartMarker
*
dmark
;
CellMarker
<
ORBIT
>*
cmark
;
...
...
include/Topology/generic/traversorCell.hpp
View file @
35e4aa3e
...
...
@@ -60,7 +60,8 @@ Dart TraversorCell<MAP, ORBIT>::begin()
{
if
(
quickTraversal
!=
NULL
)
{
current
=
(
*
quickTraversal
)[
cont
->
begin
()]
;
qCurrent
=
cont
->
begin
()
;
current
=
(
*
quickTraversal
)[
qCurrent
]
;
}
else
{
...
...
@@ -103,32 +104,40 @@ Dart TraversorCell<MAP, ORBIT>::next()
{
if
(
current
!=
NIL
)
{
bool
ismarked
;
if
(
dmark
)
ismarked
=
dmark
->
isMarked
(
current
)
;
if
(
quickTraversal
!=
NULL
)
{
cont
->
next
(
qCurrent
)
;
current
=
(
*
quickTraversal
)[
qCurrent
]
;
}
else
ismarked
=
cmark
->
isMarked
(
current
)
;
while
(
current
!=
NIL
&&
(
ismarked
||
m
.
isBoundaryMarked
(
current
)
||
!
m_good
(
current
)))
{
m
.
next
(
current
)
;
if
(
current
==
m
.
end
()
)
current
=
NIL
;
bool
ismarked
;
if
(
dmark
)
ismarked
=
dmark
->
isMarked
(
current
)
;
else
ismarked
=
cmark
->
isMarked
(
current
)
;
while
(
current
!=
NIL
&&
(
ismarked
||
m
.
isBoundaryMarked
(
current
)
||
!
m_good
(
current
)))
{
if
(
dmark
)
ismarked
=
dmark
->
isMarked
(
current
)
;
m
.
next
(
current
)
;
if
(
current
==
m
.
end
())
current
=
NIL
;
else
ismarked
=
cmark
->
isMarked
(
current
)
;
{
if
(
dmark
)
ismarked
=
dmark
->
isMarked
(
current
)
;
else
ismarked
=
cmark
->
isMarked
(
current
)
;
}
}
}
if
(
current
!=
NIL
)
{
if
(
dmark
)
dmark
->
markOrbit
<
ORBIT
>
(
current
)
;
else
cmark
->
mark
(
current
)
;
if
(
current
!=
NIL
)
{
if
(
dmark
)
dmark
->
markOrbit
<
ORBIT
>
(
current
)
;
else
cmark
->
mark
(
current
)
;
}
}
}
return
current
;
...
...
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