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
15a8cad2
Commit
15a8cad2
authored
May 06, 2014
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compute volume colors in volumeExplorer main
parent
7dd93bed
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
23 deletions
+26
-23
Apps/Examples/volumeExplorer.cpp
Apps/Examples/volumeExplorer.cpp
+23
-20
include/Topology/generic/dartmarker.h
include/Topology/generic/dartmarker.h
+3
-3
No files found.
Apps/Examples/volumeExplorer.cpp
View file @
15a8cad2
...
...
@@ -29,6 +29,7 @@
#include "Algo/Modelisation/polyhedron.h"
#include "Algo/Import/import.h"
#include "Algo/Geometry/volume.h"
#include "Algo/Geometry/area.h"
#include "Utils/chrono.h"
...
...
@@ -176,7 +177,7 @@ void MyQT::cb_Open()
// if (v>maxV)
// maxV=v;
if
(
myMap
.
is
BoundaryAdjacentVolume
(
d
))
if
(
myMap
.
is
VolumeIncidentToBoundary
(
d
))
color
[
d
]
=
PFP
::
VEC3
(
0
,
0
,
0
);
}
// for (unsigned int i = color.begin(); i != color.end(); color.next(i))
...
...
@@ -417,20 +418,20 @@ int main(int argc, char **argv)
for
(
Dart
d
=
tra
.
begin
();
d
!=
tra
.
end
();
d
=
tra
.
next
())
{
float
v
=
Algo
::
Geometry
::
tetrahedronVolume
<
PFP
>
(
myMap
,
d
,
position
);
//
color[d] = PFP::VEC3(v,0,0);
//
if (v>maxV)
//
maxV=v;
color
[
d
]
=
PFP
::
VEC3
(
v
,
0
,
0
);
if
(
v
>
maxV
)
maxV
=
v
;
if
(
myMap
.
is
BoundaryAdjacentVolume
(
d
))
color
[
d
]
=
PFP
::
VEC3
(
0
,
0
,
0
);
else
//
if(myMap.is
VolumeIncidentToBoundary
(d))
//
color[d] = PFP::VEC3(0,0,0);
//
else
color
[
d
]
=
PFP
::
VEC3
(
v
,
0
,
0
);
}
//
for (unsigned int i = color.begin(); i != color.end(); color.next(i))
//
{
//
color[i][0] /= maxV;
//
color[i][2] = 1.0f - color[i][0];
//
}
for
(
unsigned
int
i
=
color
.
begin
();
i
!=
color
.
end
();
color
.
next
(
i
))
{
color
[
i
][
0
]
/=
maxV
;
color
[
i
][
2
]
=
1.0
f
-
color
[
i
][
0
];
}
}
else
...
...
@@ -505,9 +506,18 @@ int main(int argc, char **argv)
Vol
w
(
myMap
.
begin
());
VEC3
q
=
Algo
::
Surface
::
Geometry
::
volumeCentroid
<
PFP
>
(
myMap
,
w
,
position
);
ch
.
start
();
float
vol
=
Algo
::
Geometry
::
Parallel
::
totalVolume
<
PFP
>
(
myMap
,
position
);
vol
+=
Algo
::
Geometry
::
Parallel
::
totalVolume
<
PFP
>
(
myMap
,
position
);
vol
+=
Algo
::
Geometry
::
Parallel
::
totalVolume
<
PFP
>
(
myMap
,
position
);
vol
+=
Algo
::
Geometry
::
Parallel
::
totalVolume
<
PFP
>
(
myMap
,
position
);
std
::
cout
<<
ch
.
elapsed
()
<<
" ms // val="
<<
vol
<<
std
::
endl
;
std
::
cout
<<
"Compute Volume ->"
<<
std
::
endl
;
ch
.
start
();
float
vol
=
Algo
::
Geometry
::
totalVolume
<
PFP
>
(
myMap
,
position
);
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
);
...
...
@@ -519,13 +529,6 @@ int main(int argc, char **argv)
vol
+=
Algo
::
Geometry
::
totalVolume
<
PFP
>
(
myMap
,
position
);
std
::
cout
<<
ch
.
elapsed
()
<<
" ms val="
<<
vol
<<
std
::
endl
;
ch
.
start
();
vol
=
Algo
::
Geometry
::
Parallel
::
totalVolume
<
PFP
>
(
myMap
,
position
);
vol
+=
Algo
::
Geometry
::
Parallel
::
totalVolume
<
PFP
>
(
myMap
,
position
);
vol
+=
Algo
::
Geometry
::
Parallel
::
totalVolume
<
PFP
>
(
myMap
,
position
);
vol
+=
Algo
::
Geometry
::
Parallel
::
totalVolume
<
PFP
>
(
myMap
,
position
);
std
::
cout
<<
ch
.
elapsed
()
<<
" ms // val="
<<
vol
<<
std
::
endl
;
// et on attend la fin.
return
app
.
exec
();
...
...
include/Topology/generic/dartmarker.h
View file @
15a8cad2
...
...
@@ -301,9 +301,9 @@ public:
assert
(
this
->
m_map
.
template
getMarkerSet
<
DART
>(
this
->
m_thread
).
testMark
(
this
->
m_mark
));
this
->
m_map
.
foreach_dart_of_orbit
(
c
,
[
&
]
(
Dart
d
)
{
unsigned
int
dindex
=
this
->
m_map
.
dartIndex
(
d
);
(
*
this
->
m_markVector
)[
dindex
].
setMark
(
this
->
m_mark
);
m_markedDarts
.
push_back
(
dindex
);
unsigned
int
d
_
index
=
this
->
m_map
.
dartIndex
(
d
);
(
*
this
->
m_markVector
)[
d
_
index
].
setMark
(
this
->
m_mark
);
m_markedDarts
.
push_back
(
d
_
index
);
}
,
this
->
m_thread
)
;
}
...
...
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