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
Thomas Pitiot
CGoGN
Commits
05a091e4
Commit
05a091e4
authored
Jun 12, 2014
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove some warnings
parent
22d81ee3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
51 additions
and
67 deletions
+51
-67
include/Algo/Geometry/area.hpp
include/Algo/Geometry/area.hpp
+6
-7
include/Algo/Geometry/centroid.hpp
include/Algo/Geometry/centroid.hpp
+18
-24
include/Algo/Geometry/curvature.hpp
include/Algo/Geometry/curvature.hpp
+6
-8
include/Algo/Geometry/normal.hpp
include/Algo/Geometry/normal.hpp
+13
-19
include/Algo/Geometry/volume.hpp
include/Algo/Geometry/volume.hpp
+5
-6
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
+2
-2
include/Topology/generic/traversor/traversor3.h
include/Topology/generic/traversor/traversor3.h
+1
-1
No files found.
include/Algo/Geometry/area.hpp
View file @
05a091e4
...
...
@@ -233,7 +233,7 @@ void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP
// },nbth,false,AUTO);
// }
CGoGN
::
Parallel
::
foreach_cell
<
FACE
>
(
map
,[
&
](
Face
f
,
unsigned
int
thr
)
CGoGN
::
Parallel
::
foreach_cell
<
FACE
>
(
map
,
[
&
]
(
Face
f
,
unsigned
int
/*
thr
*/
)
{
area
[
f
]
=
convexFaceArea
<
PFP
>
(
map
,
f
,
position
)
;
});
...
...
@@ -243,10 +243,10 @@ void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP
template
<
typename
PFP
>
void
computeOneRingAreaVertices
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
,
VertexAttribute
<
typename
PFP
::
REAL
,
typename
PFP
::
MAP
>&
area
)
{
CGoGN
::
Parallel
::
foreach_cell
<
VERTEX
>
(
map
,[
&
](
Vertex
v
,
unsigned
int
thr
)
CGoGN
::
Parallel
::
foreach_cell
<
VERTEX
>
(
map
,
[
&
]
(
Vertex
v
,
unsigned
int
/*
thr
*/
)
{
area
[
v
]
=
vertexOneRingArea
<
PFP
>
(
map
,
v
,
position
)
;
},
FORCE_CELL_MARKING
);
},
FORCE_CELL_MARKING
);
}
template
<
typename
PFP
>
...
...
@@ -255,17 +255,16 @@ void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribut
CGoGN
::
Parallel
::
foreach_cell
<
VERTEX
>
(
map
,
[
&
]
(
Vertex
v
,
unsigned
int
thr
)
{
vertex_area
[
v
]
=
vertexBarycentricArea
<
PFP
>
(
map
,
v
,
position
)
;
}
,
FORCE_CELL_MARKING
);
},
FORCE_CELL_MARKING
);
}
template
<
typename
PFP
>
void
computeVoronoiAreaVertices
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
,
VertexAttribute
<
typename
PFP
::
REAL
,
typename
PFP
::
MAP
>&
area
)
{
CGoGN
::
Parallel
::
foreach_cell
<
VERTEX
>
(
map
,[
&
](
Vertex
v
,
unsigned
int
thr
)
CGoGN
::
Parallel
::
foreach_cell
<
VERTEX
>
(
map
,
[
&
]
(
Vertex
v
,
unsigned
int
/*
thr
*/
)
{
area
[
v
]
=
vertexVoronoiArea
<
PFP
>
(
map
,
v
,
position
)
;
},
FORCE_CELL_MARKING
);
},
FORCE_CELL_MARKING
);
}
}
// namespace Parallel
...
...
include/Algo/Geometry/centroid.hpp
View file @
05a091e4
...
...
@@ -164,7 +164,7 @@ void computeCentroidELWFaces(typename PFP::MAP& map, const V_ATT& position, F_AT
template
<
typename
PFP
,
typename
V_ATT
>
void
computeNeighborhoodCentroidVertices
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
V_ATT
&
vertex_centroid
,
unsigned
int
thread
)
{
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
{
Parallel
::
computeNeighborhoodCentroidVertices
<
PFP
,
V_ATT
>
(
map
,
position
,
vertex_centroid
);
return
;
...
...
@@ -173,8 +173,7 @@ void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& po
foreach_cell
<
VERTEX
>
(
map
,
[
&
]
(
Vertex
v
)
{
vertex_centroid
[
v
]
=
vertexNeighborhoodCentroid
<
PFP
,
V_ATT
>
(
map
,
v
,
position
)
;
}
,
AUTO
,
thread
);
},
AUTO
,
thread
);
}
...
...
@@ -184,7 +183,7 @@ namespace Parallel
template
<
typename
PFP
,
typename
V_ATT
,
typename
F_ATT
>
void
computeCentroidFaces
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
F_ATT
&
face_centroid
)
{
CGoGN
::
Parallel
::
foreach_cell
<
FACE
>
(
map
,[
&
](
Face
f
,
unsigned
int
thr
)
CGoGN
::
Parallel
::
foreach_cell
<
FACE
>
(
map
,[
&
](
Face
f
,
unsigned
int
/*
thr
*/
)
{
face_centroid
[
f
]
=
faceCentroid
<
PFP
>
(
map
,
f
,
position
)
;
});
...
...
@@ -193,7 +192,7 @@ void computeCentroidFaces(typename PFP::MAP& map, const V_ATT& position, F_ATT&
template
<
typename
PFP
,
typename
V_ATT
,
typename
F_ATT
>
void
computeCentroidELWFaces
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
F_ATT
&
face_centroid
)
{
CGoGN
::
Parallel
::
foreach_cell
<
FACE
>
(
map
,[
&
](
Face
f
,
unsigned
int
thr
)
CGoGN
::
Parallel
::
foreach_cell
<
FACE
>
(
map
,[
&
](
Face
f
,
unsigned
int
/*
thr
*/
)
{
face_centroid
[
f
]
=
faceCentroidELW
<
PFP
>
(
map
,
f
,
position
)
;
});
...
...
@@ -204,10 +203,10 @@ template <typename PFP, typename V_ATT>
void
computeNeighborhoodCentroidVertices
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
V_ATT
&
vertex_centroid
)
{
CGoGN
::
Parallel
::
foreach_cell
<
VERTEX
>
(
map
,[
&
](
Vertex
v
,
unsigned
int
thr
)
CGoGN
::
Parallel
::
foreach_cell
<
VERTEX
>
(
map
,[
&
](
Vertex
v
,
unsigned
int
/*
thr
*/
)
{
vertex_centroid
[
v
]
=
vertexNeighborhoodCentroid
<
PFP
>
(
map
,
v
,
position
)
;
},
FORCE_CELL_MARKING
);
},
FORCE_CELL_MARKING
);
}
}
// namespace Parallel
...
...
@@ -229,12 +228,11 @@ typename V_ATT::DATA_TYPE vertexNeighborhoodCentroid(typename PFP::MAP& map, Ver
{
typename
V_ATT
::
DATA_TYPE
center
(
0.0
);
unsigned
int
count
=
0
;
foreach_adjacent3
<
EDGE
>
(
map
,
v
,
[
&
](
Vertex
it
)
foreach_adjacent3
<
EDGE
>
(
map
,
v
,
[
&
]
(
Vertex
it
)
{
center
+=
attributs
[
it
];
++
count
;
}
,
false
,
thread
);
},
false
,
thread
);
center
/=
count
;
return
center
;
}
...
...
@@ -242,7 +240,7 @@ typename V_ATT::DATA_TYPE vertexNeighborhoodCentroid(typename PFP::MAP& map, Ver
template
<
typename
PFP
,
typename
V_ATT
,
typename
W_ATT
>
void
computeCentroidVolumes
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
W_ATT
&
vol_centroid
,
unsigned
int
thread
)
{
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
{
Parallel
::
computeCentroidVolumes
<
PFP
,
V_ATT
,
W_ATT
>
(
map
,
position
,
vol_centroid
);
return
;
...
...
@@ -251,14 +249,13 @@ void computeCentroidVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT
foreach_cell
<
VOLUME
>
(
map
,
[
&
]
(
Vol
v
)
{
vol_centroid
[
v
]
=
Surface
::
Geometry
::
volumeCentroid
<
PFP
,
V_ATT
>
(
map
,
v
,
position
,
thread
)
;
}
,
AUTO
,
thread
);
},
AUTO
,
thread
);
}
template
<
typename
PFP
,
typename
V_ATT
,
typename
W_ATT
>
void
computeCentroidELWVolumes
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
W_ATT
&
vol_centroid
,
unsigned
int
thread
)
{
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
{
Parallel
::
computeCentroidELWVolumes
<
PFP
,
V_ATT
,
W_ATT
>
(
map
,
position
,
vol_centroid
);
return
;
...
...
@@ -267,14 +264,13 @@ void computeCentroidELWVolumes(typename PFP::MAP& map, const V_ATT& position, W_
foreach_cell
<
VOLUME
>
(
map
,
[
&
]
(
Vol
v
)
{
vol_centroid
[
v
]
=
Surface
::
Geometry
::
volumeCentroidELW
<
PFP
,
V_ATT
>
(
map
,
v
,
position
,
thread
)
;
}
,
AUTO
,
thread
);
},
AUTO
,
thread
);
}
template
<
typename
PFP
,
typename
V_ATT
>
void
computeNeighborhoodCentroidVertices
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
V_ATT
&
vertex_centroid
,
unsigned
int
thread
)
{
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
{
Parallel
::
computeNeighborhoodCentroidVertices
<
PFP
,
V_ATT
>
(
map
,
position
,
vertex_centroid
);
return
;
...
...
@@ -283,8 +279,7 @@ void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& po
foreach_cell
<
VERTEX
>
(
map
,
[
&
]
(
Vertex
v
)
{
vertex_centroid
[
v
]
=
Volume
::
Geometry
::
vertexNeighborhoodCentroid
<
PFP
,
V_ATT
>
(
map
,
v
,
position
)
;
}
,
AUTO
,
thread
);
},
AUTO
,
thread
);
}
...
...
@@ -294,7 +289,7 @@ namespace Parallel
template
<
typename
PFP
,
typename
V_ATT
,
typename
W_ATT
>
void
computeCentroidVolumes
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
W_ATT
&
vol_centroid
)
{
CGoGN
::
Parallel
::
foreach_cell
<
VOLUME
>
(
map
,[
&
](
Vol
v
,
unsigned
int
thr
)
CGoGN
::
Parallel
::
foreach_cell
<
VOLUME
>
(
map
,
[
&
]
(
Vol
v
,
unsigned
int
thr
)
{
vol_centroid
[
v
]
=
Surface
::
Geometry
::
volumeCentroid
<
PFP
,
V_ATT
>
(
map
,
v
,
position
,
thr
)
;
});
...
...
@@ -303,20 +298,19 @@ void computeCentroidVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT
template
<
typename
PFP
,
typename
V_ATT
,
typename
W_ATT
>
void
computeCentroidELWVolumes
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
W_ATT
&
vol_centroid
)
{
CGoGN
::
Parallel
::
foreach_cell
<
VOLUME
>
(
map
,[
&
](
Vol
v
,
unsigned
int
thr
)
CGoGN
::
Parallel
::
foreach_cell
<
VOLUME
>
(
map
,
[
&
]
(
Vol
v
,
unsigned
int
thr
)
{
vol_centroid
[
v
]
=
Surface
::
Geometry
::
volumeCentroidELW
<
PFP
,
V_ATT
>
(
map
,
v
,
position
,
thr
)
;
});
}
template
<
typename
PFP
,
typename
V_ATT
>
void
computeNeighborhoodCentroidVertices
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
V_ATT
&
vertex_centroid
)
{
CGoGN
::
Parallel
::
foreach_cell
<
VERTEX
>
(
map
,[
&
](
Vertex
v
,
unsigned
int
thr
)
CGoGN
::
Parallel
::
foreach_cell
<
VERTEX
>
(
map
,
[
&
]
(
Vertex
v
,
unsigned
int
thr
)
{
vertex_centroid
[
v
]
=
Volume
::
Geometry
::
vertexNeighborhoodCentroid
<
PFP
,
V_ATT
>
(
map
,
v
,
position
,
thr
)
;
},
true
,
FORCE_CELL_MARKING
);
},
FORCE_CELL_MARKING
);
}
}
// namespace Parallel
...
...
include/Algo/Geometry/curvature.hpp
View file @
05a091e4
...
...
@@ -664,10 +664,10 @@ void computeCurvatureVertices_NormalCycles(
if
(
!
map
.
template
isOrbitEmbedded
<
FACE
>())
Algo
::
Topo
::
initAllOrbitsEmbedding
<
FACE
>
(
map
);
CGoGN::Parallel::foreach_cell<VERTEX>(map,[&](Vertex v, unsigned int threadID)
CGoGN
::
Parallel
::
foreach_cell
<
VERTEX
>
(
map
,
[
&
]
(
Vertex
v
,
unsigned
int
threadID
)
{
computeCurvatureVertex_NormalCycles
<
PFP
>
(
map
,
v
,
radius
,
position
,
normal
,
edgeangle
,
kmax
,
kmin
,
Kmax
,
Kmin
,
Knormal
,
threadID
)
;
},FORCE_CELL_MARKING);
},
FORCE_CELL_MARKING
);
}
template
<
typename
PFP
>
...
...
@@ -693,14 +693,12 @@ void computeCurvatureVertices_NormalCycles_Projected(
if
(
!
map
.
template
isOrbitEmbedded
<
FACE
>())
Algo
::
Topo
::
initAllOrbitsEmbedding
<
FACE
>
(
map
);
CGoGN::Parallel::foreach_cell<VERTEX>(map,[&](Vertex v, unsigned int threadID)
CGoGN
::
Parallel
::
foreach_cell
<
VERTEX
>
(
map
,
[
&
]
(
Vertex
v
,
unsigned
int
threadID
)
{
computeCurvatureVertex_NormalCycles_Projected
<
PFP
>
(
map
,
v
,
radius
,
position
,
normal
,
edgeangle
,
kmax
,
kmin
,
Kmax
,
Kmin
,
Knormal
,
threadID
)
;
},FORCE_CELL_MARKING);
},
FORCE_CELL_MARKING
);
}
template
<
typename
PFP
>
void
computeCurvatureVertices_QuadraticFitting
(
typename
PFP
::
MAP
&
map
,
...
...
@@ -711,10 +709,10 @@ void computeCurvatureVertices_QuadraticFitting(
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
Kmax
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
Kmin
)
{
CGoGN::Parallel::foreach_cell<VERTEX>(map,[&](Vertex v, unsigned int threadID)
CGoGN
::
Parallel
::
foreach_cell
<
VERTEX
>
(
map
,
[
&
]
(
Vertex
v
,
unsigned
int
threadID
)
{
computeCurvatureVertex_QuadraticFitting
<
PFP
>
(
map
,
v
,
position
,
normal
,
kmax
,
kmin
,
Kmax
,
Kmin
,
threadID
)
;
},FORCE_CELL_MARKING);
},
FORCE_CELL_MARKING
);
}
...
...
include/Algo/Geometry/normal.hpp
View file @
05a091e4
...
...
@@ -145,36 +145,33 @@ typename V_ATT::DATA_TYPE vertexBorderNormal(typename PFP::MAP& map, Vertex v, c
template
<
typename
PFP
,
typename
V_ATT
,
typename
F_ATT
>
void
computeNormalFaces
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
F_ATT
&
face_normal
,
unsigned
int
thread
)
{
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
{
Parallel
::
computeNormalFaces
<
PFP
,
V_ATT
,
F_ATT
>
(
map
,
position
,
face_normal
);
Parallel
::
computeNormalFaces
<
PFP
,
V_ATT
,
F_ATT
>
(
map
,
position
,
face_normal
);
return
;
}
foreach_cell
<
FACE
>
(
map
,
[
&
]
(
Face
f
)
{
face_normal
[
f
]
=
faceNormal
<
PFP
>
(
map
,
f
,
position
)
;
},
AUTO
,
thread
);
},
AUTO
,
thread
);
}
template
<
typename
PFP
,
typename
V_ATT
>
void
computeNormalVertices
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
V_ATT
&
normal
,
unsigned
int
thread
)
{
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
{
Parallel
::
computeNormalVertices
<
PFP
,
V_ATT
>
(
map
,
position
,
normal
);
Parallel
::
computeNormalVertices
<
PFP
,
V_ATT
>
(
map
,
position
,
normal
);
return
;
}
foreach_cell
<
VERTEX
>
(
map
,
[
&
]
(
Vertex
v
)
{
normal
[
v
]
=
vertexNormal
<
PFP
>
(
map
,
v
,
position
)
;
},
FORCE_CELL_MARKING
,
thread
);
},
FORCE_CELL_MARKING
,
thread
);
}
template
<
typename
PFP
,
typename
V_ATT
>
typename
PFP
::
REAL
computeAngleBetweenNormalsOnEdge
(
typename
PFP
::
MAP
&
map
,
Edge
e
,
const
V_ATT
&
position
)
{
...
...
@@ -211,47 +208,44 @@ typename PFP::REAL computeAngleBetweenNormalsOnEdge(typename PFP::MAP& map, Edge
template
<
typename
PFP
,
typename
V_ATT
,
typename
E_ATT
>
void
computeAnglesBetweenNormalsOnEdges
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
E_ATT
&
angles
,
unsigned
int
thread
)
{
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
{
Parallel
::
computeAnglesBetweenNormalsOnEdges
<
PFP
,
V_ATT
,
E_ATT
>
(
map
,
position
,
angles
);
Parallel
::
computeAnglesBetweenNormalsOnEdges
<
PFP
,
V_ATT
,
E_ATT
>
(
map
,
position
,
angles
);
return
;
}
foreach_cell
<
EDGE
>
(
map
,
[
&
]
(
Edge
e
)
{
angles
[
e
]
=
computeAngleBetweenNormalsOnEdge
<
PFP
>
(
map
,
e
,
position
)
;
},
AUTO
,
thread
);
},
AUTO
,
thread
);
}
namespace
Parallel
{
template
<
typename
PFP
,
typename
V_ATT
>
void
computeNormalVertices
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
V_ATT
&
normal
)
{
CGoGN
::
Parallel
::
foreach_cell
<
VERTEX
>
(
map
,[
&
](
Vertex
v
,
unsigned
int
/*thr*/
)
CGoGN
::
Parallel
::
foreach_cell
<
VERTEX
>
(
map
,
[
&
]
(
Vertex
v
,
unsigned
int
/*thr*/
)
{
normal
[
v
]
=
vertexNormal
<
PFP
>
(
map
,
v
,
position
)
;
},
FORCE_CELL_MARKING
);
},
FORCE_CELL_MARKING
);
}
template
<
typename
PFP
,
typename
V_ATT
,
typename
F_ATT
>
void
computeNormalFaces
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
F_ATT
&
normal
)
{
CGoGN
::
Parallel
::
foreach_cell
<
FACE
>
(
map
,[
&
](
Face
f
,
unsigned
int
thr
)
CGoGN
::
Parallel
::
foreach_cell
<
FACE
>
(
map
,
[
&
]
(
Face
f
,
unsigned
int
/*
thr
*/
)
{
normal
[
f
]
=
faceNormal
<
PFP
>
(
map
,
f
,
position
)
;
});
}
template
<
typename
PFP
,
typename
V_ATT
,
typename
E_ATT
>
void
computeAnglesBetweenNormalsOnEdges
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
E_ATT
&
angles
)
{
CGoGN
::
Parallel
::
foreach_cell
<
EDGE
>
(
map
,[
&
](
Edge
e
,
unsigned
int
thr
)
CGoGN
::
Parallel
::
foreach_cell
<
EDGE
>
(
map
,[
&
](
Edge
e
,
unsigned
int
/*
thr
*/
)
{
angles
[
e
]
=
computeAngleBetweenNormalsOnEdge
<
PFP
>
(
map
,
e
,
position
)
;
});
...
...
include/Algo/Geometry/volume.hpp
View file @
05a091e4
...
...
@@ -126,17 +126,16 @@ typename PFP::REAL convexPolyhedronVolume(typename PFP::MAP& map, Vol v, const V
template
<
typename
PFP
>
typename
PFP
::
REAL
totalVolume
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
,
unsigned
int
thread
)
{
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
{
return
Parallel
::
totalVolume
<
PFP
>
(
map
,
position
);
return
Parallel
::
totalVolume
<
PFP
>
(
map
,
position
);
}
double
vol
=
0.0
;
TraversorW
<
typename
PFP
::
MAP
>
t
(
map
,
thread
)
;
for
(
Dart
d
=
t
.
begin
();
d
!=
t
.
end
();
d
=
t
.
next
())
vol
+=
convexPolyhedronVolume
<
PFP
>
(
map
,
d
,
position
,
thread
)
;
vol
+=
convexPolyhedronVolume
<
PFP
>
(
map
,
d
,
position
,
thread
)
;
return
typename
PFP
::
REAL
(
vol
)
;
}
...
...
@@ -148,10 +147,10 @@ template <typename PFP>
typename
PFP
::
REAL
totalVolume
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
)
{
// allocate a vector of 1 accumulator for each thread
std
::
vector
<
typename
PFP
::
REAL
>
vols
(
CGoGN
::
Parallel
::
NumberOfThreads
-
1
,
0.0
);
std
::
vector
<
typename
PFP
::
REAL
>
vols
(
CGoGN
::
Parallel
::
NumberOfThreads
-
1
,
0.0
);
// foreach volume
CGoGN
::
Parallel
::
foreach_cell
<
VOLUME
>
(
map
,[
&
](
Vol
v
,
unsigned
int
thr
)
CGoGN
::
Parallel
::
foreach_cell
<
VOLUME
>
(
map
,
[
&
]
(
Vol
v
,
unsigned
int
thr
)
{
// add volume to the thread accumulator
vols
[
thr
-
1
]
+=
convexPolyhedronVolume
<
PFP
>
(
map
,
v
,
position
,
thr
)
;
...
...
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
View file @
05a091e4
...
...
@@ -361,13 +361,13 @@ inline void ImplicitHierarchicalMap3::foreach_dart_of_volume(Dart d, FUNC& f, un
}
template
<
typename
FUNC
>
inline
void
ImplicitHierarchicalMap3
::
foreach_dart_of_vertex1
(
Dart
d
,
FUNC
&
f
,
unsigned
int
thread
)
const
inline
void
ImplicitHierarchicalMap3
::
foreach_dart_of_vertex1
(
Dart
d
,
FUNC
&
f
,
unsigned
int
/*
thread
*/
)
const
{
f
(
d
);
}
template
<
typename
FUNC
>
inline
void
ImplicitHierarchicalMap3
::
foreach_dart_of_edge1
(
Dart
d
,
FUNC
&
f
,
unsigned
int
thread
)
const
inline
void
ImplicitHierarchicalMap3
::
foreach_dart_of_edge1
(
Dart
d
,
FUNC
&
f
,
unsigned
int
/*
thread
*/
)
const
{
f
(
d
);
}
...
...
include/Topology/generic/traversor/traversor3.h
View file @
05a091e4
...
...
@@ -361,7 +361,7 @@ inline void foreach_incident3(MAP& map, Cell<ORBIT_FROM> c, FUNC f, bool forceDa
template
<
unsigned
int
THRU
,
unsigned
int
ORBIT
,
typename
MAP
,
typename
FUNC
>
inline
void
foreach_adjacent3
(
MAP
&
map
,
Cell
<
ORBIT
>
c
,
FUNC
f
,
bool
forceDartMarker
=
false
,
unsigned
int
thread
=
0
)
inline
void
foreach_adjacent3
(
MAP
&
map
,
Cell
<
ORBIT
>
c
,
FUNC
f
,
bool
forceDartMarker
=
false
,
unsigned
int
thread
=
0
)
{
Traversor3XXaY
<
MAP
,
ORBIT
,
THRU
>
trav
(
const_cast
<
const
MAP
&>
(
map
),
c
,
forceDartMarker
,
thread
);
for
(
Cell
<
ORBIT
>
c
=
trav
.
begin
(),
e
=
trav
.
end
();
c
.
dart
!=
e
.
dart
;
c
=
trav
.
next
())
...
...
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