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
Sauvage
CGoGN
Commits
273fc127
Commit
273fc127
authored
Apr 26, 2012
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
orbit as template -> volumeExplorer OK
parent
70b2a513
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
340 additions
and
382 deletions
+340
-382
Apps/Examples/volumeExplorer.cpp
Apps/Examples/volumeExplorer.cpp
+16
-16
Apps/Examples/volumeExplorer.h
Apps/Examples/volumeExplorer.h
+1
-1
include/Algo/Geometry/volume.h
include/Algo/Geometry/volume.h
+4
-4
include/Algo/Geometry/volume.hpp
include/Algo/Geometry/volume.hpp
+4
-4
include/Algo/ImplicitHierarchicalMesh/ihm.hpp
include/Algo/ImplicitHierarchicalMesh/ihm.hpp
+2
-2
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
+2
-2
include/Algo/Import/importMesh.hpp
include/Algo/Import/importMesh.hpp
+5
-5
include/Algo/Import/importTet.hpp
include/Algo/Import/importTet.hpp
+6
-8
include/Algo/Modelisation/primitives3d.h
include/Algo/Modelisation/primitives3d.h
+12
-11
include/Algo/Modelisation/primitives3d.hpp
include/Algo/Modelisation/primitives3d.hpp
+1
-1
include/Algo/Modelisation/subdivision3.hpp
include/Algo/Modelisation/subdivision3.hpp
+5
-5
include/Algo/Modelisation/tetrahedralization.hpp
include/Algo/Modelisation/tetrahedralization.hpp
+1
-1
include/Algo/Render/GL2/explodeVolumeRender.h
include/Algo/Render/GL2/explodeVolumeRender.h
+4
-6
include/Algo/Render/GL2/explodeVolumeRender.hpp
include/Algo/Render/GL2/explodeVolumeRender.hpp
+20
-41
include/Algo/Render/GL2/topo3Render.h
include/Algo/Render/GL2/topo3Render.h
+13
-15
include/Algo/Render/GL2/topo3Render.hpp
include/Algo/Render/GL2/topo3Render.hpp
+33
-45
include/Topology/generic/attribmap.hpp
include/Topology/generic/attribmap.hpp
+3
-3
include/Topology/generic/autoAttributeHandler.h
include/Topology/generic/autoAttributeHandler.h
+2
-2
include/Topology/generic/cellmarker.h
include/Topology/generic/cellmarker.h
+2
-2
include/Topology/generic/genericmap.h
include/Topology/generic/genericmap.h
+5
-6
include/Topology/generic/genericmap.hpp
include/Topology/generic/genericmap.hpp
+37
-19
include/Topology/generic/traversorCell.hpp
include/Topology/generic/traversorCell.hpp
+1
-1
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
+6
-6
src/Algo/Render/topo3Render.cpp
src/Algo/Render/topo3Render.cpp
+0
-1
src/Topology/generic/genericmap.cpp
src/Topology/generic/genericmap.cpp
+0
-20
src/Topology/gmap/embeddedGMap2.cpp
src/Topology/gmap/embeddedGMap2.cpp
+33
-33
src/Topology/gmap/embeddedGMap3.cpp
src/Topology/gmap/embeddedGMap3.cpp
+29
-29
src/Topology/map/embeddedMap2.cpp
src/Topology/map/embeddedMap2.cpp
+39
-39
src/Topology/map/embeddedMap3.cpp
src/Topology/map/embeddedMap3.cpp
+35
-35
src/Topology/map/map3MR/map3MR_PrimalAdapt.cpp
src/Topology/map/map3MR/map3MR_PrimalAdapt.cpp
+7
-7
src/Topology/map/map3MR/map3MR_PrimalRegular.cpp
src/Topology/map/map3MR/map3MR_PrimalRegular.cpp
+12
-12
No files found.
Apps/Examples/volumeExplorer.cpp
View file @
273fc127
...
...
@@ -33,8 +33,8 @@
PFP
::
MAP
myMap
;
PFP
::
TVEC3
position
;
PFP
::
TVEC3
color
;
AttributeHandler
<
PFP
::
VEC3
,
VERTEX
>
position
;
AttributeHandler
<
PFP
::
VEC3
,
VOLUME
>
color
;
void
MyQT
::
volumes_onoff
(
bool
x
)
{
...
...
@@ -139,7 +139,7 @@ void MyQT::cb_initGL()
SelectorDartNoBoundary
<
PFP
::
MAP
>
nb
(
myMap
);
m_topo_render
->
updateData
<
PFP
>
(
myMap
,
position
,
0.8
f
,
0.8
f
,
0.8
f
,
nb
);
m_explode_render
->
updateData
<
PFP
>
(
myMap
,
position
,
color
);
m_explode_render
->
updateData
<
PFP
>
(
myMap
,
position
,
color
);
m_explode_render
->
setExplodeVolumes
(
0.8
f
);
m_explode_render
->
setExplodeFaces
(
0.9
f
);
m_explode_render
->
setAmbiant
(
Geom
::
Vec4f
(
0.2
f
,
0.2
f
,
0.2
f
,
1.0
f
));
...
...
@@ -316,7 +316,7 @@ int main(int argc, char **argv)
return
1
;
}
else
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
}
if
(
extension
==
std
::
string
(
".off"
))
...
...
@@ -328,39 +328,39 @@ int main(int argc, char **argv)
}
else
{
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
myMap
.
closeMap
();
}
}
color
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VOLUME
,
"color"
);
color
=
myMap
.
addAttribute
<
PFP
::
VEC3
,
VOLUME
>
(
"color"
);
TraversorCell
<
PFP
::
MAP
>
tra
(
myMap
,
VOLUME
);
float
maxV
=
0.0
f
;
for
(
Dart
d
=
tra
.
begin
();
d
!=
tra
.
end
();
d
=
tra
.
next
())
TraversorCell
<
PFP
::
MAP
,
VOLUME
>
tra
(
myMap
);
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
);
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
))
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
];
color
[
i
][
2
]
=
1.0
f
-
color
[
i
][
0
];
}
}
else
{
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
"position"
);
Algo
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
myMap
,
position
);
int
nb
=
8
;
prim
.
hexaGrid_topo
(
nb
,
nb
,
nb
);
prim
.
embedHexaGrid
(
1.0
f
,
1.0
f
,
1.0
f
);
color
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VOLUME
,
"color"
);
Traversor
Cell
<
PFP
::
MAP
>
tra
(
myMap
,
VOLUME
);
for
(
Dart
d
=
tra
.
begin
();
d
!=
tra
.
end
();
d
=
tra
.
next
())
color
=
myMap
.
addAttribute
<
PFP
::
VEC3
,
VOLUME
>
(
"color"
);
Traversor
W
<
PFP
::
MAP
>
tra
(
myMap
);
for
(
Dart
d
=
tra
.
begin
();
d
!=
tra
.
end
();
d
=
tra
.
next
())
color
[
d
]
=
position
[
d
]
+
PFP
::
VEC3
(
0.5
,
0.5
,
0.5
);
}
// un peu d'interface
...
...
Apps/Examples/volumeExplorer.h
View file @
273fc127
...
...
@@ -97,11 +97,11 @@ class MyQT: public Utils::QT::SimpleQT
int
m_begY
;
int
clip_id1
;
int
clip_id2
;
public:
float
m_WidthObj
;
Geom
::
Vec3f
m_PosObj
;
public:
MyQT
()
:
render_volumes
(
true
),
...
...
include/Algo/Geometry/volume.h
View file @
273fc127
...
...
@@ -37,16 +37,16 @@ namespace Geometry
{
template
<
typename
PFP
>
typename
PFP
::
REAL
tetrahedronSignedVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
position
)
;
typename
PFP
::
REAL
tetrahedronSignedVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>
&
position
)
;
template
<
typename
PFP
>
typename
PFP
::
REAL
tetrahedronVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
position
)
;
typename
PFP
::
REAL
tetrahedronVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>
&
position
)
;
template
<
typename
PFP
>
typename
PFP
::
REAL
convexPolyhedronVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
position
)
;
typename
PFP
::
REAL
convexPolyhedronVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>
&
position
)
;
template
<
typename
PFP
>
typename
PFP
::
REAL
totalVolume
(
typename
PFP
::
MAP
&
map
,
const
typename
PFP
::
TVEC3
&
position
,
const
FunctorSelect
&
select
=
allDarts
)
;
typename
PFP
::
REAL
totalVolume
(
typename
PFP
::
MAP
&
map
,
const
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>
&
position
,
const
FunctorSelect
&
select
=
allDarts
)
;
}
// namespace Geometry
...
...
include/Algo/Geometry/volume.hpp
View file @
273fc127
...
...
@@ -36,7 +36,7 @@ namespace Geometry
{
template
<
typename
PFP
>
typename
PFP
::
REAL
tetrahedronSignedVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
position
)
typename
PFP
::
REAL
tetrahedronSignedVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>
&
position
)
{
typename
PFP
::
VEC3
p1
=
position
[
d
]
;
typename
PFP
::
VEC3
p2
=
position
[
map
.
phi1
(
d
)]
;
...
...
@@ -47,7 +47,7 @@ typename PFP::REAL tetrahedronSignedVolume(typename PFP::MAP& map, Dart d, const
}
template
<
typename
PFP
>
typename
PFP
::
REAL
tetrahedronVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
position
)
typename
PFP
::
REAL
tetrahedronVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>
&
position
)
{
typename
PFP
::
VEC3
p1
=
position
[
d
]
;
typename
PFP
::
VEC3
p2
=
position
[
map
.
phi1
(
d
)]
;
...
...
@@ -58,7 +58,7 @@ typename PFP::REAL tetrahedronVolume(typename PFP::MAP& map, Dart d, const typen
}
template
<
typename
PFP
>
typename
PFP
::
REAL
convexPolyhedronVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
position
)
typename
PFP
::
REAL
convexPolyhedronVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>
&
position
)
{
typedef
typename
PFP
::
VEC3
VEC3
;
...
...
@@ -115,7 +115,7 @@ typename PFP::REAL convexPolyhedronVolume(typename PFP::MAP& map, Dart d, const
}
template
<
typename
PFP
>
float
totalVolume
(
typename
PFP
::
MAP
&
map
,
const
typename
PFP
::
TVEC3
&
position
,
const
FunctorSelect
&
select
)
float
totalVolume
(
typename
PFP
::
MAP
&
map
,
const
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>
&
position
,
const
FunctorSelect
&
select
)
{
typename
PFP
::
REAL
vol
=
0
;
TraversorW
<
typename
PFP
::
MAP
>
t
(
map
,
select
)
;
...
...
include/Algo/ImplicitHierarchicalMesh/ihm.hpp
View file @
273fc127
...
...
@@ -39,7 +39,7 @@ template <typename T, unsigned int ORBIT>
AttributeHandler_IHM
<
T
,
ORBIT
>
ImplicitHierarchicalMap
::
addAttribute
(
const
std
::
string
&
nameAttr
)
{
bool
addNextLevelCell
=
false
;
if
(
!
isOrbitEmbedded
(
ORBIT
))
if
(
!
isOrbitEmbedded
<
ORBIT
>
(
))
addNextLevelCell
=
true
;
AttributeHandler
<
T
,
ORBIT
>
h
=
Map2
::
addAttribute
<
T
,
ORBIT
>
(
nameAttr
)
;
...
...
@@ -254,7 +254,7 @@ inline bool ImplicitHierarchicalMap::foreach_dart_of_cc(Dart d, FunctorType& f,
inline
void
ImplicitHierarchicalMap
::
splitFace
(
Dart
d
,
Dart
e
)
{
EmbeddedMap2
::
splitFace
(
d
,
e
)
;
if
(
isOrbitEmbedded
(
FACE
))
if
(
isOrbitEmbedded
<
FACE
>
(
))
{
unsigned
int
cur
=
m_curLevel
;
m_curLevel
=
m_maxLevel
;
...
...
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
View file @
273fc127
...
...
@@ -32,14 +32,14 @@ namespace IHM
{
/***************************************************
*
ATTRIBUTES MANAGEMENT *
* ATTRIBUTES MANAGEMENT *
***************************************************/
template
<
typename
T
,
unsigned
int
ORBIT
>
AttributeHandler_IHM
<
T
,
ORBIT
>
ImplicitHierarchicalMap3
::
addAttribute
(
const
std
::
string
&
nameAttr
)
{
bool
addNextLevelCell
=
false
;
if
(
!
isOrbitEmbedded
(
ORBIT
))
if
(
!
isOrbitEmbedded
<
ORBIT
>
(
))
addNextLevelCell
=
true
;
AttributeHandler
<
T
,
ORBIT
>
h
=
Map3
::
addAttribute
<
T
,
ORBIT
>
(
nameAttr
)
;
...
...
include/Algo/Import/importMesh.hpp
View file @
273fc127
...
...
@@ -179,21 +179,21 @@ bool importMeshSToV(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts, float d
if
(
backEdgesBuffer
[
em
]
==
EMBNULL
)
{
unsigned
int
emn
=
map
.
template
newCell
<
VERTEX
>();
map
.
copyCell
<
VERTEX
>
(
emn
,
em
);
map
.
template
copyCell
<
VERTEX
>(
emn
,
em
);
backEdgesBuffer
[
em
]
=
emn
;
position
[
emn
]
+=
typename
PFP
::
VEC3
(
0
,
0
,
dist
);
}
FunctorSetEmb
<
typename
PFP
::
MAP
,
VERTEX
>
fsetemb
(
map
,
em
);
//foreach_dart_of_orbit_in_parent<typename PFP::MAP>(&map, VERTEX, d, fsetemb) ;
map
.
foreach_dart_of_orbit
<
VERTEX
+
PFP
::
MAP
::
IN_PARENT
>
(
d
,
fsetemb
);
map
.
template
foreach_dart_of_orbit
<
VERTEX
+
PFP
::
MAP
::
IN_PARENT
>(
d
,
fsetemb
);
//Embed the other base face
Dart
d2
=
map
.
phi1
(
map
.
phi1
(
map
.
phi2
(
d
)));
unsigned
int
em2
=
backEdgesBuffer
[
em
];
FunctorSetEmb
<
typename
PFP
::
MAP
,
VERTEX
>
fsetemb2
(
map
,
em2
);
//foreach_dart_of_orbit_in_parent<typename PFP::MAP>(&map, VERTEX, d2, fsetemb2) ;
map
.
foreach_dart_of_orbit
<
VERTEX
+
PFP
::
MAP
::
IN_PARENT
>
(
d2
,
fsetemb2
);
map
.
template
foreach_dart_of_orbit
<
VERTEX
+
PFP
::
MAP
::
IN_PARENT
>(
d2
,
fsetemb2
);
m
.
mark
(
d
)
;
// mark on the fly to unmark on second loop
vecDartsPerVertex
[
em
].
push_back
(
d
);
// store incident darts for fast adjacency reconstruction
...
...
@@ -212,11 +212,11 @@ bool importMeshSToV(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts, float d
// darts incident to end vertex of edge
std
::
vector
<
Dart
>&
vec
=
vecDartsPerVertex
[
map
.
phi1
(
d
)];
unsigned
int
embd
=
map
.
getEmbedding
<
VERTEX
>
(
d
);
unsigned
int
embd
=
map
.
template
getEmbedding
<
VERTEX
>(
d
);
Dart
good_dart
=
NIL
;
for
(
typename
std
::
vector
<
Dart
>::
iterator
it
=
vec
.
begin
();
it
!=
vec
.
end
()
&&
good_dart
==
NIL
;
++
it
)
{
if
(
map
.
getEmbedding
<
VERTEX
>
(
map
.
phi1
(
*
it
))
==
embd
)
if
(
map
.
template
getEmbedding
<
VERTEX
>(
map
.
phi1
(
*
it
))
==
embd
)
good_dart
=
*
it
;
}
...
...
include/Algo/Import/importTet.hpp
View file @
273fc127
...
...
@@ -129,8 +129,7 @@ bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector<
for
(
unsigned
int
j
=
0
;
j
<
3
;
++
j
)
{
FunctorSetEmb
<
typename
PFP
::
MAP
,
VERTEX
>
fsetemb
(
map
,
verticesID
[
pt
[
2
-
j
]]);
map
.
foreach_dart_of_orbit
<
VERTEX
+
PFP
::
MAP
::
IN_PARENT
>
(
d
,
fsetemb
);
map
.
template
foreach_dart_of_orbit
<
VERTEX
+
PFP
::
MAP
::
IN_PARENT
>(
d
,
fsetemb
);
//store darts per vertices to optimize reconstruction
Dart
dd
=
d
;
...
...
@@ -148,8 +147,7 @@ bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector<
d
=
map
.
phi_1
(
map
.
phi2
(
d
));
FunctorSetEmb
<
typename
PFP
::
MAP
,
VERTEX
>
fsetemb
(
map
,
verticesID
[
pt
[
3
]]);
map
.
foreach_dart_of_orbit
<
VERTEX
+
PFP
::
MAP
::
IN_PARENT
>
(
d
,
fsetemb
);
map
.
template
foreach_dart_of_orbit
<
VERTEX
+
PFP
::
MAP
::
IN_PARENT
>(
d
,
fsetemb
);
//store darts per vertices to optimize reconstruction
Dart
dd
=
d
;
...
...
@@ -174,9 +172,9 @@ bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector<
Dart
good_dart
=
NIL
;
for
(
typename
std
::
vector
<
Dart
>::
iterator
it
=
vec
.
begin
();
it
!=
vec
.
end
()
&&
good_dart
==
NIL
;
++
it
)
{
if
(
map
.
getEmbedding
<
VERTEX
>
(
map
.
phi1
(
*
it
))
==
map
.
getEmbedding
<
VERTEX
>
(
d
)
&&
map
.
getEmbedding
<
VERTEX
>
(
map
.
phi_1
(
*
it
))
==
map
.
getEmbedding
<
VERTEX
>
(
map
.
phi_1
(
d
))
/*&&
map.
getEmbedding<VERTEX>(*it) == map.
getEmbedding<VERTEX>(map.phi1(d)) */
)
if
(
map
.
template
getEmbedding
<
VERTEX
>(
map
.
phi1
(
*
it
))
==
map
.
template
getEmbedding
<
VERTEX
>(
d
)
&&
map
.
template
getEmbedding
<
VERTEX
>(
map
.
phi_1
(
*
it
))
==
map
.
template
getEmbedding
<
VERTEX
>(
map
.
phi_1
(
d
))
/*&&
map.
template getEmbedding<VERTEX>(*it) == map.template
getEmbedding<VERTEX>(map.phi1(d)) */
)
{
good_dart
=
*
it
;
}
...
...
@@ -185,7 +183,7 @@ bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector<
if
(
good_dart
!=
NIL
)
{
map
.
sewVolumes
(
d
,
good_dart
,
false
);
m
.
unmarkOrbit
<
FACE
>
(
d
);
m
.
template
unmarkOrbit
<
FACE
>(
d
);
}
else
{
...
...
include/Algo/Modelisation/primitives3d.h
View file @
273fc127
...
...
@@ -51,10 +51,10 @@ template <typename PFP>
class
Primitive3D
{
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
VEC3
EMB
;
typedef
typename
PFP
::
VEC3
VEC3
;
public:
enum
{
NONE
,
HEXAGRID
};
enum
{
NONE
,
HEXAGRID
};
protected:
/**
...
...
@@ -62,8 +62,8 @@ protected:
*/
MAP
&
m_map
;
AttributeHandler
<
VEC3
,
VERTEX
>&
m_positions
;
typename
PFP
::
TVEC3
&
m_positions
;
/**
* Reference dart of primitive
*/
...
...
@@ -110,21 +110,22 @@ public:
* Constructor
* @param map the map in which we want to work
*/
Primitive3D
(
MAP
&
map
,
typename
PFP
::
TVEC3
&
position
)
:
m_map
(
map
),
m_positions
(
position
),
m_kind
(
NONE
),
m_nx
(
-
1
),
m_ny
(
-
1
),
m_nz
(
-
1
)
{}
Primitive3D
(
MAP
&
map
,
AttributeHandler
<
VEC3
,
VERTEX
>&
position
)
:
m_map
(
map
),
m_positions
(
position
),
m_kind
(
NONE
),
m_nx
(
-
1
),
m_ny
(
-
1
),
m_nz
(
-
1
)
{}
/**
* get the table of darts (one per vertex)
*/
const
std
::
vector
<
Dart
>&
getVertexDarts
()
{
return
m_tableVertDarts
;}
const
std
::
vector
<
Dart
>&
getVertexDarts
()
{
return
m_tableVertDarts
;
}
/*
* get the reference dart
*/
Dart
getDart
()
{
return
m_dart
;}
Dart
getDart
()
{
return
m_dart
;
}
/**
* transform the primitive with transformation matrice
...
...
@@ -182,6 +183,6 @@ public:
}
// namespace CGoGN
#include "primitives3d.hpp"
#include "
Algo/Modelisation/
primitives3d.hpp"
#endif
include/Algo/Modelisation/primitives3d.hpp
View file @
273fc127
...
...
@@ -206,7 +206,7 @@ void Primitive3D<PFP>::embedHexaGrid(float x, float y, float z)
typename
PFP
::
VEC3
pos
(
-
x
/
2.0
f
+
dx
*
float
(
k
),
-
y
/
2.0
f
+
dy
*
float
(
j
),
-
z
/
2.0
f
+
dz
*
float
(
i
));
Dart
d
=
m_tableVertDarts
[
i
*
nbs
+
j
*
(
m_nx
+
1
)
+
k
];
m_map
.
embedNewCell
<
VERTEX
>
(
d
);
m_map
.
template
embedNewCell
<
VERTEX
>(
d
);
m_positions
[
d
]
=
pos
;
}
}
...
...
include/Algo/Modelisation/subdivision3.hpp
View file @
273fc127
...
...
@@ -382,14 +382,14 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
Dart
dit2
=
vd2
[
i
];
// embed the vertex embedded from the origin volume to the new darts
if
(
map
.
isOrbitEmbedded
(
VERTEX
))
if
(
map
.
isOrbitEmbedded
<
VERTEX
>
(
))
{
map
.
copyDartEmbedding
<
VERTEX
>
(
map
.
phi2
(
dit
),
map
.
phi1
(
dit
));
map
.
copyDartEmbedding
<
VERTEX
>
(
map
.
phi2
(
dit2
),
map
.
phi1
(
dit2
));
}
// embed the edge embedded from the origin volume to the new darts
if
(
map
.
isOrbitEmbedded
(
EDGE
))
if
(
map
.
isOrbitEmbedded
<
EDGE
>
(
))
{
unsigned
int
eEmb
=
map
.
getEmbedding
<
EDGE
>
(
dit
)
;
map
.
setDartEmbedding
<
EDGE
>
(
map
.
phi2
(
dit
),
eEmb
);
...
...
@@ -397,7 +397,7 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
}
// embed the volume embedded from the origin volume to the new darts
if
(
map
.
isOrbitEmbedded
(
VOLUME
))
if
(
map
.
isOrbitEmbedded
<
VOLUME
>
(
))
{
map
.
copyDartEmbedding
<
VOLUME
>
(
map
.
phi2
(
dit
),
dit
);
map
.
copyDartEmbedding
<
VOLUME
>
(
map
.
phi2
(
dit2
),
dit2
);
...
...
@@ -412,7 +412,7 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
Dart
next
=
map
.
phi1
(
map
.
phi1
(
dd
))
;
map
.
PFP
::
MAP
::
ParentMap
::
splitFace
(
dd
,
next
);
if
(
map
.
isOrbitEmbedded
(
VERTEX
))
if
(
map
.
isOrbitEmbedded
<
VERTEX
>
(
))
{
map
.
copyDartEmbedding
<
VERTEX
>
(
map
.
phi_1
(
next
),
dd
)
;
map
.
copyDartEmbedding
<
VERTEX
>
(
map
.
phi_1
(
dd
),
next
)
;
...
...
@@ -428,7 +428,7 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
// Dart tmp = map.phi1(ne) ;
// map.PFP::MAP::ParentMap::splitFace(tmp, dd);
//
// if (map.isOrbitEmbedded
(VERTEX
))
// if (map.isOrbitEmbedded
<VERTEX>(
))
// {
// map.copyDartEmbedding<VERTEX>(map.phi_1(dd), tmp) ;
// map.copyDartEmbedding<VERTEX>(map.phi_1(tmp), dd) ;
...
...
include/Algo/Modelisation/tetrahedralization.hpp
View file @
273fc127
...
...
@@ -110,7 +110,7 @@ void unlinkFromEdge(typename PFP::MAP& map, Dart d)
{
Dart
d3
=
map
.
phi3
(
d
);
// if(map.isOrbitEmbedded
(VERTEX
))
// if(map.isOrbitEmbedded
<VERTEX>(
))
// {
// //Si la face n'est pas libre en phi2
// if(map.phi2(d) != d && map.phi2(d3) != d3)
...
...
include/Algo/Render/GL2/explodeVolumeRender.h
View file @
273fc127
...
...
@@ -77,15 +77,13 @@ protected:
Geom
::
Vec3f
m_globalColor
;
public:
/**
* Constructor
* @param withColorPerFace affect a color per face
* @param withExplodeFace shrinj each face
*/
ExplodeVolumeRender
(
bool
withColorPerFace
=
false
,
bool
withExplodeFace
=
false
)
;
ExplodeVolumeRender
(
bool
withColorPerFace
=
false
,
bool
withExplodeFace
=
false
)
;
/**
* Destructor
...
...
@@ -109,17 +107,17 @@ public:
* @param good selector
*/
template
<
typename
PFP
>
void
updateData
(
typename
PFP
::
MAP
&
map
,
typename
PFP
::
TVEC3
&
positions
,
const
FunctorSelect
&
good
=
allDarts
)
;
void
updateData
(
typename
PFP
::
MAP
&
map
,
const
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>
&
positions
,
const
FunctorSelect
&
good
=
allDarts
)
;
/**
* update all drawing buffers
* @param map the map
* @param positions
attribute of position vertices
* @param positions attribute of position vertices
* @param colorPerFace attribute of color (per face)
* @param good selector
*/
template
<
typename
PFP
>
void
updateData
(
typename
PFP
::
MAP
&
map
,
typename
PFP
::
TVEC3
&
positions
,
typename
PFP
::
TVEC3
&
colorPerFace
,
const
FunctorSelect
&
good
=
allDarts
)
;
void
updateData
(
typename
PFP
::
MAP
&
map
,
const
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>&
positions
,
const
AttributeHandler
<
typename
PFP
::
VEC3
,
VOLUME
>
&
colorPerFace
,
const
FunctorSelect
&
good
=
allDarts
)
;
/**
* draw edges
...
...
include/Algo/Render/GL2/explodeVolumeRender.hpp
View file @
273fc127
...
...
@@ -76,7 +76,7 @@ inline ExplodeVolumeRender::~ExplodeVolumeRender()
}
template
<
typename
PFP
>
void
ExplodeVolumeRender
::
updateData
(
typename
PFP
::
MAP
&
map
,
typename
PFP
::
TVEC3
&
positions
,
const
FunctorSelect
&
good
)
void
ExplodeVolumeRender
::
updateData
(
typename
PFP
::
MAP
&
map
,
const
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>
&
positions
,
const
FunctorSelect
&
good
)
{
if
(
m_cpf
)
{
...
...
@@ -87,25 +87,19 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, typename PFP::TVEC3
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
CellMarker
cmv
(
map
,
VOLUME
);
AutoAttributeHandler
<
VEC3
>
centerVolumes
(
map
,
VOLUME
,
"centerVolumes"
);
TraversorW
<
typename
PFP
::
MAP
>
traVol
(
map
,
good
);
for
(
Dart
d
=
traVol
.
begin
();
d
!=
traVol
.
end
();
d
=
traVol
.
next
())
{
centerVolumes
[
d
]
=
Algo
::
Geometry
::
volumeCentroid
<
PFP
>
(
map
,
d
,
positions
);
}
AutoAttributeHandler
<
VEC3
,
VOLUME
>
centerVolumes
(
map
,
"centerVolumes"
);
Algo
::
Geometry
::
computeCentroidVolumes
<
PFP
>
(
map
,
positions
,
centerVolumes
,
good
);
std
::
vector
<
VEC3
>
buffer
;
buffer
.
reserve
(
16384
);
TraversorCell
<
typename
PFP
::
MAP
,
FACE
+
PFP
::
MAP
::
IN_PARENT
>
traFace
(
map
,
good
);
TraversorCell
<
typename
PFP
::
MAP
>
traFace
(
map
,
PFP
::
MAP
::
ORBIT_IN_PARENT
(
FACE
),
good
);
for
(
Dart
d
=
traFace
.
begin
();
d
!=
traFace
.
end
();
d
=
traFace
.
next
())
for
(
Dart
d
=
traFace
.
begin
();
d
!=
traFace
.
end
();
d
=
traFace
.
next
())
{
if
(
m_ef
)
{
VEC3
centerFace
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
map
,
d
,
positions
);
VEC3
centerFace
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
map
,
d
,
positions
);
Dart
a
=
d
;
Dart
b
=
map
.
phi1
(
a
);
Dart
c
=
map
.
phi1
(
b
);
...
...
@@ -154,12 +148,12 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, typename PFP::TVEC3
buffer
.
clear
();
TraversorCell
<
typename
PFP
::
MAP
>
traEdge
(
map
,
PFP
::
MAP
::
ORBIT_IN_PARENT
(
EDGE
),
good
);
for
(
Dart
d
=
traEdge
.
begin
();
d
!=
traEdge
.
end
();
d
=
traEdge
.
next
())
TraversorCell
<
typename
PFP
::
MAP
,
EDGE
+
PFP
::
MAP
::
IN_PARENT
>
traEdge
(
map
,
good
);
for
(
Dart
d
=
traEdge
.
begin
();
d
!=
traEdge
.
end
();
d
=
traEdge
.
next
())
{
buffer
.
push_back
(
centerVolumes
[
d
]);
buffer
.
push_back
(
positions
[
d
]);
buffer
.
push_back
(
positions
[
map
.
phi1
(
d
)]);
buffer
.
push_back
(
centerVolumes
[
d
]);
buffer
.
push_back
(
positions
[
d
]);
buffer
.
push_back
(
positions
[
map
.
phi1
(
d
)]);
}
m_nbLines
=
buffer
.
size
()
/
3
;
...
...
@@ -173,9 +167,8 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, typename PFP::TVEC3
m_shaderL
->
setAttributePosition
(
m_vboPosLine
);
}
template
<
typename
PFP
>
void
ExplodeVolumeRender
::
updateData
(
typename
PFP
::
MAP
&
map
,
typename
PFP
::
TVEC3
&
positions
,
typename
PFP
::
TVEC3
&
colorPerXXX
,
const
FunctorSelect
&
good
)
void
ExplodeVolumeRender
::
updateData
(
typename
PFP
::
MAP
&
map
,
const
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>&
positions
,
const
AttributeHandler
<
typename
PFP
::
VEC3
,
VOLUME
>
&
colorPerXXX
,
const
FunctorSelect
&
good
)
{
if
(
!
m_cpf
)
{
...
...
@@ -186,13 +179,8 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, typename PFP::TVEC3
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
CellMarker
cmv
(
map
,
VOLUME
);
AutoAttributeHandler
<
VEC3
>
centerVolumes
(
map
,
VOLUME
,
"centerVolumes"
);
TraversorW
<
typename
PFP
::
MAP
>
traVol
(
map
,
good
);
for
(
Dart
d
=
traVol
.
begin
();
d
!=
traVol
.
end
();
d
=
traVol
.
next
())
{
centerVolumes
[
d
]
=
Algo
::
Geometry
::
volumeCentroid
<
PFP
>
(
map
,
d
,
positions
);
}
AutoAttributeHandler
<
VEC3
,
VOLUME
>
centerVolumes
(
map
,
"centerVolumes"
);
Algo
::
Geometry
::
computeCentroidVolumes
<
PFP
>
(
map
,
positions
,
centerVolumes
,
good
);
std
::
vector
<
VEC3
>
buffer
;
buffer
.
reserve
(
16384
);
...
...
@@ -204,12 +192,11 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, typename PFP::TVEC3
if
(
withColors
)
bufferColors
.
reserve
(
16384
);
TraversorCell
<
typename
PFP
::
MAP
,
FACE
+
PFP
::
MAP
::
IN_PARENT
>
traFace
(
map
,
good
);
TraversorCell
<
typename
PFP
::
MAP
>
traFace
(
map
,
PFP
::
MAP
::
ORBIT_IN_PARENT
(
FACE
),
good
);
for
(
Dart
d
=
traFace
.
begin
();
d
!=
traFace
.
end
();
d
=
traFace
.
next
())
for
(
Dart
d
=
traFace
.
begin
();
d
!=
traFace
.
end
();
d
=
traFace
.
next
())
{
VEC3
centerFace
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
map
,
d
,
positions
);
VEC3
centerFace
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
map
,
d
,
positions
);
Dart
a
=
d
;
Dart
b
=
map
.
phi1
(
a
);
...
...
@@ -260,12 +247,12 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, typename PFP::TVEC3
buffer
.
clear
();
TraversorCell
<
typename
PFP
::
MAP
>
traEdge
(
map
,
PFP
::
MAP
::
ORBIT_IN_PARENT
(
EDGE
),
good
);
for
(
Dart
d
=
traEdge
.
begin
();
d
!=
traEdge
.
end
();
d
=
traEdge
.
next
())
TraversorCell
<
typename
PFP
::
MAP
,
EDGE
+
PFP
::
MAP
::
IN_PARENT
>
traEdge
(
map
,
good
);
for
(
Dart
d
=
traEdge
.
begin
();
d
!=
traEdge
.
end
();
d
=
traEdge
.
next
())
{
buffer
.
push_back
(
centerVolumes
[
d
]);
buffer
.
push_back
(
positions
[
d
]);
buffer
.
push_back
(
positions
[
map
.
phi1
(
d
)]);
buffer
.
push_back
(
positions
[
map
.
phi1
(
d
)]);
}
m_nbLines
=
buffer
.
size
()
/
3
;
...
...
@@ -277,11 +264,8 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, typename PFP::TVEC3
m_vboPosLine
->
releasePtr
();
m_shaderL
->
setAttributePosition
(
m_vboPosLine
);
}
inline
void
ExplodeVolumeRender
::
drawFaces
()
{
m_shader
->
enableVertexAttribs
();
...
...
@@ -292,7 +276,6 @@ inline void ExplodeVolumeRender::drawFaces()
m_shader
->
disableVertexAttribs
();
}
inline
void
ExplodeVolumeRender
::
drawEdges
()
{
...
...
@@ -301,7 +284,6 @@ inline void ExplodeVolumeRender::drawEdges()
m_shaderL
->
disableVertexAttribs
();
}
inline
void
ExplodeVolumeRender
::
setExplodeVolumes
(
float
explode
)
{