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
Hurstel
CGoGN
Commits
294c2fa3
Commit
294c2fa3
authored
Aug 24, 2012
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
big bug in convexPolyhedronVolume (result was wrong)
parent
95bec210
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
include/Algo/Geometry/volume.hpp
include/Algo/Geometry/volume.hpp
+12
-7
No files found.
include/Algo/Geometry/volume.hpp
View file @
294c2fa3
...
...
@@ -73,6 +73,7 @@ typename PFP::REAL convexPolyhedronVolume(typename PFP::MAP& map, Dart d, const
std
::
vector
<
Dart
>
visitedFaces
;
visitedFaces
.
reserve
(
100
)
;
visitedFaces
.
push_back
(
d
)
;
mark
.
markOrbit
<
FACE
>
(
d
)
;
...
...
@@ -104,7 +105,7 @@ typename PFP::REAL convexPolyhedronVolume(typename PFP::MAP& map, Dart d, const
if
(
!
mark
.
isMarked
(
ee
))
// not already marked
{
visitedFaces
.
push_back
(
ee
)
;
mark
.
markOrbit
<
FACE
>
(
e
)
;
mark
.
markOrbit
<
FACE
>
(
e
e
)
;
}
e
=
map
.
phi1
(
e
)
;
}
while
(
e
!=
*
face
)
;
...
...
@@ -117,11 +118,13 @@ typename PFP::REAL convexPolyhedronVolume(typename PFP::MAP& map, Dart d, const
template
<
typename
PFP
>
typename
PFP
::
REAL
totalVolume
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
FunctorSelect
&
select
,
unsigned
int
thread
)
{
typename
PFP
::
REAL
vol
=
0
;
// typename PFP::REAL vol = 0 ;
double
vol
=
0
;
TraversorW
<
typename
PFP
::
MAP
>
t
(
map
,
select
,
thread
)
;
for
(
Dart
d
=
t
.
begin
();
d
!=
t
.
end
();
d
=
t
.
next
())
vol
+=
convexPolyhedronVolume
<
PFP
>
(
map
,
d
,
position
,
thread
)
;
return
vol
;
return
typename
PFP
::
REAL
(
vol
)
;
}
...
...
@@ -132,7 +135,8 @@ template <typename PFP>
class
FunctorTotalVolume
:
public
FunctorMapThreaded
<
typename
PFP
::
MAP
>
{
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
m_position
;
typename
PFP
::
REAL
m_vol
;
// typename PFP::REAL m_vol;
double
m_vol
;
public:
FunctorTotalVolume
<
PFP
>
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
)
:
FunctorMapThreaded
<
typename
PFP
::
MAP
>
(
map
),
m_position
(
position
),
m_vol
(
0.0
)
...
...
@@ -143,7 +147,8 @@ public:
m_vol
+=
convexPolyhedronVolume
<
PFP
>
(
this
->
m_map
,
d
,
m_position
,
threadID
)
;
}
typename
PFP
::
REAL
getVol
()
const
// typename PFP::REAL getVol() const
double
getVol
()
const
{
return
m_vol
;
}
...
...
@@ -164,7 +169,7 @@ typename PFP::REAL totalVolume(typename PFP::MAP& map, const VertexAttribute<typ
functs
.
push_back
(
new
FunctorTotalVolume
<
PFP
>
(
map
,
position
));
}
typename
PFP
::
REAL
total
=
0.0
;
double
total
=
0.0
;
Algo
::
Parallel
::
foreach_cell
<
typename
PFP
::
MAP
,
VOLUME
>
(
map
,
functs
,
nbth
,
true
,
select
,
current_thread
);
...
...
@@ -173,7 +178,7 @@ typename PFP::REAL totalVolume(typename PFP::MAP& map, const VertexAttribute<typ
total
+=
reinterpret_cast
<
FunctorTotalVolume
<
PFP
>*>
(
functs
[
i
])
->
getVol
();
delete
functs
[
i
];
}
return
t
otal
;
return
t
ypename
PFP
::
REAL
(
total
)
;
}
}
...
...
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