Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Hurstel
CGoGN
Commits
cc63ab5a
Commit
cc63ab5a
authored
May 02, 2014
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify foreach_dart_of_<orbit> functions profile
parent
e4ff0d46
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
1216 additions
and
427 deletions
+1216
-427
include/Algo/ImplicitHierarchicalMesh/ihm3.h
include/Algo/ImplicitHierarchicalMesh/ihm3.h
+10
-11
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
+47
-69
include/Topology/generic/genericmap.h
include/Topology/generic/genericmap.h
+11
-11
include/Topology/generic/genericmap.hpp
include/Topology/generic/genericmap.hpp
+11
-12
include/Topology/generic/mapCommon.h
include/Topology/generic/mapCommon.h
+6
-6
include/Topology/generic/mapCommon.hpp
include/Topology/generic/mapCommon.hpp
+23
-17
include/Topology/generic/traversor/traversorCell.h
include/Topology/generic/traversor/traversorCell.h
+6
-1
include/Topology/gmap/gmap0.h
include/Topology/gmap/gmap0.h
+2
-4
include/Topology/gmap/gmap0.hpp
include/Topology/gmap/gmap0.hpp
+6
-6
include/Topology/gmap/gmap1.h
include/Topology/gmap/gmap1.h
+4
-4
include/Topology/gmap/gmap1.hpp
include/Topology/gmap/gmap1.hpp
+13
-14
include/Topology/gmap/gmap2.h
include/Topology/gmap/gmap2.h
+10
-10
include/Topology/gmap/gmap2.hpp
include/Topology/gmap/gmap2.hpp
+39
-55
include/Topology/gmap/gmap3.h
include/Topology/gmap/gmap3.h
+11
-11
include/Topology/gmap/gmap3.hpp
include/Topology/gmap/gmap3.hpp
+35
-40
include/Topology/ihmap/ihm2.h
include/Topology/ihmap/ihm2.h
+7
-7
include/Topology/ihmap/ihm2.hpp
include/Topology/ihmap/ihm2.hpp
+26
-39
include/Topology/map/embeddedMap2_MR.h
include/Topology/map/embeddedMap2_MR.h
+163
-0
include/Topology/map/map1.h
include/Topology/map/map1.h
+3
-4
include/Topology/map/map1.hpp
include/Topology/map/map1.hpp
+6
-8
include/Topology/map/map2.h
include/Topology/map/map2.h
+8
-8
include/Topology/map/map2.hpp
include/Topology/map/map2.hpp
+31
-50
include/Topology/map/map3.h
include/Topology/map/map3.h
+8
-9
include/Topology/map/map3.hpp
include/Topology/map/map3.hpp
+26
-31
src/Topology/map/embeddedMap2_MR.cpp
src/Topology/map/embeddedMap2_MR.cpp
+704
-0
No files found.
include/Algo/ImplicitHierarchicalMesh/ihm3.h
View file @
cc63ab5a
...
...
@@ -379,24 +379,23 @@ public:
virtual
void
next
(
Dart
&
d
)
const
;
v
irtual
bool
foreach_dart_of_vertex
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
const
;
v
oid
foreach_dart_of_vertex
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
=
0
)
const
;
v
irtual
bool
foreach_dart_of_edge
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
const
;
v
oid
foreach_dart_of_edge
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
=
0
)
const
;
bool
foreach_dart_of_oriented_face
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
const
;
v
irtual
bool
foreach_dart_of_face
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
const
;
void
foreach_dart_of_oriented_face
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
=
0
)
const
;
v
oid
foreach_dart_of_face
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
=
0
)
const
;
bool
foreach_dart_of_oriented_volume
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
const
;
v
irtual
bool
foreach_dart_of_volume
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
const
;
void
foreach_dart_of_oriented_volume
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
=
0
)
const
;
v
oid
foreach_dart_of_volume
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
=
0
)
const
;
v
irtual
bool
foreach_dart_of_cc
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
const
;
v
oid
foreach_dart_of_cc
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
=
0
)
const
;
void
foreach_dart_of_vertex2
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
=
0
)
const
;
v
irtual
bool
foreach_dart_of_
vertex
2
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
const
;
v
oid
foreach_dart_of_
edge
2
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
=
0
)
const
;
virtual
bool
foreach_dart_of_edge2
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
const
;
virtual
bool
foreach_dart_of_face2
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
const
;
void
foreach_dart_of_face2
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
=
0
)
const
;
//@}
template
<
unsigned
int
ORBIT
>
...
...
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
View file @
cc63ab5a
...
...
@@ -224,17 +224,16 @@ inline void ImplicitHierarchicalMap3::next(Dart& d) const
}
while
(
d
!=
Map3
::
end
()
&&
m_dartLevel
[
d
]
>
m_curLevel
)
;
}
inline
bool
ImplicitHierarchicalMap3
::
foreach_dart_of_vertex
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
)
const
inline
void
ImplicitHierarchicalMap3
::
foreach_dart_of_vertex
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
)
const
{
DartMarkerStore
<
Map3
>
mv
(
*
this
,
thread
);
// Lock a marker
bool
found
=
false
;
// Last functor return value
std
::
vector
<
Dart
>
darts
;
// Darts that are traversed
darts
.
reserve
(
256
);
darts
.
push_back
(
d
);
// Start with the dart d
mv
.
mark
(
d
);
for
(
unsigned
int
i
=
0
;
!
found
&&
i
<
darts
.
size
();
++
i
)
for
(
unsigned
int
i
=
0
;
i
<
darts
.
size
();
++
i
)
{
// add phi21 and phi23 successor if they are not marked yet
Dart
d2
=
phi2
(
darts
[
i
]);
...
...
@@ -252,126 +251,110 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_vertex(Dart d, FunctorType
mv
.
mark
(
d23
);
}
found
=
f
(
darts
[
i
]);
f
(
darts
[
i
]);
}
return
found
;
}
inline
bool
ImplicitHierarchicalMap3
::
foreach_dart_of_edge
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
)
const
inline
void
ImplicitHierarchicalMap3
::
foreach_dart_of_edge
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
)
const
{
Dart
dNext
=
d
;
do
{
if
(
foreach_dart_of_edge2
(
dNext
,
f
,
thread
))
return
true
;
foreach_dart_of_edge2
(
dNext
,
f
,
thread
);
dNext
=
alpha2
(
dNext
);
}
while
(
dNext
!=
d
);
return
false
;
}
inline
bool
ImplicitHierarchicalMap3
::
foreach_dart_of_oriented_face
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
/*thread*/
)
const
inline
void
ImplicitHierarchicalMap3
::
foreach_dart_of_oriented_face
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
/*thread*/
)
const
{
Dart
dNext
=
d
;
do
{
if
(
f
(
dNext
))
return
true
;
f
(
dNext
);
dNext
=
phi1
(
dNext
)
;
}
while
(
dNext
!=
d
)
;
return
false
;
}
inline
bool
ImplicitHierarchicalMap3
::
foreach_dart_of_face
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
)
const
inline
void
ImplicitHierarchicalMap3
::
foreach_dart_of_face
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
)
const
{
return
foreach_dart_of_oriented_face
(
d
,
f
,
thread
)
||
foreach_dart_of_oriented_face
(
phi3
(
d
),
f
,
thread
);
foreach_dart_of_oriented_face
(
d
,
f
,
thread
);
foreach_dart_of_oriented_face
(
phi3
(
d
),
f
,
thread
);
}
inline
bool
ImplicitHierarchicalMap3
::
foreach_dart_of_oriented_volume
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
)
const
inline
void
ImplicitHierarchicalMap3
::
foreach_dart_of_oriented_volume
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
)
const
{
DartMarkerStore
<
Map3
>
mark
(
*
this
,
thread
);
// Lock a marker
bool
found
=
false
;
// Last functor return value
std
::
vector
<
Dart
>
visitedFaces
;
// Faces that are traversed
visitedFaces
.
reserve
(
1024
)
;
visitedFaces
.
push_back
(
d
);
// Start with the face of d
// For every face added to the list
for
(
unsigned
int
i
=
0
;
!
found
&&
i
<
visitedFaces
.
size
();
++
i
)
for
(
unsigned
int
i
=
0
;
i
<
visitedFaces
.
size
();
++
i
)
{
if
(
!
mark
.
isMarked
(
visitedFaces
[
i
]))
// Face has not been visited yet
{
// Apply functor to the darts of the face
found
=
foreach_dart_of_oriented_face
(
visitedFaces
[
i
],
f
);
foreach_dart_of_oriented_face
(
visitedFaces
[
i
],
f
);
//
If functor returns false then
mark visited darts (current face)
// mark visited darts (current face)
// and add non visited adjacent faces to the list of face
if
(
!
found
)
Dart
e
=
visitedFaces
[
i
]
;
do
{
Dart
e
=
visitedFaces
[
i
]
;
do
{
mark
.
mark
(
e
);
// Mark
Dart
adj
=
phi2
(
e
);
// Get adjacent face
if
(
!
mark
.
isMarked
(
adj
))
visitedFaces
.
push_back
(
adj
);
// Add it
e
=
phi1
(
e
);
}
while
(
e
!=
visitedFaces
[
i
]);
}
mark
.
mark
(
e
);
// Mark
Dart
adj
=
phi2
(
e
);
// Get adjacent face
if
(
!
mark
.
isMarked
(
adj
))
visitedFaces
.
push_back
(
adj
);
// Add it
e
=
phi1
(
e
);
}
while
(
e
!=
visitedFaces
[
i
]);
}
}
return
found
;
}
inline
bool
ImplicitHierarchicalMap3
::
foreach_dart_of_volume
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
)
const
inline
void
ImplicitHierarchicalMap3
::
foreach_dart_of_volume
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
)
const
{
return
foreach_dart_of_oriented_volume
(
d
,
f
,
thread
)
;
foreach_dart_of_oriented_volume
(
d
,
f
,
thread
)
;
}
inline
bool
ImplicitHierarchicalMap3
::
foreach_dart_of_cc
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
)
const
inline
void
ImplicitHierarchicalMap3
::
foreach_dart_of_cc
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
)
const
{
DartMarkerStore
<
Map3
>
mark
(
*
this
,
thread
);
// Lock a marker
bool
found
=
false
;
// Last functor return value
std
::
vector
<
Dart
>
visitedFaces
;
// Faces that are traversed
visitedFaces
.
reserve
(
1024
)
;
visitedFaces
.
push_back
(
d
);
// Start with the face of d
// For every face added to the list
for
(
unsigned
int
i
=
0
;
!
found
&&
i
<
visitedFaces
.
size
();
++
i
)
for
(
unsigned
int
i
=
0
;
i
<
visitedFaces
.
size
();
++
i
)
{
if
(
!
mark
.
isMarked
(
visitedFaces
[
i
]))
// Face has not been visited yet
{
// Apply functor to the darts of the face
found
=
foreach_dart_of_face
(
visitedFaces
[
i
],
f
);
foreach_dart_of_face
(
visitedFaces
[
i
],
f
);
//
If functor returns false then
mark visited darts (current face)
// mark visited darts (current face)
// and add non visited adjacent faces to the list of face
if
(
!
found
)
Dart
e
=
visitedFaces
[
i
]
;
do
{
Dart
e
=
visitedFaces
[
i
]
;
do
{
mark
.
mark
(
e
);
// Mark
Dart
adj
=
phi2
(
e
);
// Get adjacent face
if
(
!
mark
.
isMarked
(
adj
))
visitedFaces
.
push_back
(
adj
);
// Add it
e
=
phi1
(
e
);
}
while
(
e
!=
visitedFaces
[
i
]);
}
mark
.
mark
(
e
);
// Mark
Dart
adj
=
phi2
(
e
);
// Get adjacent face
if
(
!
mark
.
isMarked
(
adj
))
visitedFaces
.
push_back
(
adj
);
// Add it
e
=
phi1
(
e
);
}
while
(
e
!=
visitedFaces
[
i
]);
}
}
return
found
;
// //
return
foreach_dart_of_oriented_volume(d, f) ;
// // foreach_dart_of_oriented_volume(d, f) ;
// DartMarkerStore mv(*this,thread); // Lock a marker
// bool found = false; // Last functor return value
//
// std::vector<Dart> darts; // Darts that are traversed
// darts.reserve(1024);
// darts.push_back(d); // Start with the dart d
// mv.mark(d);
//
// for(unsigned int i = 0;
!found &&
i < darts.size(); ++i)
// for(unsigned int i = 0; i < darts.size(); ++i)
// {
// // add all successors if they are not marked yet
// Dart d2 = phi1(darts[i]); // turn in face
...
...
@@ -394,34 +377,29 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_cc(Dart d, FunctorType& f,
// mv.mark(d4);
// }
//
//
found =
f(darts[i]);
// f(darts[i]);
// }
// return found;
}
inline
bool
ImplicitHierarchicalMap3
::
foreach_dart_of_vertex2
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
/*thread*/
)
const
inline
void
ImplicitHierarchicalMap3
::
foreach_dart_of_vertex2
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
/*thread*/
)
const
{
Dart
dNext
=
d
;
do
{
if
(
f
(
dNext
))
return
true
;
f
(
dNext
);
dNext
=
phi2
(
phi_1
(
dNext
));
}
while
(
dNext
!=
d
);
return
false
;
}
while
(
dNext
!=
d
);
}
inline
bool
ImplicitHierarchicalMap3
::
foreach_dart_of_edge2
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
/*thread*/
)
const
inline
void
ImplicitHierarchicalMap3
::
foreach_dart_of_edge2
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
/*thread*/
)
const
{
if
(
f
(
d
))
return
true
;
return
f
(
phi2
(
d
));
f
(
d
);
f
(
phi2
(
d
));
}
inline
bool
ImplicitHierarchicalMap3
::
foreach_dart_of_face2
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
)
const
inline
void
ImplicitHierarchicalMap3
::
foreach_dart_of_face2
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
)
const
{
return
foreach_dart_of_oriented_face
(
d
,
f
,
thread
);
foreach_dart_of_oriented_face
(
d
,
f
,
thread
);
}
/***************************************************
...
...
include/Topology/generic/genericmap.h
View file @
cc63ab5a
...
...
@@ -174,20 +174,20 @@ public:
* @param f a functor obj
*/
template
<
unsigned
int
ORBIT
>
bool
foreach_dart_of_orbit
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
const
;
void
foreach_dart_of_orbit
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
=
0
)
const
;
virtual
bool
foreach_dart_of_vertex
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
const
=
0
;
virtual
bool
foreach_dart_of_edge
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
const
=
0
;
virtual
bool
foreach_dart_of_face
(
Dart
/*d*/
,
FunctorType
&
/*f*/
,
unsigned
int
/*thread = 0*/
)
const
{
std
::
cerr
<<
"Not implemented"
<<
std
::
endl
;
return
false
;
}
virtual
bool
foreach_dart_of_volume
(
Dart
/*d*/
,
FunctorType
&
/*f*/
,
unsigned
int
/*thread = 0*/
)
const
{
std
::
cerr
<<
"Not implemented"
<<
std
::
endl
;
return
false
;
}
virtual
bool
foreach_dart_of_cc
(
Dart
/*d*/
,
FunctorType
&
/*f*/
,
unsigned
int
/*thread = 0*/
)
const
{
std
::
cerr
<<
"Not implemented"
<<
std
::
endl
;
return
false
;
}
virtual
void
foreach_dart_of_vertex
(
Dart
/*d*/
,
std
::
function
<
void
(
Dart
)
>
/*f*/
,
unsigned
int
/*
thread = 0
*/
)
const
{
std
::
cerr
<<
"Not implemented"
<<
std
::
endl
;
}
virtual
void
foreach_dart_of_edge
(
Dart
/*d*/
,
std
::
function
<
void
(
Dart
)
>
/*f*/
,
unsigned
int
/*
thread = 0
*/
)
const
{
std
::
cerr
<<
"Not implemented"
<<
std
::
endl
;
}
virtual
void
foreach_dart_of_face
(
Dart
/*d*/
,
std
::
function
<
void
(
Dart
)
>
/*f*/
,
unsigned
int
/*thread = 0*/
)
const
{
std
::
cerr
<<
"Not implemented"
<<
std
::
endl
;
}
virtual
void
foreach_dart_of_volume
(
Dart
/*d*/
,
std
::
function
<
void
(
Dart
)
>
/*f*/
,
unsigned
int
/*thread = 0*/
)
const
{
std
::
cerr
<<
"Not implemented"
<<
std
::
endl
;
}
virtual
void
foreach_dart_of_cc
(
Dart
/*d*/
,
std
::
function
<
void
(
Dart
)
>
/*f*/
,
unsigned
int
/*thread = 0*/
)
const
{
std
::
cerr
<<
"Not implemented"
<<
std
::
endl
;
}
virtual
bool
foreach_dart_of_vertex1
(
Dart
/*d*/
,
FunctorType
&
/*f*/
,
unsigned
int
/*thread = 0*/
)
const
{
std
::
cerr
<<
"Not implemented"
<<
std
::
endl
;
return
false
;
}
virtual
bool
foreach_dart_of_edge1
(
Dart
/*d*/
,
FunctorType
&
/*f*/
,
unsigned
int
/*thread = 0*/
)
const
{
std
::
cerr
<<
"Not implemented"
<<
std
::
endl
;
return
false
;
}
virtual
void
foreach_dart_of_vertex1
(
Dart
/*d*/
,
std
::
function
<
void
(
Dart
)
>
/*f*/
,
unsigned
int
/*thread = 0*/
)
const
{
std
::
cerr
<<
"Not implemented"
<<
std
::
endl
;
}
virtual
void
foreach_dart_of_edge1
(
Dart
/*d*/
,
std
::
function
<
void
(
Dart
)
>
/*f*/
,
unsigned
int
/*thread = 0*/
)
const
{
std
::
cerr
<<
"Not implemented"
<<
std
::
endl
;
}
virtual
bool
foreach_dart_of_vertex2
(
Dart
/*d*/
,
FunctorType
&
/*f*/
,
unsigned
int
/*thread = 0*/
)
const
{
std
::
cerr
<<
"Not implemented"
<<
std
::
endl
;
return
false
;
}
virtual
bool
foreach_dart_of_edge2
(
Dart
/*d*/
,
FunctorType
&
/*f*/
,
unsigned
int
/*thread = 0*/
)
const
{
std
::
cerr
<<
"Not implemented"
<<
std
::
endl
;
return
false
;
}
virtual
bool
foreach_dart_of_face2
(
Dart
/*d*/
,
FunctorType
&
/*f*/
,
unsigned
int
/*thread = 0*/
)
const
{
std
::
cerr
<<
"Not implemented"
<<
std
::
endl
;
return
false
;
}
virtual
void
foreach_dart_of_vertex2
(
Dart
/*d*/
,
std
::
function
<
void
(
Dart
)
>
/*f*/
,
unsigned
int
/*thread = 0*/
)
const
{
std
::
cerr
<<
"Not implemented"
<<
std
::
endl
;
}
virtual
void
foreach_dart_of_edge2
(
Dart
/*d*/
,
std
::
function
<
void
(
Dart
)
>
/*f*/
,
unsigned
int
/*thread = 0*/
)
const
{
std
::
cerr
<<
"Not implemented"
<<
std
::
endl
;
}
virtual
void
foreach_dart_of_face2
(
Dart
/*d*/
,
std
::
function
<
void
(
Dart
)
>
/*f*/
,
unsigned
int
/*thread = 0*/
)
const
{
std
::
cerr
<<
"Not implemented"
<<
std
::
endl
;
}
/****************************************
* EMBEDDING MANAGEMENT *
...
...
include/Topology/generic/genericmap.hpp
View file @
cc63ab5a
...
...
@@ -218,23 +218,22 @@ void GenericMap::addEmbedding()
****************************************/
template
<
unsigned
int
ORBIT
>
bool
GenericMap
::
foreach_dart_of_orbit
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
)
const
void
GenericMap
::
foreach_dart_of_orbit
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
)
const
{
switch
(
ORBIT
)
{
case
DART
:
return
f
(
d
)
;
case
VERTEX
:
return
foreach_dart_of_vertex
(
d
,
f
,
thread
);
case
EDGE
:
return
foreach_dart_of_edge
(
d
,
f
,
thread
);
case
FACE
:
return
foreach_dart_of_face
(
d
,
f
,
thread
);
case
VOLUME
:
return
foreach_dart_of_volume
(
d
,
f
,
thread
);
case
VERTEX1
:
return
foreach_dart_of_vertex1
(
d
,
f
,
thread
);
case
EDGE1
:
return
foreach_dart_of_edge1
(
d
,
f
,
thread
);
case
VERTEX2
:
return
foreach_dart_of_vertex2
(
d
,
f
,
thread
);
case
EDGE2
:
return
foreach_dart_of_edge2
(
d
,
f
,
thread
);
case
FACE2
:
return
foreach_dart_of_face2
(
d
,
f
,
thread
);
case
DART
:
f
(
d
);
break
;
case
VERTEX
:
foreach_dart_of_vertex
(
d
,
f
,
thread
);
break
;
case
EDGE
:
foreach_dart_of_edge
(
d
,
f
,
thread
);
break
;
case
FACE
:
foreach_dart_of_face
(
d
,
f
,
thread
);
break
;
case
VOLUME
:
foreach_dart_of_volume
(
d
,
f
,
thread
);
break
;
case
VERTEX1
:
foreach_dart_of_vertex1
(
d
,
f
,
thread
);
break
;
case
EDGE1
:
foreach_dart_of_edge1
(
d
,
f
,
thread
);
break
;
case
VERTEX2
:
foreach_dart_of_vertex2
(
d
,
f
,
thread
);
break
;
case
EDGE2
:
foreach_dart_of_edge2
(
d
,
f
,
thread
);
break
;
case
FACE2
:
foreach_dart_of_face2
(
d
,
f
,
thread
);
break
;
default:
assert
(
!
"Cells of this dimension are not handled"
);
break
;
}
return
false
;
}
/****************************************
...
...
include/Topology/generic/mapCommon.h
View file @
cc63ab5a
...
...
@@ -141,16 +141,16 @@ protected:
void
boundaryUnmark
(
Dart
d
)
;
/**
* mark an orbit
of dart
as belonging to boundary
* mark an orbit as belonging to boundary
*/
template
<
unsigned
int
ORBIT
,
unsigned
int
DIM
>
void
boundaryMarkOrbit
(
Dart
d
)
;
template
<
unsigned
int
DIM
,
unsigned
int
ORBIT
>
void
boundaryMarkOrbit
(
Cell
<
ORBIT
>
c
)
;
/**
* unmark an orbit
of dart
from the boundary
* unmark an orbit from the boundary
*/
template
<
unsigned
int
ORBIT
,
unsigned
int
DIM
>
void
boundaryUnmarkOrbit
(
Dart
d
)
;
template
<
unsigned
int
DIM
,
unsigned
int
ORBIT
>
void
boundaryUnmarkOrbit
(
Cell
<
ORBIT
>
c
)
;
/**
* clear all boundary markers
...
...
include/Topology/generic/mapCommon.hpp
View file @
cc63ab5a
...
...
@@ -41,21 +41,19 @@ unsigned int MapCommon<MAP_IMPL>::degree(Dart d) const
return
fcount
.
getNb
()
;
}
template
<
typename
MAP_IMPL
>
template
<
unsigned
int
ORBIT
>
bool
MapCommon
<
MAP_IMPL
>::
sameOrbit
(
Cell
<
ORBIT
>
c1
,
Cell
<
ORBIT
>
c2
,
unsigned
int
thread
)
const
{
TraversorDartsOfOrbit
<
MapCommon
<
MAP_IMPL
>
,
ORBIT
>
tradoo
(
*
this
,
c1
.
dart
,
thread
);
for
(
Dart
x
=
tradoo
.
begin
();
x
!=
tradoo
.
end
();
x
=
tradoo
.
next
())
TraversorDartsOfOrbit
<
MapCommon
<
MAP_IMPL
>
,
ORBIT
>
tradoo
(
*
this
,
c1
.
dart
,
thread
);
for
(
Dart
x
=
tradoo
.
begin
();
x
!=
tradoo
.
end
();
x
=
tradoo
.
next
())
{
if
(
x
==
c2
.
dart
)
if
(
x
==
c2
.
dart
)
return
true
;
}
return
false
;
}
/****************************************
* EMBEDDING MANAGEMENT *
****************************************/
...
...
@@ -125,8 +123,10 @@ inline void MapCommon<MAP_IMPL>::setOrbitEmbedding(Cell<ORBIT> c, unsigned int e
{
assert
(
this
->
template
isOrbitEmbedded
<
ORBIT
>()
||
!
"Invalid parameter: orbit not embedded"
);
FunctorSetEmb
<
MapCommon
<
MAP_IMPL
>
,
ORBIT
>
fsetemb
(
*
this
,
em
);
this
->
template
foreach_dart_of_orbit
<
ORBIT
>(
c
.
dart
,
fsetemb
);
this
->
template
foreach_dart_of_orbit
<
ORBIT
>(
c
.
dart
,
[
&
]
(
Dart
d
)
{
this
->
setDartEmbedding
<
ORBIT
>
(
d
,
em
);
});
}
template
<
typename
MAP_IMPL
>
...
...
@@ -135,8 +135,10 @@ inline void MapCommon<MAP_IMPL>::initOrbitEmbedding(Cell<ORBIT> c, unsigned int
{
assert
(
this
->
template
isOrbitEmbedded
<
ORBIT
>()
||
!
"Invalid parameter: orbit not embedded"
);
FunctorInitEmb
<
MapCommon
<
MAP_IMPL
>
,
ORBIT
>
finitemb
(
*
this
,
em
);
this
->
template
foreach_dart_of_orbit
<
ORBIT
>(
c
.
dart
,
finitemb
);
this
->
template
foreach_dart_of_orbit
<
ORBIT
>(
c
.
dart
,
[
&
]
(
Dart
d
)
{
this
->
initDartEmbedding
<
ORBIT
>
(
d
,
em
);
});
}
template
<
typename
MAP_IMPL
>
...
...
@@ -195,19 +197,23 @@ inline void MapCommon<MAP_IMPL>::boundaryUnmark(Dart d)
}
template
<
typename
MAP_IMPL
>
template
<
unsigned
int
ORBIT
,
unsigned
int
DIM
>
void
MapCommon
<
MAP_IMPL
>::
boundaryMarkOrbit
(
Dart
d
)
template
<
unsigned
int
DIM
,
unsigned
int
ORBIT
>
void
MapCommon
<
MAP_IMPL
>::
boundaryMarkOrbit
(
Cell
<
ORBIT
>
c
)
{
FunctorMark
<
MAP_IMPL
>
fm
(
*
this
,
this
->
m_boundaryMarkers
[
DIM
-
2
],
this
->
m_markTables
[
DART
][
0
])
;
this
->
template
foreach_dart_of_orbit
<
ORBIT
>(
d
,
fm
,
0
)
;
this
->
template
foreach_dart_of_orbit
<
ORBIT
>(
c
.
dart
,
[
&
]
(
Dart
d
)
{
this
->
boundaryMark
<
DIM
>
(
d
);
});
}
template
<
typename
MAP_IMPL
>
template
<
unsigned
int
ORBIT
,
unsigned
int
DIM
>
void
MapCommon
<
MAP_IMPL
>::
boundaryUnmarkOrbit
(
Dart
d
)
template
<
unsigned
int
DIM
,
unsigned
int
ORBIT
>
void
MapCommon
<
MAP_IMPL
>::
boundaryUnmarkOrbit
(
Cell
<
ORBIT
>
c
)
{
FunctorUnmark
<
MAP_IMPL
>
fm
(
*
this
,
this
->
m_boundaryMarkers
[
DIM
-
2
],
this
->
m_markTables
[
DART
][
0
])
;
this
->
template
foreach_dart_of_orbit
<
ORBIT
>(
d
,
fm
,
0
)
;
this
->
template
foreach_dart_of_orbit
<
ORBIT
>(
c
.
dart
,
[
&
]
(
Dart
d
)
{
this
->
boundaryUnmark
<
DIM
>
(
d
);
});
}
template
<
typename
MAP_IMPL
>
...
...
include/Topology/generic/traversor/traversorCell.h
View file @
cc63ab5a
...
...
@@ -69,6 +69,9 @@ public:
/*
* Executes function f on each ORBIT
*/
template
<
unsigned
int
ORBIT
,
typename
MAP
,
typename
FUNC
>
inline
void
foreach_cell
(
const
MAP
&
map
,
FUNC
f
,
bool
forceDartMarker
=
false
,
unsigned
int
thread
=
0
)
{
...
...
@@ -77,7 +80,9 @@ inline void foreach_cell(const MAP& map, FUNC f, bool forceDartMarker = false, u
f
(
c
);
}
/*
* Executes function f on each ORBIT until f returns false
*/
template
<
unsigned
int
ORBIT
,
typename
MAP
,
typename
FUNC
>
inline
void
foreach_cell_until
(
const
MAP
&
map
,
FUNC
f
,
bool
forceDartMarker
=
false
,
unsigned
int
thread
=
0
)
{
...
...
include/Topology/gmap/gmap0.h
View file @
cc63ab5a
...
...
@@ -95,15 +95,13 @@ public:
/*! @param d a dart of the vertex
* @param f the functor to apply
*/
bool
foreach_dart_of_vertex
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
const
;
void
foreach_dart_of_vertex
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
=
0
)
const
;
//! Apply a functor on every dart of an edge
/*! @param d a dart of the edge
* @param f the functor to apply
*/
bool
foreach_dart_of_edge
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
const
;
// bool foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread = 0);
void
foreach_dart_of_edge
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
=
0
)
const
;
//@}
};
...
...
include/Topology/gmap/gmap0.hpp
View file @
cc63ab5a
...
...
@@ -118,18 +118,18 @@ void GMap0<MAP_IMPL>::deleteEdge(Dart d)
*************************************************************************/
template
<
typename
MAP_IMPL
>
inline
bool
GMap0
<
MAP_IMPL
>::
foreach_dart_of_vertex
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
/*thread*/
)
const
inline
void
GMap0
<
MAP_IMPL
>::
foreach_dart_of_vertex
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
/*thread*/
)
const
{
return
f
(
d
)
;
f
(
d
)
;
}
template
<
typename
MAP_IMPL
>
inline
bool
GMap0
<
MAP_IMPL
>::
foreach_dart_of_edge
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
/*thread*/
)
const
inline
void
GMap0
<
MAP_IMPL
>::
foreach_dart_of_edge
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
/*thread*/
)
const
{
if
(
f
(
d
))
return
true
;
f
(
d
)
;
Dart
d1
=
beta0
(
d
);
if
(
d1
!=
d
)
return
f
(
d1
);
return
false
;
if
(
d1
!=
d
)
f
(
d1
)
;
}
}
// namespace CGoGN
include/Topology/gmap/gmap1.h
View file @
cc63ab5a
...
...
@@ -193,27 +193,27 @@ public:
* @param d a dart of the vertex
* @param fonct functor obj ref
*/
bool
foreach_dart_of_vertex
(
Dart
d
,
FunctorType
&
fonct
,
unsigned
int
thread
=
0
)
const
;
void
foreach_dart_of_vertex
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
=
0
)
const
;
/**
* Apply a functor on each dart of an edge
* @param d a dart of the edge
* @param fonct functor obj ref
*/
bool
foreach_dart_of_edge
(
Dart
d
,
FunctorType
&
fonct
,
unsigned
int
thread
=
0
)
const
;
void
foreach_dart_of_edge
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
=
0
)
const
;
/**
* Apply a functor on each dart of an oriented cc (face)
* @param d a dart of the oriented cc
* @param fonct functor obj ref
*/
bool
foreach_dart_of_oriented_cc
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
const
;
void
foreach_dart_of_oriented_cc
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
=
0
)
const
;
//! Apply a functor on every dart of a cc (face)
/*! @param d a dart of the cc
* @param f the functor to apply
*/
bool
foreach_dart_of_cc
(
Dart
d
,
FunctorType
&
fonct
,
unsigned
int
thread
=
0
)
const
;
void
foreach_dart_of_cc
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
thread
=
0
)
const
;
//@}
};
...
...
include/Topology/gmap/gmap1.hpp
View file @
cc63ab5a
...
...
@@ -362,40 +362,39 @@ inline bool GMap1<MAP_IMPL>::isCycleTriangle(Dart d) const
*************************************************************************/
template
<
typename
MAP_IMPL
>
inline
bool
GMap1
<
MAP_IMPL
>::
foreach_dart_of_vertex
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
/*thread*/
)
const
inline
void
GMap1
<
MAP_IMPL
>::
foreach_dart_of_vertex
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>
f
,
unsigned
int
/*thread*/
)
const
{
if
(
f
(
d
))
return
true
;
f
(
d
)
;
Dart
d1
=
beta1
(
d
);
if
(
d1
!=
d
)
return
f
(
d1
);
return
false
;
if
(
d1
!=
d
)
f
(
d1
)
;
}
template
<
typename
MAP_IMPL
>
inline
bool
GMap1
<
MAP_IMPL
>::
foreach_dart_of_edge
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
/*thread*/
)
const