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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Etienne Schmitt
CGoGN
Commits
fa5e0982
Commit
fa5e0982
authored
May 05, 2014
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change foreach_dart_of_xxx functions to std::function
parent
01ce9ff4
Changes
41
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
369 additions
and
735 deletions
+369
-735
Apps/Examples/volumeExplorer.cpp
Apps/Examples/volumeExplorer.cpp
+6
-0
Apps/Tuto/Traversals/show_traversors2.cpp
Apps/Tuto/Traversals/show_traversors2.cpp
+2
-4
Apps/Tuto/Traversals/show_traversors2.h
Apps/Tuto/Traversals/show_traversors2.h
+1
-1
Apps/Tuto/Traversals/show_traversors3.cpp
Apps/Tuto/Traversals/show_traversors3.cpp
+2
-4
Apps/Tuto/Traversals/show_traversors3.h
Apps/Tuto/Traversals/show_traversors3.h
+1
-1
include/Algo/Geometry/volume.h
include/Algo/Geometry/volume.h
+3
-3
include/Algo/Geometry/volume.hpp
include/Algo/Geometry/volume.hpp
+39
-37
include/Algo/ImplicitHierarchicalMesh/ihm3.h
include/Algo/ImplicitHierarchicalMesh/ihm3.h
+1
-1
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
+5
-5
include/Algo/Modelisation/tetrahedralization.hpp
include/Algo/Modelisation/tetrahedralization.hpp
+3
-3
include/Algo/Multiresolution/filter.h
include/Algo/Multiresolution/filter.h
+5
-7
include/Algo/Selection/raySelectFunctor.hpp
include/Algo/Selection/raySelectFunctor.hpp
+19
-193
include/Algo/Selection/raySelector.h
include/Algo/Selection/raySelector.h
+0
-1
include/Topology/generic/cellmarker.h
include/Topology/generic/cellmarker.h
+28
-20
include/Topology/generic/dartmarker.h
include/Topology/generic/dartmarker.h
+38
-26
include/Topology/generic/functor.h
include/Topology/generic/functor.h
+5
-213
include/Topology/generic/genericmap.h
include/Topology/generic/genericmap.h
+18
-15
include/Topology/generic/genericmap.hpp
include/Topology/generic/genericmap.hpp
+30
-11
include/Topology/generic/mapCommon.hpp
include/Topology/generic/mapCommon.hpp
+8
-20
include/Topology/generic/traversor/traversor3.h
include/Topology/generic/traversor/traversor3.h
+10
-6
include/Topology/generic/traversor/traversor3.hpp
include/Topology/generic/traversor/traversor3.hpp
+29
-28
include/Topology/generic/traversor/traversor3Virt.h
include/Topology/generic/traversor/traversor3Virt.h
+2
-0
include/Topology/generic/traversor/traversorDoO.h
include/Topology/generic/traversor/traversorDoO.h
+2
-6
include/Topology/generic/traversor/traversorDoO.hpp
include/Topology/generic/traversor/traversorDoO.hpp
+4
-8
include/Topology/generic/traversor/traversorGen.h
include/Topology/generic/traversor/traversorGen.h
+2
-11
include/Topology/gmap/gmap0.h
include/Topology/gmap/gmap0.h
+2
-2
include/Topology/gmap/gmap0.hpp
include/Topology/gmap/gmap0.hpp
+2
-2
include/Topology/gmap/gmap1.h
include/Topology/gmap/gmap1.h
+4
-4
include/Topology/gmap/gmap1.hpp
include/Topology/gmap/gmap1.hpp
+4
-4
include/Topology/gmap/gmap2.h
include/Topology/gmap/gmap2.h
+10
-10
include/Topology/gmap/gmap2.hpp
include/Topology/gmap/gmap2.hpp
+10
-10
include/Topology/gmap/gmap3.h
include/Topology/gmap/gmap3.h
+11
-11
include/Topology/gmap/gmap3.hpp
include/Topology/gmap/gmap3.hpp
+12
-17
include/Topology/ihmap/ihm2.h
include/Topology/ihmap/ihm2.h
+7
-7
include/Topology/ihmap/ihm2.hpp
include/Topology/ihmap/ihm2.hpp
+7
-7
include/Topology/map/map1.h
include/Topology/map/map1.h
+3
-3
include/Topology/map/map1.hpp
include/Topology/map/map1.hpp
+3
-3
include/Topology/map/map2.h
include/Topology/map/map2.h
+7
-7
include/Topology/map/map2.hpp
include/Topology/map/map2.hpp
+7
-7
include/Topology/map/map3.h
include/Topology/map/map3.h
+8
-8
include/Topology/map/map3.hpp
include/Topology/map/map3.hpp
+9
-9
No files found.
Apps/Examples/volumeExplorer.cpp
View file @
fa5e0982
...
...
@@ -505,8 +505,14 @@ int main(int argc, char **argv)
std
::
cout
<<
"Compute Volume ->"
<<
std
::
endl
;
ch
.
start
();
float
vol
=
Algo
::
Geometry
::
totalVolume
<
PFP
>
(
myMap
,
position
);
std
::
cout
<<
ch
.
elapsed
()
<<
" ms val="
<<
vol
<<
std
::
endl
;
ch
.
start
();
vol
+=
Algo
::
Geometry
::
totalVolume
<
PFP
>
(
myMap
,
position
);
std
::
cout
<<
ch
.
elapsed
()
<<
" ms val="
<<
vol
<<
std
::
endl
;
ch
.
start
();
vol
+=
Algo
::
Geometry
::
totalVolume
<
PFP
>
(
myMap
,
position
);
std
::
cout
<<
ch
.
elapsed
()
<<
" ms val="
<<
vol
<<
std
::
endl
;
ch
.
start
();
vol
+=
Algo
::
Geometry
::
totalVolume
<
PFP
>
(
myMap
,
position
);
std
::
cout
<<
ch
.
elapsed
()
<<
" ms val="
<<
vol
<<
std
::
endl
;
...
...
Apps/Tuto/Traversals/show_traversors2.cpp
View file @
fa5e0982
...
...
@@ -139,11 +139,9 @@ void MyQT::cb_Save()
}
template
<
unsigned
int
ORBIT
>
void
MyQT
::
colorizeCell
(
Dart
d
,
float
r
,
float
g
,
float
b
)
void
MyQT
::
colorizeCell
(
Cell
<
ORBIT
>
c
,
float
r
,
float
g
,
float
b
)
{
TraversorDartsOfOrbit
<
PFP
::
MAP
,
ORBIT
>
doo
(
myMap
,
d
);
for
(
Dart
e
=
doo
.
begin
();
e
!=
doo
.
end
();
e
=
doo
.
next
())
m_render_topo
->
setDartColor
(
e
,
r
,
g
,
b
);
myMap
.
foreach_dart_of_orbit
(
c
,
[
&
]
(
Dart
d
)
{
m_render_topo
->
setDartColor
(
d
,
r
,
g
,
b
);
});
}
void
MyQT
::
traverse2
()
...
...
Apps/Tuto/Traversals/show_traversors2.h
View file @
fa5e0982
...
...
@@ -117,7 +117,7 @@ protected:
void
cb_mousePress
(
int
button
,
int
x
,
int
y
);
template
<
unsigned
int
ORBIT
>
void
colorizeCell
(
Dart
d
,
float
r
,
float
g
,
float
b
);
void
colorizeCell
(
Cell
<
ORBIT
>
c
,
float
r
,
float
g
,
float
b
);
void
traverse2
();
void
dynamicMarkOrbit
(
unsigned
int
orb
);
...
...
Apps/Tuto/Traversals/show_traversors3.cpp
View file @
fa5e0982
...
...
@@ -189,11 +189,9 @@ void MyQT::cb_Save()
}
template
<
unsigned
int
ORBIT
>
void
MyQT
::
colorizeCell
(
Dart
d
,
float
r
,
float
g
,
float
b
)
void
MyQT
::
colorizeCell
(
Cell
<
ORBIT
>
c
,
float
r
,
float
g
,
float
b
)
{
TraversorDartsOfOrbit
<
PFP
::
MAP
,
ORBIT
>
doo
(
myMap
,
d
);
for
(
Dart
e
=
doo
.
begin
();
e
!=
doo
.
end
();
e
=
doo
.
next
())
m_render_topo
->
setDartColor
(
e
,
r
,
g
,
b
);
myMap
.
foreach_dart_of_orbit
(
c
,
[
&
]
(
Dart
d
)
{
m_render_topo
->
setDartColor
(
d
,
r
,
g
,
b
);
});
}
void
MyQT
::
traverse2
()
...
...
Apps/Tuto/Traversals/show_traversors3.h
View file @
fa5e0982
...
...
@@ -115,7 +115,7 @@ protected:
void
cb_mousePress
(
int
button
,
int
x
,
int
y
);
template
<
unsigned
int
ORBIT
>
void
colorizeCell
(
Dart
d
,
float
r
,
float
g
,
float
b
);
void
colorizeCell
(
Cell
<
ORBIT
>
c
,
float
r
,
float
g
,
float
b
);
void
traverse2
();
void
traverse3
();
...
...
include/Algo/Geometry/volume.h
View file @
fa5e0982
...
...
@@ -37,13 +37,13 @@ namespace Geometry
{
template
<
typename
PFP
>
typename
PFP
::
REAL
tetrahedronSignedVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
)
;
typename
PFP
::
REAL
tetrahedronSignedVolume
(
typename
PFP
::
MAP
&
map
,
Vol
v
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
)
;
template
<
typename
PFP
>
typename
PFP
::
REAL
tetrahedronVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
)
;
typename
PFP
::
REAL
tetrahedronVolume
(
typename
PFP
::
MAP
&
map
,
Vol
v
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
)
;
template
<
typename
PFP
>
typename
PFP
::
REAL
convexPolyhedronVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
unsigned
int
thread
=
0
)
;
typename
PFP
::
REAL
convexPolyhedronVolume
(
typename
PFP
::
MAP
&
map
,
Vol
v
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
unsigned
int
thread
=
0
)
;
template
<
typename
PFP
>
typename
PFP
::
REAL
totalVolume
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
unsigned
int
thread
=
0
)
;
...
...
include/Algo/Geometry/volume.hpp
View file @
fa5e0982
...
...
@@ -36,85 +36,87 @@ namespace Geometry
{
template
<
typename
PFP
>
typename
PFP
::
REAL
tetrahedronSignedVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
)
typename
PFP
::
REAL
tetrahedronSignedVolume
(
typename
PFP
::
MAP
&
map
,
Vol
v
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
)
{
typedef
typename
PFP
::
VEC3
VEC3
;
VEC3
p1
=
position
[
d
]
;
VEC3
p2
=
position
[
map
.
phi1
(
d
)]
;
VEC3
p3
=
position
[
map
.
phi_1
(
d
)]
;
VEC3
p4
=
position
[
map
.
phi_1
(
map
.
phi2
(
d
))]
;
VEC3
p1
=
position
[
v
.
dart
]
;
VEC3
p2
=
position
[
map
.
phi1
(
v
)]
;
VEC3
p3
=
position
[
map
.
phi_1
(
v
)]
;
VEC3
p4
=
position
[
map
.
phi_1
(
map
.
phi2
(
v
))]
;
return
Geom
::
tetraSignedVolume
(
p1
,
p2
,
p3
,
p4
)
;
}
template
<
typename
PFP
>
typename
PFP
::
REAL
tetrahedronVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
)
typename
PFP
::
REAL
tetrahedronVolume
(
typename
PFP
::
MAP
&
map
,
Vol
v
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
)
{
typedef
typename
PFP
::
VEC3
VEC3
;
VEC3
p1
=
position
[
d
]
;
VEC3
p2
=
position
[
map
.
phi1
(
d
)]
;
VEC3
p3
=
position
[
map
.
phi_1
(
d
)]
;
VEC3
p4
=
position
[
map
.
phi_1
(
map
.
phi2
(
d
))]
;
VEC3
p1
=
position
[
v
.
dart
]
;
VEC3
p2
=
position
[
map
.
phi1
(
v
)]
;
VEC3
p3
=
position
[
map
.
phi_1
(
v
)]
;
VEC3
p4
=
position
[
map
.
phi_1
(
map
.
phi2
(
v
))]
;
return
Geom
::
tetraVolume
(
p1
,
p2
,
p3
,
p4
)
;
}
template
<
typename
PFP
>
typename
PFP
::
REAL
convexPolyhedronVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
unsigned
int
thread
)
typename
PFP
::
REAL
convexPolyhedronVolume
(
typename
PFP
::
MAP
&
map
,
Vol
v
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
unsigned
int
thread
)
{
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
VEC3
VEC3
;
if
(
Volume
::
Modelisation
::
Tetrahedralization
::
isTetrahedron
<
PFP
>
(
map
,
d
,
thread
))
return
tetrahedronVolume
<
PFP
>
(
map
,
d
,
position
)
;
if
(
Volume
::
Modelisation
::
Tetrahedralization
::
isTetrahedron
<
PFP
>
(
map
,
v
,
thread
))
return
tetrahedronVolume
<
PFP
>
(
map
,
v
,
position
)
;
else
{
typename
PFP
::
REAL
vol
=
0
;
VEC3
vCentroid
=
Algo
::
Surface
::
Geometry
::
volumeCentroid
<
PFP
>
(
map
,
d
,
position
,
thread
)
;
VEC3
vCentroid
=
Algo
::
Surface
::
Geometry
::
volumeCentroid
<
PFP
>
(
map
,
v
,
position
,
thread
)
;
DartMarkerStore
<
MAP
>
mark
(
map
,
thread
);
// Lock a marker
DartMarkerStore
<
MAP
>
mark
(
map
,
thread
)
;
// Lock a marker
std
::
vector
<
Dart
>
visitedFaces
;
std
::
vector
<
Face
>
visitedFaces
;
visitedFaces
.
reserve
(
100
)
;
visitedFaces
.
push_back
(
d
)
;
mark
.
template
markOrbit
<
FACE
>(
d
)
;
Face
f
(
v
.
dart
)
;
visitedFaces
.
push_back
(
f
)
;
mark
.
markOrbit
(
f
)
;
for
(
unsigned
int
iface
=
0
;
iface
!=
visitedFaces
.
size
();
++
iface
)
for
(
unsigned
int
iface
=
0
;
iface
!=
visitedFaces
.
size
();
++
iface
)
{
Dart
e
=
visitedFaces
[
iface
]
;
if
(
map
.
isCycleTriangle
(
e
))
f
=
visitedFaces
[
iface
]
;
if
(
map
.
isCycleTriangle
(
f
))
{
VEC3
p1
=
position
[
e
]
;
VEC3
p2
=
position
[
map
.
phi1
(
e
)]
;
VEC3
p3
=
position
[
map
.
phi_1
(
e
)]
;
VEC3
p1
=
position
[
f
.
dart
]
;
VEC3
p2
=
position
[
map
.
phi1
(
f
)]
;
VEC3
p3
=
position
[
map
.
phi_1
(
f
)]
;
vol
+=
Geom
::
tetraVolume
(
p1
,
p2
,
p3
,
vCentroid
)
;
}
else
{
VEC3
fCentroid
=
Algo
::
Surface
::
Geometry
::
faceCentroid
<
PFP
>
(
map
,
e
,
position
)
;
Dart
f
=
e
;
VEC3
fCentroid
=
Algo
::
Surface
::
Geometry
::
faceCentroid
<
PFP
>
(
map
,
f
,
position
)
;
Dart
d
=
f
.
dart
;
do
{
VEC3
p1
=
position
[
f
]
;
VEC3
p2
=
position
[
map
.
phi1
(
f
)]
;
VEC3
p1
=
position
[
d
]
;
VEC3
p2
=
position
[
map
.
phi1
(
d
)]
;
vol
+=
Geom
::
tetraVolume
(
p1
,
p2
,
fCentroid
,
vCentroid
)
;
f
=
map
.
phi1
(
f
)
;
}
while
(
f
!=
e
)
;
d
=
map
.
phi1
(
d
)
;
}
while
(
d
!=
f
.
dart
)
;
}
Dart
currentFace
=
e
;
Dart
d
=
f
.
dart
;
do
// add all face neighbours to the table
{
Dart
ee
=
map
.
phi2
(
e
)
;
if
(
!
mark
.
isMarked
(
ee
))
// not already marked
Dart
dd
=
map
.
phi2
(
d
)
;
if
(
!
mark
.
isMarked
(
dd
))
// not already marked
{
visitedFaces
.
push_back
(
ee
)
;
mark
.
template
markOrbit
<
FACE
>(
ee
)
;
Face
ff
(
dd
);
visitedFaces
.
push_back
(
ff
)
;
mark
.
markOrbit
(
ff
)
;
}
e
=
map
.
phi1
(
e
)
;
}
while
(
e
!=
currentFace
)
;
d
=
map
.
phi1
(
d
)
;
}
while
(
d
!=
f
.
dart
)
;
}
return
vol
;
...
...
include/Algo/ImplicitHierarchicalMesh/ihm3.h
View file @
fa5e0982
...
...
@@ -399,7 +399,7 @@ public:
//@}
template
<
unsigned
int
ORBIT
>
unsigned
int
getEmbedding
(
Dart
d
)
const
;
unsigned
int
getEmbedding
(
Cell
<
ORBIT
>
c
)
const
;
}
;
template
<
typename
T
,
unsigned
int
ORBIT
>
...
...
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
View file @
fa5e0982
...
...
@@ -579,10 +579,10 @@ inline unsigned int ImplicitHierarchicalMap3::edgeLevel(Dart d)
}
template
<
unsigned
int
ORBIT
>
inline
unsigned
int
ImplicitHierarchicalMap3
::
getEmbedding
(
Dart
d
)
const
inline
unsigned
int
ImplicitHierarchicalMap3
::
getEmbedding
(
Cell
<
ORBIT
>
c
)
const
{
unsigned
int
nbSteps
=
m_curLevel
-
vertexInsertionLevel
(
d
);
unsigned
int
index
=
EmbeddedMap3
::
getEmbedding
<
ORBIT
>
(
d
);
unsigned
int
nbSteps
=
m_curLevel
-
vertexInsertionLevel
(
c
.
dart
);
unsigned
int
index
=
EmbeddedMap3
::
getEmbedding
(
c
);
unsigned
int
step
=
0
;
while
(
step
<
nbSteps
)
...
...
@@ -602,9 +602,9 @@ inline bool ImplicitHierarchicalMap3::isWellEmbedded()
//std::cout << "yeahhh ? " << std::endl;
TraversorV
<
ImplicitHierarchicalMap3
>
tv
(
*
this
);
for
(
Dart
dv
=
tv
.
begin
()
;
dv
!=
tv
.
end
()
;
dv
=
tv
.
next
())
for
(
Vertex
dv
=
tv
.
begin
()
;
dv
.
dart
!=
tv
.
end
()
;
dv
=
tv
.
next
())
{
unsigned
int
curem
=
this
->
getEmbedding
<
VERTEX
>
(
dv
);
unsigned
int
curem
=
this
->
getEmbedding
(
dv
);
//std::cout << "current emb = " << curem << std::endl;
unsigned
int
count
=
0
;
...
...
include/Algo/Modelisation/tetrahedralization.hpp
View file @
fa5e0982
...
...
@@ -470,12 +470,12 @@ Dart splitVertex(typename PFP::MAP& map, std::vector<Dart>& vd)
*************************************************************************************************/
template
<
typename
PFP
>
bool
isTetrahedron
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
unsigned
int
thread
)
bool
isTetrahedron
(
typename
PFP
::
MAP
&
map
,
Vol
v
,
unsigned
int
thread
)
{
unsigned
int
nbFaces
=
0
;
//Test the number of faces end its valency
Traversor3WF
<
typename
PFP
::
MAP
>
travWF
(
map
,
d
,
false
,
thread
);
Traversor3WF
<
typename
PFP
::
MAP
>
travWF
(
map
,
v
,
false
,
thread
);
for
(
Dart
dit
=
travWF
.
begin
()
;
dit
!=
travWF
.
end
();
dit
=
travWF
.
next
())
{
//increase the number of faces
...
...
@@ -484,7 +484,7 @@ bool isTetrahedron(typename PFP::MAP& map, Dart d, unsigned int thread)
return
false
;
//test the valency of this face
if
(
map
.
faceDegree
(
dit
)
!=
3
)
if
(
!
map
.
isCycleTriangle
(
dit
)
)
return
false
;
}
...
...
include/Algo/Multiresolution/filter.h
View file @
fa5e0982
...
...
@@ -45,20 +45,18 @@ public:
}
;
template
<
typename
PFP
>
unsigned
int
vertexLevel
(
typename
PFP
::
MAP
&
map
,
Dart
d
)
unsigned
int
vertexLevel
(
typename
PFP
::
MAP
&
map
,
Vertex
v
)
{
assert
(
map
.
getDartLevel
(
d
)
<=
map
.
getCurrentLevel
()
||
!
"edge
Level : called with a dart inserted after current level"
)
;
assert
(
map
.
getDartLevel
(
v
.
dart
)
<=
map
.
getCurrentLevel
()
||
!
"vertex
Level : called with a dart inserted after current level"
)
;
unsigned
int
level
=
map
.
getMaxLevel
();
TraversorDartsOfOrbit
<
typename
PFP
::
MAP
,
VERTEX
>
tv
(
map
,
d
);
for
(
Dart
dit
=
tv
.
begin
()
;
dit
!=
tv
.
end
()
;
dit
=
tv
.
next
())
map
.
foreach_dart_of_orbit
(
v
,
[
&
]
(
Dart
d
)
{
unsigned
int
ldit
=
map
.
getDartLevel
(
d
it
)
;
unsigned
int
ldit
=
map
.
getDartLevel
(
d
)
;
if
(
ldit
<
level
)
level
=
ldit
;
}
}
);
// Dart dit = d;
// do
...
...
include/Algo/Selection/raySelectFunctor.hpp
View file @
fa5e0982
...
...
@@ -38,193 +38,6 @@ namespace Algo
namespace
Selection
{
//
//template <typename PFP>
//class FuncFaceInter: public FunctorMap<typename PFP::MAP>
//{
// typedef typename PFP::MAP MAP;
//
//protected:
// std::vector<Dart>& m_faces;
// std::vector<typename PFP::VEC3>& m_Ipoints ;
// const typename PFP::VEC3& m_A;
// const typename PFP::VEC3& m_AB;
// const VertexAttribute<typename PFP::VEC3>& m_positions;
//
//public:
// /**
// * @param map the map
// * @param f vector of selected darts
// * @param A first point of ray
// * @param AB direction of ray
// */
// FuncFaceInter(MAP& map, const VertexAttribute<typename PFP::VEC3>& position, std::vector<Dart>& f, std::vector<typename PFP::VEC3>& ip, const typename PFP::VEC3& A, const typename PFP::VEC3& AB):
// FunctorMap<typename PFP::MAP>(map), m_faces(f), m_Ipoints(ip), m_A(A), m_AB(AB), m_positions(position)
// {}
//
// bool operator()(Dart d)
// {
// const typename PFP::VEC3& Ta = m_positions[d];
//
// Dart dd = this->m_map.phi1(d);
// Dart ddd = this->m_map.phi1(dd);
// bool notfound = true;
// do
// {
// // get back position of triangle Ta,Tb,Tc
// const typename PFP::VEC3& Tb = m_positions[dd];
// const typename PFP::VEC3& Tc = m_positions[ddd];
// typename PFP::VEC3 I;
//// if (Geom::intersectionLineTriangle<typename PFP::VEC3>(m_A, m_AB, Ta, Tb, Tc, I))
// if (Geom::intersectionRayTriangleOpt<typename PFP::VEC3>(m_A, m_AB, Ta, Tb, Tc, I))
// {
// m_faces.push_back(d);
// m_Ipoints.push_back(I);
// notfound = false;
// }
// // next triangle if we are in polygon
// dd = ddd;
// ddd = this->m_map.phi1(dd);
// } while ((ddd != d) && notfound);
// return false;
// }
//};
//
//
//template <typename PFP>
//class FuncEdgeInter: public FunctorMap<typename PFP::MAP>
//{
// typedef typename PFP::MAP MAP;
//
//protected:
// std::vector<Dart>& m_edges;
// const typename PFP::VEC3& m_A;
// const typename PFP::VEC3& m_AB;
// float m_AB2;
// float m_distMax;
// const VertexAttribute<typename PFP::VEC3>& m_positions;
//
//public:
// /**
// * @param map the map
// * @param e vector of selected darts
// * @param A first point of ray
// * @param AB direction of ray
// * @param AB2 squared length of direction
// * @param dm2 max distance from ray squared
// */
// FuncEdgeInter(MAP& map, const VertexAttribute<typename PFP::VEC3>& position, std::vector<Dart>& e, const typename PFP::VEC3& A, const typename PFP::VEC3& AB, typename PFP::REAL AB2, typename PFP::REAL dm2):
// FunctorMap<typename PFP::MAP>(map), m_edges(e), m_A(A), m_AB(AB), m_AB2(AB2), m_distMax(dm2), m_positions(position)
// {}
//
// bool operator()(Dart d)
// {
// // get back position of segment PQ
// const typename PFP::VEC3& P = m_positions[d];
// Dart dd = this->m_map.phi1(d);
// const typename PFP::VEC3& Q = m_positions[dd];
// // the three distance to P, Q and (PQ) not used here
// float dist = Geom::squaredDistanceLine2Seg(m_A, m_AB, m_AB2, P, Q);
//
// if (dist < m_distMax)
// {
// m_edges.push_back(d);
// }
// return false;
// }
//};
//
//
//template <typename PFP>
//class FuncVertexInter: public FunctorMap<typename PFP::MAP>
//{
// typedef typename PFP::MAP MAP;
//
//protected:
// std::vector<Dart>& m_vertices;
// const typename PFP::VEC3& m_A;
// const typename PFP::VEC3& m_AB;
// float m_AB2;
// float m_distMax;
// const VertexAttribute<typename PFP::VEC3>& m_positions;
//public:
// /**
// * @param map the map
// * @param v vector of selected darts
// * @param A first point of ray
// * @param AB direction of ray
// * @param AB2 squared length of direction
// * @param dm2 max distance from ray squared
// */
// FuncVertexInter(MAP& map, const VertexAttribute<typename PFP::VEC3>& position, std::vector<Dart>& v, const typename PFP::VEC3& A, const typename PFP::VEC3& AB, typename PFP::REAL AB2, typename PFP::REAL dm2):
// FunctorMap<typename PFP::MAP>(map), m_vertices(v), m_A(A), m_AB(AB), m_AB2(AB2), m_distMax(dm2), m_positions(position)
// {}
//
// bool operator()(Dart d)
// {
// const typename PFP::VEC3& P = m_positions[d];
// float dist = Geom::squaredDistanceLine2Point(m_A, m_AB, m_AB2, P);
// if (dist < m_distMax)
// {
// m_vertices.push_back(d);
// }
// return false;
// }
//};
/**
* Functor which store the dart that correspond to the subpart of face
* that is intersected
* Must be called in foreachface
*/
template
<
typename
PFP
>
class
FuncDartMapD2Inter
:
public
FunctorMap
<
typename
PFP
::
MAP
>
{
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
MAP
::
IMPL
MAP_IMPL
;
typedef
typename
PFP
::
VEC3
VEC3
;
protected:
std
::
vector
<
Dart
>&
m_darts
;
const
VEC3
&
m_A
;
const
VEC3
&
m_AB
;
const
VertexAttribute
<
VEC3
,
MAP_IMPL
>&
m_positions
;
public:
/**
* @param map the map
* @param f vector of selected darts
* @param A first point of ray
* @param AB direction of ray
*/
FuncDartMapD2Inter
(
MAP
&
map
,
const
VertexAttribute
<
VEC3
,
MAP_IMPL
>&
position
,
std
::
vector
<
Dart
>&
f
,
const
VEC3
&
A
,
const
VEC3
&
AB
)
:
FunctorMap
<
MAP
>
(
map
),
m_darts
(
f
),
m_A
(
A
),
m_AB
(
AB
),
m_positions
(
position
)
{}
bool
operator
()(
Dart
d
)
{
typename
PFP
::
VEC3
center
=
Surface
::
Geometry
::
faceCentroid
<
PFP
>
(
this
->
m_map
,
d
,
m_positions
)
;
bool
notfound
=
true
;
Dart
face
=
d
;
do
{
// get back position of triangle
const
VEC3
&
Tb
=
m_positions
[
face
];
//this->m_map.getVertexEmb(face)->getPosition() ;
const
VEC3
&
Tc
=
m_positions
[
this
->
m_map
.
phi1
(
face
)];
//this->m_map.getVertexEmb(this->m_map.phi1(face))->getPosition() ;
// typename PFP::VEC3 I;
// if (Geom::intersectionLineTriangle(m_A, m_AB, center, Tb, Tc, I))
if
(
Geom
::
intersectionRayTriangleOpt
(
m_A
,
m_AB
,
center
,
Tb
,
Tc
))
{
m_darts
.
push_back
(
face
)
;
notfound
=
false
;
}
face
=
this
->
m_map
.
phi1
(
face
)
;
}
while
((
face
!=
d
)
&&
notfound
)
;
return
false
;
}
};
namespace
Parallel
{
...
...
@@ -247,7 +60,12 @@ protected:
public:
FuncVertexInter
(
MAP
&
map
,
const
VertexAttribute
<
VEC3
,
MAP_IMPL
>&
position
,
const
VEC3
&
A
,
const
VEC3
&
AB
,
REAL
AB2
,
REAL
dm2
)
:
FunctorMapThreaded
<
typename
PFP
::
MAP
>
(
map
),
m_positions
(
position
),
m_A
(
A
),
m_AB
(
AB
),
m_AB2
(
AB2
),
m_distMax
(
dm2
)
FunctorMapThreaded
<
typename
PFP
::
MAP
>
(
map
),
m_positions
(
position
),
m_A
(
A
),
m_AB
(
AB
),
m_AB2
(
AB2
),
m_distMax
(
dm2
)
{}
void
run
(
Dart
d
,
unsigned
int
thread
)
...
...
@@ -262,7 +80,7 @@ public:
}
const
std
::
vector
<
std
::
pair
<
REAL
,
Dart
>
>&
getVertexDistances
()
{
return
m_vd
;}
const
std
::
vector
<
std
::
pair
<
REAL
,
Dart
>
>&
getVertexDistances
()
{
return
m_vd
;
}
};
template
<
typename
PFP
>
...
...
@@ -283,7 +101,12 @@ protected:
public:
FuncEdgeInter
(
MAP
&
map
,
const
VertexAttribute
<
VEC3
,
MAP_IMPL
>&
position
,
const
VEC3
&
A
,
const
VEC3
&
AB
,
REAL
AB2
,
REAL
dm2
)
:
FunctorMapThreaded
<
typename
PFP
::
MAP
>
(
map
),
m_positions
(
position
),
m_A
(
A
),
m_AB
(
AB
),
m_AB2
(
AB2
),
m_distMax
(
dm2
)
FunctorMapThreaded
<
typename
PFP
::
MAP
>
(
map
),
m_positions
(
position
),
m_A
(
A
),
m_AB
(
AB
),
m_AB2
(
AB2
),
m_distMax
(
dm2
)
{}
void
run
(
Dart
d
,
unsigned
int
thread
)
...
...
@@ -302,7 +125,7 @@ public:
}
}
const
std
::
vector
<
std
::
pair
<
REAL
,
Dart
>
>&
getEdgeDistances
()
{
return
m_ed
;}
const
std
::
vector
<
std
::
pair
<
REAL
,
Dart
>
>&
getEdgeDistances
()
{
return
m_ed
;
}
};
template
<
typename
PFP
>
...
...
@@ -321,7 +144,10 @@ protected:
public:
FuncFaceInter
(
MAP
&
map
,
const
VertexAttribute
<
VEC3
,
MAP_IMPL
>&
position
,
const
VEC3
&
A
,
const
VEC3
&
AB
)
:
FunctorMapThreaded
<
typename
PFP
::
MAP
>
(
map
),
m_positions
(
position
),
m_A
(
A
),
m_AB
(
AB
)
FunctorMapThreaded
<
typename
PFP
::
MAP
>
(
map
),
m_positions
(
position
),
m_A
(
A
),
m_AB
(
AB
)
{}
void
run
(
Dart
d
,
unsigned
int
thread
)
...
...
@@ -349,7 +175,7 @@ public:
}
while
((
ddd
!=
d
)
&&
notfound
);
}
const
std
::
vector
<
std
::
pair
<
REAL
,
Dart
>
>&
getFaceDistances
()
{
return
m_fd
;}
const
std
::
vector
<
std
::
pair
<
REAL
,
Dart
>
>&
getFaceDistances
()
{
return
m_fd
;
}
};
}
// namespace Parallel
...
...
include/Algo/Selection/raySelector.h
View file @
fa5e0982
...
...
@@ -25,7 +25,6 @@
#ifndef RAYSELECTOR_H_
#define RAYSELECTOR_H_
#include <vector>
#include "Algo/Selection/raySelectFunctor.hpp"
...
...
include/Topology/generic/cellmarker.h
View file @
fa5e0982
...
...
@@ -150,43 +150,43 @@ public:
/**
* mark the cell of dart
*/
inline
void
mark
(
Cell
<
CELL
>
d
)
inline
void
mark
(
Cell
<
CELL
>
c
)
{
assert
(
m_map
.
template
getMarkerSet
<
CELL
>(
m_thread
).
testMark
(
m_mark
));