Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Pitiot
CGoGN
Commits
db57adec
Commit
db57adec
authored
Jan 11, 2013
by
Thery Sylvain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
specialization of TravesorCell for GenericMap
parent
aaf269c0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
177 additions
and
1 deletion
+177
-1
include/Topology/generic/genericmap.h
include/Topology/generic/genericmap.h
+2
-1
include/Topology/generic/genericmap.hpp
include/Topology/generic/genericmap.hpp
+6
-0
include/Topology/generic/traversorCell.h
include/Topology/generic/traversorCell.h
+33
-0
include/Topology/generic/traversorCell.hpp
include/Topology/generic/traversorCell.hpp
+136
-0
No files found.
include/Topology/generic/genericmap.h
View file @
db57adec
...
@@ -168,7 +168,7 @@ public:
...
@@ -168,7 +168,7 @@ public:
virtual
unsigned
int
dimension
()
const
=
0
;
virtual
unsigned
int
dimension
()
const
=
0
;
static
const
unsigned
int
DIMENSION
=
0
;
//
static const unsigned int DIMENSION = 0 ;
/**
/**
* Clear the map
* Clear the map
* @param removeAttrib
* @param removeAttrib
...
@@ -741,6 +741,7 @@ public:
...
@@ -741,6 +741,7 @@ public:
bool
isBoundaryMarked2
(
Dart
d
)
const
;
bool
isBoundaryMarked2
(
Dart
d
)
const
;
bool
isBoundaryMarked3
(
Dart
d
)
const
;
bool
isBoundaryMarked3
(
Dart
d
)
const
;
bool
isBoundaryMarkedCurrent
(
Dart
d
)
const
;
protected:
protected:
/**
/**
...
...
include/Topology/generic/genericmap.hpp
View file @
db57adec
...
@@ -705,6 +705,12 @@ inline bool GenericMap::isBoundaryMarked(Dart d) const
...
@@ -705,6 +705,12 @@ inline bool GenericMap::isBoundaryMarked(Dart d) const
}
}
inline
bool
GenericMap
::
isBoundaryMarkedCurrent
(
Dart
d
)
const
{
return
m_markTables
[
DART
][
0
]
->
operator
[](
dartIndex
(
d
)).
testMark
(
m_boundaryMarkers
[
this
->
dimension
()
-
2
]);
}
inline
void
GenericMap
::
boundaryMark2
(
Dart
d
)
inline
void
GenericMap
::
boundaryMark2
(
Dart
d
)
{
{
boundaryMark
<
2
>
(
d
);
boundaryMark
<
2
>
(
d
);
...
...
include/Topology/generic/traversorCell.h
View file @
db57adec
...
@@ -64,6 +64,39 @@ public:
...
@@ -64,6 +64,39 @@ public:
void
skip
(
Dart
d
);
void
skip
(
Dart
d
);
}
;
}
;
template
<
unsigned
int
ORBIT
>
class
TraversorCell
<
GenericMap
,
ORBIT
>
:
public
Traversor
<
GenericMap
>
{
private:
GenericMap
&
m
;
AttributeContainer
*
cont
;
unsigned
int
qCurrent
;
DartMarker
*
dmark
;
CellMarker
<
ORBIT
>*
cmark
;
AttributeMultiVector
<
Dart
>*
quickTraversal
;
Dart
current
;
bool
firstTraversal
;
const
FunctorSelect
&
m_good
;
public:
TraversorCell
(
GenericMap
&
map
,
const
FunctorSelect
&
good
=
allDarts
,
bool
forceDartMarker
=
false
,
unsigned
int
thread
=
0
)
;
~
TraversorCell
()
;
Dart
begin
()
;
Dart
end
()
;
Dart
next
()
;
void
skip
(
Dart
d
);
}
;
template
<
typename
MAP
>
template
<
typename
MAP
>
class
TraversorV
:
public
TraversorCell
<
MAP
,
VERTEX
>
class
TraversorV
:
public
TraversorCell
<
MAP
,
VERTEX
>
{
{
...
...
include/Topology/generic/traversorCell.hpp
View file @
db57adec
...
@@ -155,4 +155,140 @@ void TraversorCell<MAP, ORBIT>::skip(Dart d)
...
@@ -155,4 +155,140 @@ void TraversorCell<MAP, ORBIT>::skip(Dart d)
cmark
->
mark
(
d
)
;
cmark
->
mark
(
d
)
;
}
}
//special version (partial specialization) for Genric Map
template
<
unsigned
int
ORBIT
>
TraversorCell
<
GenericMap
,
ORBIT
>::
TraversorCell
(
GenericMap
&
map
,
const
FunctorSelect
&
good
,
bool
forceDartMarker
,
unsigned
int
thread
)
:
m
(
map
),
dmark
(
NULL
),
cmark
(
NULL
),
quickTraversal
(
NULL
),
current
(
NIL
),
firstTraversal
(
true
),
m_good
(
good
)
{
if
(
forceDartMarker
)
dmark
=
new
DartMarker
(
map
,
thread
)
;
else
{
quickTraversal
=
map
.
template
getQuickTraversal
<
ORBIT
>()
;
if
(
quickTraversal
!=
NULL
)
{
cont
=
&
(
m
.
template
getAttributeContainer
<
ORBIT
>())
;
}
else
{
if
(
map
.
template
isOrbitEmbedded
<
ORBIT
>())
cmark
=
new
CellMarker
<
ORBIT
>
(
map
,
thread
)
;
else
dmark
=
new
DartMarker
(
map
,
thread
)
;
}
}
}
template
<
unsigned
int
ORBIT
>
TraversorCell
<
GenericMap
,
ORBIT
>::~
TraversorCell
()
{
if
(
dmark
)
delete
dmark
;
else
if
(
cmark
)
delete
cmark
;
}
template
<
unsigned
int
ORBIT
>
Dart
TraversorCell
<
GenericMap
,
ORBIT
>::
begin
()
{
if
(
quickTraversal
!=
NULL
)
{
qCurrent
=
cont
->
begin
()
;
current
=
(
*
quickTraversal
)[
qCurrent
]
;
}
else
{
if
(
!
firstTraversal
)
{
if
(
dmark
)
dmark
->
unmarkAll
()
;
else
cmark
->
unmarkAll
()
;
}
current
=
m
.
begin
()
;
while
(
current
!=
m
.
end
()
&&
(
m
.
isBoundaryMarkedCurrent
(
current
)
||
!
m_good
(
current
)))
m
.
next
(
current
)
;
if
(
current
==
m
.
end
())
current
=
NIL
;
else
{
if
(
dmark
)
dmark
->
markOrbit
<
ORBIT
>
(
current
)
;
else
cmark
->
mark
(
current
)
;
}
firstTraversal
=
false
;
}
return
current
;
}
template
<
unsigned
int
ORBIT
>
Dart
TraversorCell
<
GenericMap
,
ORBIT
>::
end
()
{
return
NIL
;
}
template
<
unsigned
int
ORBIT
>
Dart
TraversorCell
<
GenericMap
,
ORBIT
>::
next
()
{
if
(
current
!=
NIL
)
{
if
(
quickTraversal
!=
NULL
)
{
cont
->
next
(
qCurrent
)
;
current
=
(
*
quickTraversal
)[
qCurrent
]
;
}
else
{
if
(
dmark
)
{
bool
ismarked
=
dmark
->
isMarked
(
current
)
;
while
(
current
!=
NIL
&&
(
ismarked
||
m
.
isBoundaryMarkedCurrent
(
current
)
||
!
m_good
(
current
)))
{
m
.
next
(
current
)
;
if
(
current
==
m
.
end
())
current
=
NIL
;
else
ismarked
=
dmark
->
isMarked
(
current
)
;
}
if
(
current
!=
NIL
)
dmark
->
markOrbit
<
ORBIT
>
(
current
)
;
}
else
{
bool
ismarked
=
cmark
->
isMarked
(
current
)
;
while
(
current
!=
NIL
&&
(
ismarked
||
m
.
isBoundaryMarkedCurrent
(
current
)
||
!
m_good
(
current
)))
{
m
.
next
(
current
)
;
if
(
current
==
m
.
end
())
current
=
NIL
;
else
ismarked
=
cmark
->
isMarked
(
current
)
;
}
if
(
current
!=
NIL
)
cmark
->
mark
(
current
)
;
}
}
}
return
current
;
}
template
<
unsigned
int
ORBIT
>
void
TraversorCell
<
GenericMap
,
ORBIT
>::
skip
(
Dart
d
)
{
if
(
dmark
)
dmark
->
markOrbit
<
ORBIT
>
(
d
)
;
else
cmark
->
mark
(
d
)
;
}
}
// namespace CGoGN
}
// namespace CGoGN
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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