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
b78a9704
Commit
b78a9704
authored
May 06, 2014
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of cgogn:~kraemer/CGoGN into develop
parents
07dc1967
15a8cad2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
46 additions
and
38 deletions
+46
-38
Apps/Examples/volumeExplorer.cpp
Apps/Examples/volumeExplorer.cpp
+28
-22
include/Algo/Import/importMRDAT.hpp
include/Algo/Import/importMRDAT.hpp
+5
-3
include/Algo/Multiresolution/Map2MR/Filters/sqrt3.h
include/Algo/Multiresolution/Map2MR/Filters/sqrt3.h
+1
-1
include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.hpp
include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.hpp
+1
-1
include/Topology/generic/dartmarker.h
include/Topology/generic/dartmarker.h
+3
-3
include/Topology/map/map3.h
include/Topology/map/map3.h
+1
-1
include/Topology/map/map3.hpp
include/Topology/map/map3.hpp
+2
-2
include/Utils/colourConverter.h
include/Utils/colourConverter.h
+5
-5
No files found.
Apps/Examples/volumeExplorer.cpp
View file @
b78a9704
...
...
@@ -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"
...
...
@@ -171,16 +172,19 @@ void MyQT::cb_Open()
float
maxV
=
0.0
f
;
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
;
}
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
];
// float v = Algo::Geometry::tetrahedronVolume<PFP>(myMap, d, position);
// color[d] = PFP::VEC3(v,0,0);
// if (v>maxV)
// maxV=v;
if
(
myMap
.
isVolumeIncidentToBoundary
(
d
))
color
[
d
]
=
PFP
::
VEC3
(
0
,
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];
// }
// SelectorDartNoBoundary<PFP::MAP> nb(myMap);
m_topo_render
->
updateData
(
myMap
,
position
,
0.8
f
,
0.8
f
,
0.8
f
);
...
...
@@ -417,17 +421,17 @@ int main(int argc, char **argv)
color
[
d
]
=
PFP
::
VEC3
(
v
,
0
,
0
);
if
(
v
>
maxV
)
maxV
=
v
;
// if(myMap.isVolumeIncidentToBoundary(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.0
f
-
color
[
i
][
0
];
}
// Algo::Volume::Export::exportNAS<PFP>(myMap,position,"/tmp/test2.nas");
// Algo::Volume::Export::exportMSH<PFP>(myMap,position,"/tmp/test2.msh");
// Algo::Volume::Export::exportTet<PFP>(myMap,position,"/tmp/test2.tet");
// Algo::Volume::Export::exportNodeEle<PFP>(myMap,position,"/tmp/test2");
// Algo::Volume::Export::exportVTU<PFP>(myMap,position,"/tmp/test4.vtu");
}
else
...
...
@@ -502,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
);
...
...
@@ -516,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/Algo/Import/importMRDAT.hpp
View file @
b78a9704
...
...
@@ -196,6 +196,9 @@ bool importMRDAT(typename PFP::MAP& map, const std::string& filename, std::vecto
VertexAutoAttribute
<
NoTypeNameAttribute
<
std
::
vector
<
Dart
>
>
,
typename
PFP
::
MAP
::
IMPL
>
vecDartsPerVertex
(
map
,
"incidents"
)
;
DartMarkerNoUnmark
<
typename
PFP
::
MAP
>
m
(
map
)
;
unsigned
int
vemb
=
EMBNULL
;
auto
fsetemb
=
[
&
]
(
Dart
d
)
{
map
.
template
setDartEmbedding
<
VERTEX
>(
d
,
vemb
);
};
unsigned
nbf
=
qt
.
roots
.
size
()
;
// for each root face
...
...
@@ -206,13 +209,12 @@ bool importMRDAT(typename PFP::MAP& map, const std::string& filename, std::vecto
for
(
unsigned
int
j
=
0
;
j
<
3
;
++
j
)
{
unsigned
int
idx
=
qt
.
roots
[
i
]
->
indices
[
j
]
;
unsigned
int
emb
=
qt
.
verticesID
[
idx
]
;
v
emb
=
qt
.
verticesID
[
idx
]
;
FunctorSetEmb
<
typename
PFP
::
MAP
,
VERTEX
>
fsetemb
(
map
,
emb
)
;
map
.
template
foreach_dart_of_orbit
<
PFP
::
MAP
::
VERTEX_OF_PARENT
>(
d
,
fsetemb
)
;
m
.
mark
(
d
)
;
// mark on the fly to unmark on second loop
vecDartsPerVertex
[
emb
].
push_back
(
d
)
;
// store incident darts for fast adjacency reconstruction
vecDartsPerVertex
[
v
emb
].
push_back
(
d
)
;
// store incident darts for fast adjacency reconstruction
d
=
map
.
phi1
(
d
)
;
}
}
...
...
include/Algo/Multiresolution/Map2MR/Filters/sqrt3.h
View file @
b78a9704
...
...
@@ -133,7 +133,7 @@ public:
p1
*=
1.0
/
3.0
;
p2
*=
1.0
/
3.0
;
if
(
m_map
.
isBoundary
Face
(
d
))
if
(
m_map
.
is
FaceIncidentTo
Boundary
(
d
))
{
Dart
df
=
m_map
.
findBoundaryEdgeOfFace
(
d
);
m_map
.
incCurrentLevel
()
;
...
...
include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.hpp
View file @
b78a9704
...
...
@@ -167,7 +167,7 @@ void Map2MR<PFP>::addNewLevelSqrt3()
for
(
Dart
dit
=
t
.
begin
();
dit
!=
t
.
end
();
dit
=
t
.
next
())
{
//if it is an even level (triadic refinement) and a boundary face
if
((
m_map
.
getCurrentLevel
()
%
2
==
0
)
&&
m_map
.
isBoundary
Face
(
dit
))
if
((
m_map
.
getCurrentLevel
()
%
2
==
0
)
&&
m_map
.
is
FaceIncidentTo
Boundary
(
dit
))
{
//find the boundary edge
Dart
df
=
m_map
.
findBoundaryEdgeOfFace
(
dit
);
...
...
include/Topology/generic/dartmarker.h
View file @
b78a9704
...
...
@@ -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
)
;
}
...
...
include/Topology/map/map3.h
View file @
b78a9704
...
...
@@ -364,7 +364,7 @@ public:
//! Tell if a face of the volume is on the boundary
/* @param d a dart
*/
bool
is
BoundaryAdjacentVolume
(
Dart
d
)
const
;
bool
is
VolumeIncidentToBoundary
(
Dart
d
)
const
;
//! Tell if an edge of the volume is on the boundary
/* @param d a dart
...
...
include/Topology/map/map3.hpp
View file @
b78a9704
...
...
@@ -1024,12 +1024,12 @@ inline bool Map3<MAP_IMPL>::isBoundaryFace(Dart d) const
}
template
<
typename
MAP_IMPL
>
bool
Map3
<
MAP_IMPL
>::
is
BoundaryAdjacentVolume
(
Dart
d
)
const
bool
Map3
<
MAP_IMPL
>::
is
VolumeIncidentToBoundary
(
Dart
d
)
const
{
Traversor3WF
<
Map3
<
MAP_IMPL
>
>
tra
(
*
this
,
d
);
for
(
Dart
dit
=
tra
.
begin
()
;
dit
!=
tra
.
end
()
;
dit
=
tra
.
next
())
{
if
(
isBoundaryMarked
3
(
phi3
(
dit
)))
if
(
this
->
template
isBoundaryMarked
<
3
>
(
phi3
(
dit
)))
return
true
;
}
return
false
;
...
...
include/Utils/colourConverter.h
View file @
b78a9704
...
...
@@ -167,12 +167,12 @@ private: // private members
private:
// private constants
// D65 reference white
static
const
REAL
Xn
=
0.950456
;
static
const
REAL
Yn
=
1.0
;
static
const
REAL
Zn
=
1.088754
;
static
const
expr
REAL
Xn
=
0.950456
;
static
const
expr
REAL
Yn
=
1.0
;
static
const
expr
REAL
Zn
=
1.088754
;
static
const
REAL
un
=
0.197832
;
static
const
REAL
vn
=
0.468340
;
static
const
expr
REAL
un
=
0.197832
;
static
const
expr
REAL
vn
=
0.468340
;
}
;
...
...
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