Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CGoGN
CGoGN
Commits
c1269877
Commit
c1269877
authored
Apr 27, 2011
by
Pierre Kraemer
Browse files
Merge branch 'master' of cgogn:~cgogn/CGoGN
parents
ad03bdaf
dfe12705
Changes
27
Expand all
Hide whitespace changes
Inline
Side-by-side
Apps/Examples/miniTest.cpp
View file @
c1269877
...
...
@@ -717,6 +717,11 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
Algo
::
Export
::
exportOFF
<
PFP
>
(
myMap
,
position
,
"export.off"
)
;
break
;
}
case
'n'
:
{
myMap
.
saveMapBin
(
"plop"
);
}
}
}
...
...
Apps/Tuto/tuto4.cpp
View file @
c1269877
...
...
@@ -60,7 +60,7 @@ AttributeHandler<Geom::Vec4f> color ;
void
MyQT
::
cb_initGL
()
{
// choose to use GL version 2
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
3
);
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
// create the render
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
();
...
...
Apps/Tuto/tuto5.cpp
View file @
c1269877
...
...
@@ -264,7 +264,7 @@ int main(int argc, char **argv)
sqt
.
setDock
(
&
dock
);
// message d'aide
sqt
.
setHelpMsg
(
""
);
sqt
.
setHelpMsg
(
"
Enter pour dock on/off
\n
Shift Enter pour console on/off
\n
Shift Click gauche pour selectionner un brin
"
);
CGoGNout
.
toStatusBar
(
&
sqt
);
CGoGNout
<<
"CGoGNOut StatusBar"
<<
Geom
::
Vec3f
(
2.5
,
2.2
,
4.3
)
<<
CGoGNendl
;
...
...
include/Algo/Export/exportPov.h
View file @
c1269877
...
...
@@ -2,6 +2,7 @@
#define EXPORT_POV
#include
"Topology/generic/attributeHandler.h"
#include
"Utils/cgognStream.h"
namespace
CGoGN
{
...
...
@@ -15,33 +16,33 @@ namespace ExportPov
template
<
typename
PFP
>
void
exportTriangleWire
(
std
::
ofstream
&
out
,
typename
PFP
::
VEC3
&
p1
,
typename
PFP
::
VEC3
&
p2
,
typename
PFP
::
VEC3
&
p3
)
{
out
<<
"cylinder {"
<<
CGoGNendl
;
out
<<
"<"
<<
p1
[
0
]
<<
","
<<
p1
[
1
]
<<
","
<<
p1
[
2
]
<<
">, <"
<<
p2
[
0
]
<<
","
<<
p2
[
1
]
<<
","
<<
p2
[
2
]
<<
">, 0.5"
<<
CGoGNendl
;
out
<<
"}"
<<
CGoGNendl
;
CGoGN
out
<<
"cylinder {"
<<
CGoGNendl
;
CGoGN
out
<<
"<"
<<
p1
[
0
]
<<
","
<<
p1
[
1
]
<<
","
<<
p1
[
2
]
<<
">, <"
<<
p2
[
0
]
<<
","
<<
p2
[
1
]
<<
","
<<
p2
[
2
]
<<
">, 0.5"
<<
CGoGNendl
;
CGoGN
out
<<
"}"
<<
CGoGNendl
;
out
<<
"cylinder {"
<<
CGoGNendl
;
out
<<
"<"
<<
p1
[
0
]
<<
","
<<
p1
[
1
]
<<
","
<<
p1
[
2
]
<<
">, <"
<<
p3
[
0
]
<<
","
<<
p3
[
1
]
<<
","
<<
p3
[
2
]
<<
">, 0.5"
<<
CGoGNendl
;
out
<<
"}"
<<
CGoGNendl
;
CGoGN
out
<<
"cylinder {"
<<
CGoGNendl
;
CGoGN
out
<<
"<"
<<
p1
[
0
]
<<
","
<<
p1
[
1
]
<<
","
<<
p1
[
2
]
<<
">, <"
<<
p3
[
0
]
<<
","
<<
p3
[
1
]
<<
","
<<
p3
[
2
]
<<
">, 0.5"
<<
CGoGNendl
;
CGoGN
out
<<
"}"
<<
CGoGNendl
;
out
<<
"cylinder {"
<<
CGoGNendl
;
out
<<
"<"
<<
p3
[
0
]
<<
","
<<
p3
[
1
]
<<
","
<<
p3
[
2
]
<<
">, <"
<<
p2
[
0
]
<<
","
<<
p2
[
1
]
<<
","
<<
p2
[
2
]
<<
">, 0.5"
<<
CGoGNendl
;
out
<<
"}"
<<
CGoGNendl
;
CGoGN
out
<<
"cylinder {"
<<
CGoGNendl
;
CGoGN
out
<<
"<"
<<
p3
[
0
]
<<
","
<<
p3
[
1
]
<<
","
<<
p3
[
2
]
<<
">, <"
<<
p2
[
0
]
<<
","
<<
p2
[
1
]
<<
","
<<
p2
[
2
]
<<
">, 0.5"
<<
CGoGNendl
;
CGoGN
out
<<
"}"
<<
CGoGNendl
;
}
template
<
typename
PFP
>
void
exportTrianglePlain
(
std
::
ofstream
&
out
,
typename
PFP
::
VEC3
&
p1
,
typename
PFP
::
VEC3
&
p2
,
typename
PFP
::
VEC3
&
p3
)
{
out
<<
"triangle {"
<<
CGoGNendl
;
out
<<
"<"
<<
p1
[
0
]
<<
","
<<
p1
[
1
]
<<
","
<<
p1
[
2
]
<<
">,"
<<
CGoGNendl
;
out
<<
"<"
<<
p2
[
0
]
<<
","
<<
p2
[
1
]
<<
","
<<
p2
[
2
]
<<
">, "
<<
CGoGNendl
;
out
<<
"<"
<<
p3
[
0
]
<<
","
<<
p3
[
1
]
<<
","
<<
p3
[
2
]
<<
"> "
<<
CGoGNendl
;
out
<<
"}"
<<
CGoGNendl
;
CGoGN
out
<<
"triangle {"
<<
CGoGNendl
;
CGoGN
out
<<
"<"
<<
p1
[
0
]
<<
","
<<
p1
[
1
]
<<
","
<<
p1
[
2
]
<<
">,"
<<
CGoGNendl
;
CGoGN
out
<<
"<"
<<
p2
[
0
]
<<
","
<<
p2
[
1
]
<<
","
<<
p2
[
2
]
<<
">, "
<<
CGoGNendl
;
CGoGN
out
<<
"<"
<<
p3
[
0
]
<<
","
<<
p3
[
1
]
<<
","
<<
p3
[
2
]
<<
"> "
<<
CGoGNendl
;
CGoGN
out
<<
"}"
<<
CGoGNendl
;
}
template
<
typename
PFP
>
void
exportMeshPlain
(
std
::
ofstream
&
out
,
typename
PFP
::
MAP
&
map
,
typename
PFP
::
TVEC3
&
position
,
const
std
::
string
&
meshName
,
const
FunctorSelect
&
good
=
SelectorTrue
())
{
out
<<
"#declare "
<<
meshName
<<
"= union {"
<<
CGoGNendl
;
CGoGN
out
<<
"#declare "
<<
meshName
<<
"= union {"
<<
CGoGNendl
;
DartMarkerStore
traite
(
map
);
...
...
@@ -59,25 +60,25 @@ void exportMeshPlain(std::ofstream& out, typename PFP::MAP& map, typename PFP::T
Algo
::
ExportPov
::
exportTrianglePlain
<
PFP
>
(
out
,
position
[
dd
],
position
[
map
.
phi1
(
dd
)],
position
[
map
.
phi1
(
map
.
phi1
(
dd
))]);
}
else
{
out
<<
"polygon{ "
<<
nb
+
1
<<
CGoGNendl
;
CGoGN
out
<<
"polygon{ "
<<
nb
+
1
<<
CGoGNendl
;
dd
=
d
;
do
{
out
<<
"<"
<<
position
[
dd
][
0
]
<<
","
<<
position
[
dd
][
1
]
<<
","
<<
position
[
dd
][
2
]
<<
">,"
<<
CGoGNendl
;
CGoGN
out
<<
"<"
<<
position
[
dd
][
0
]
<<
","
<<
position
[
dd
][
1
]
<<
","
<<
position
[
dd
][
2
]
<<
">,"
<<
CGoGNendl
;
dd
=
map
.
phi1
(
dd
);
}
while
(
dd
!=
d
);
out
<<
"<"
<<
position
[
d
][
0
]
<<
","
<<
position
[
d
][
1
]
<<
","
<<
position
[
d
][
2
]
<<
">"
<<
CGoGNendl
;
out
<<
"}"
<<
CGoGNendl
;
CGoGN
out
<<
"<"
<<
position
[
d
][
0
]
<<
","
<<
position
[
d
][
1
]
<<
","
<<
position
[
d
][
2
]
<<
">"
<<
CGoGNendl
;
CGoGN
out
<<
"}"
<<
CGoGNendl
;
}
}
}
out
<<
"}"
<<
CGoGNendl
;
CGoGN
out
<<
"}"
<<
CGoGNendl
;
}
template
<
typename
PFP
>
void
exportMeshWire
(
std
::
ofstream
&
out
,
typename
PFP
::
MAP
&
map
,
typename
PFP
::
TVEC3
&
position
,
const
std
::
string
&
meshName
,
const
FunctorSelect
&
good
=
SelectorTrue
())
{
out
<<
"#declare "
<<
meshName
<<
"= union {"
<<
CGoGNendl
;
CGoGN
out
<<
"#declare "
<<
meshName
<<
"= union {"
<<
CGoGNendl
;
DartMarkerStore
traite
(
map
);
...
...
@@ -98,10 +99,10 @@ void exportMeshWire(std::ofstream& out, typename PFP::MAP& map, typename PFP::TV
dd
=
d
;
do
{
if
(
position
[
dd
][
0
]
!=
position
[
map
.
phi1
(
dd
)][
0
]
||
position
[
dd
][
1
]
!=
position
[
map
.
phi1
(
dd
)][
1
]
||
position
[
dd
][
2
]
!=
position
[
map
.
phi1
(
dd
)][
2
])
{
out
<<
"cylinder{ "
<<
CGoGNendl
;
out
<<
"<"
<<
position
[
dd
][
0
]
<<
","
<<
position
[
dd
][
1
]
<<
","
<<
position
[
dd
][
2
]
<<
">,"
<<
CGoGNendl
;
out
<<
"<"
<<
position
[
map
.
phi1
(
dd
)][
0
]
<<
","
<<
position
[
map
.
phi1
(
dd
)][
1
]
<<
","
<<
position
[
map
.
phi1
(
dd
)][
2
]
<<
">, 0.5"
<<
CGoGNendl
;
out
<<
"}"
<<
CGoGNendl
;
CGoGN
out
<<
"cylinder{ "
<<
CGoGNendl
;
CGoGN
out
<<
"<"
<<
position
[
dd
][
0
]
<<
","
<<
position
[
dd
][
1
]
<<
","
<<
position
[
dd
][
2
]
<<
">,"
<<
CGoGNendl
;
CGoGN
out
<<
"<"
<<
position
[
map
.
phi1
(
dd
)][
0
]
<<
","
<<
position
[
map
.
phi1
(
dd
)][
1
]
<<
","
<<
position
[
map
.
phi1
(
dd
)][
2
]
<<
">, 0.5"
<<
CGoGNendl
;
CGoGN
out
<<
"}"
<<
CGoGNendl
;
}
dd
=
map
.
phi1
(
dd
);
}
while
(
dd
!=
d
);
...
...
@@ -109,7 +110,7 @@ void exportMeshWire(std::ofstream& out, typename PFP::MAP& map, typename PFP::TV
}
}
out
<<
"}"
<<
CGoGNendl
;
CGoGN
out
<<
"}"
<<
CGoGNendl
;
}
template
<
typename
PFP
>
...
...
@@ -126,27 +127,27 @@ bool exportScenePov(typename PFP::MAP& map, typename PFP::TVEC3& position, const
float
angleZ
=
angle_Z
;
//define the camera position
out
<<
"camera { location <"
<<
cameraPos
[
0
]
<<
","
<<
cameraPos
[
1
]
<<
","
<<
cameraPos
[
2
]
<<
"> look_at <"
<<
cameraLook
[
0
]
<<
","
<<
cameraLook
[
1
]
<<
","
<<
cameraLook
[
2
]
<<
">}"
<<
CGoGNendl
;;
CGoGN
out
<<
"camera { location <"
<<
cameraPos
[
0
]
<<
","
<<
cameraPos
[
1
]
<<
","
<<
cameraPos
[
2
]
<<
"> look_at <"
<<
cameraLook
[
0
]
<<
","
<<
cameraLook
[
1
]
<<
","
<<
cameraLook
[
2
]
<<
">}"
<<
CGoGNendl
;;
//set a "infinite" plane
// out << "plane { y, -1 pigment { color rgb 1 } }" << CGoGNendl;
//
CGoGN
out << "plane { y, -1 pigment { color rgb 1 } }" << CGoGNendl;
//set a sky sphere
out
<<
"sphere { <0, 0, 0>, 5000"
;
out
<<
"texture{ pigment { color rgb <1, 1, 1>} finish { ambient 1 diffuse 0 } } }"
<<
CGoGNendl
;
CGoGN
out
<<
"sphere { <0, 0, 0>, 5000"
;
CGoGN
out
<<
"texture{ pigment { color rgb <1, 1, 1>} finish { ambient 1 diffuse 0 } } }"
<<
CGoGNendl
;
//put some lights
out
<<
"light_source { <"
<<
cameraPos
[
0
]
<<
","
<<
cameraPos
[
1
]
<<
","
<<
cameraPos
[
2
]
<<
"> color rgb 0.45}"
<<
CGoGNendl
;
// out << "light_source { <-120, -300, -10> color rgb 0.25 }"<< CGoGNendl;
CGoGN
out
<<
"light_source { <"
<<
cameraPos
[
0
]
<<
","
<<
cameraPos
[
1
]
<<
","
<<
cameraPos
[
2
]
<<
"> color rgb 0.45}"
<<
CGoGNendl
;
//
CGoGN
out << "light_source { <-120, -300, -10> color rgb 0.25 }"<< CGoGNendl;
//set a high quality rendering
out
<<
"global_settings {"
<<
CGoGNendl
;
out
<<
"radiosity {"
<<
CGoGNendl
;
out
<<
"pretrace_start 0.08 pretrace_end 0.04"
<<
CGoGNendl
;
out
<<
"count 100 nearest_count 10 error_bound 0.15 recursion_limit 1 low_error_factor 0.2 gray_threshold 0.0 minimum_reuse 0.015 brightness 1 adc_bailout 0.01/2 normal off media off} max_trace_level 255}"
<<
CGoGNendl
;
CGoGN
out
<<
"global_settings {"
<<
CGoGNendl
;
CGoGN
out
<<
"radiosity {"
<<
CGoGNendl
;
CGoGN
out
<<
"pretrace_start 0.08 pretrace_end 0.04"
<<
CGoGNendl
;
CGoGN
out
<<
"count 100 nearest_count 10 error_bound 0.15 recursion_limit 1 low_error_factor 0.2 gray_threshold 0.0 minimum_reuse 0.015 brightness 1 adc_bailout 0.01/2 normal off media off} max_trace_level 255}"
<<
CGoGNendl
;
Algo
::
ExportPov
::
exportMeshPlain
<
PFP
>
(
out
,
map
,
position
,
"myMesh"
,
good
);
out
<<
"object {myMesh"
<<
CGoGNendl
;
out
<<
"translate <"
<<
translate
[
0
]
<<
","
<<
translate
[
1
]
<<
","
<<
translate
[
2
]
<<
">"
<<
CGoGNendl
;
out
<<
"rotate <"
<<
angleX
<<
","
<<
angleY
<<
","
<<
angleZ
<<
"> "
<<
CGoGNendl
;
out
<<
"texture{ pigment{ color rgb<1.0,1.0,1>} finish { ambient rgb 0.05 brilliance 0.5 } } }"
<<
CGoGNendl
;
CGoGN
out
<<
"object {myMesh"
<<
CGoGNendl
;
CGoGN
out
<<
"translate <"
<<
translate
[
0
]
<<
","
<<
translate
[
1
]
<<
","
<<
translate
[
2
]
<<
">"
<<
CGoGNendl
;
CGoGN
out
<<
"rotate <"
<<
angleX
<<
","
<<
angleY
<<
","
<<
angleZ
<<
"> "
<<
CGoGNendl
;
CGoGN
out
<<
"texture{ pigment{ color rgb<1.0,1.0,1>} finish { ambient rgb 0.05 brilliance 0.5 } } }"
<<
CGoGNendl
;
out
.
close
();
return
true
;
...
...
@@ -158,4 +159,4 @@ bool exportScenePov(typename PFP::MAP& map, typename PFP::TVEC3& position, const
}
#endif
\ No newline at end of file
#endif
include/Algo/ImplicitHierarchicalMesh/ihm3.h
View file @
c1269877
...
...
@@ -35,7 +35,7 @@ namespace CGoGN
namespace
Algo
{
namespace
IHM
3
namespace
IHM
{
template
<
typename
T
>
class
AttributeHandler_IHM
;
...
...
@@ -70,6 +70,10 @@ public:
template
<
typename
T
>
AttributeHandler_IHM
<
T
>
addAttribute
(
unsigned
int
orbit
,
const
std
::
string
&
nameAttr
)
;
template
<
typename
T
>
AttributeHandler_IHM
<
T
>
getAttribute
(
unsigned
int
orbit
,
const
std
::
string
&
nameAttr
)
;
/***************************************************
* MAP TRAVERSAL *
***************************************************/
...
...
@@ -80,12 +84,12 @@ public:
Dart
phi_1
(
Dart
d
)
;
Dart
phi2
(
Dart
d
)
;
private:
Dart
phi2bis
(
Dart
d
)
;
public:
Dart
phi2
(
Dart
d
)
;
Dart
phi3
(
Dart
d
);
Dart
alpha0
(
Dart
d
);
...
...
@@ -114,6 +118,16 @@ public:
virtual
bool
foreach_dart_of_cc
(
Dart
d
,
FunctorType
&
f
)
;
/****************************************************
* EMBEDDED FUNCTIONS *
****************************************************/
// virtual void cutEdge(Dart d);
//
// virtual void splitFace(Dart d, Dart e);
//
// virtual void sewVolumes(Dart d, Dart e);
/***************************************************
* LEVELS MANAGEMENT *
***************************************************/
...
...
@@ -142,13 +156,24 @@ public:
*/
unsigned
int
getNewEdgeId
()
;
/**
* Return the id of the edge of d
*/
unsigned
int
getEdgeId
(
Dart
d
)
;
/**
* Set an edge id to all darts from an orbit of d
*/
//TODO changer l'ordre des parametres
void
setEdgeId
(
Dart
d
,
unsigned
int
i
,
unsigned
int
orbit
);
/***************************************************
* FACE ID MANAGEMENT *
***************************************************/
/**
* Give a new unique id to all the faces of the map
*/
void
initFaceId
()
;
/**
...
...
@@ -156,10 +181,19 @@ public:
*/
unsigned
int
getNewFaceId
()
;
/**
* Return the id of the face of d
*/
unsigned
int
getFaceId
(
Dart
d
)
;
/**
* Set a face id to all darts from an orbit of d
*/
//TODO changer l'ordre des parametres
void
setFaceId
(
Dart
d
,
unsigned
int
i
,
unsigned
int
orbit
);
void
setFaceId
(
unsigned
int
orbit
,
Dart
d
);
/***************************************************
* CELLS INFORMATION *
***************************************************/
...
...
@@ -175,22 +209,22 @@ public:
unsigned
int
edgeLevel
(
Dart
d
)
;
/**
*
*
Return the level of the face of d in the current level map
*/
unsigned
int
faceLevel
(
Dart
d
);
/**
*
*
Return the level of the volume of d in the current level map
*/
unsigned
int
volumeLevel
(
Dart
d
);
/**
*
*
Return the oldest dart of the face of d in the current level map
*/
Dart
faceOldestDart
(
Dart
d
);
/**
*
*
Return the oldest dart of the volume of d in the current level map
*/
Dart
volumeOldestDart
(
Dart
d
);
...
...
@@ -201,12 +235,14 @@ public:
bool
edgeIsSubdivided
(
Dart
d
)
;
/**
*
* Return true if the face of d in the current level map
* has already been subdivided to the next level
*/
bool
faceIsSubdivided
(
Dart
d
)
;
/**
*
* Return true if the volume of d in the current level map
* has already been subdivided to the next level
*/
bool
volumeIsSubdivided
(
Dart
d
);
}
;
...
...
@@ -220,7 +256,7 @@ public:
AttributeHandler_IHM
()
:
AttributeHandler
<
T
>
()
{}
AttributeHandler_IHM
(
GenericMap
*
m
,
unsigned
int
idAttr
)
:
AttributeHandler
<
T
>
(
m
,
idAttr
)
AttributeHandler_IHM
(
GenericMap
*
m
,
AttributeMultiVector
<
T
>*
amv
)
:
AttributeHandler
<
T
>
(
m
,
amv
)
{}
AttributeMultiVector
<
T
>*
getDataVector
()
const
...
...
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
View file @
c1269877
...
...
@@ -28,7 +28,7 @@ namespace CGoGN
namespace
Algo
{
namespace
IHM
3
namespace
IHM
{
/***************************************************
...
...
@@ -47,14 +47,20 @@ AttributeHandler_IHM<T> ImplicitHierarchicalMap3::addAttribute(unsigned int orbi
if
(
addNextLevelCell
)
{
AttributeContainer
&
cellCont
=
m_attribs
[
orbit
]
;
unsigned
int
index
=
cellCont
.
addAttribute
<
unsigned
int
>
(
"nextLevelCell"
)
;
AttributeMultiVector
<
unsigned
int
>&
amv
=
cellCont
.
getDataVector
<
unsigned
int
>
(
index
)
;
m_nextLevelCell
[
orbit
]
=
&
amv
;
AttributeMultiVector
<
unsigned
int
>*
amv
=
cellCont
.
addAttribute
<
unsigned
int
>
(
"nextLevelCell"
)
;
m_nextLevelCell
[
orbit
]
=
amv
;
for
(
unsigned
int
i
=
cellCont
.
begin
();
i
<
cellCont
.
end
();
cellCont
.
next
(
i
))
amv
[
i
]
=
EMBNULL
;
amv
->
operator
[](
i
)
=
EMBNULL
;
}
return
AttributeHandler_IHM
<
T
>
(
this
,
h
.
id
())
;
return
AttributeHandler_IHM
<
T
>
(
this
,
h
.
getDataVector
())
;
}
template
<
typename
T
>
AttributeHandler_IHM
<
T
>
ImplicitHierarchicalMap3
::
getAttribute
(
unsigned
int
orbit
,
const
std
::
string
&
nameAttr
)
{
AttributeHandler
<
T
>
h
=
Map2
::
getAttribute
<
T
>
(
orbit
,
nameAttr
)
;
return
AttributeHandler_IHM
<
T
>
(
this
,
h
.
getDataVector
())
;
}
/***************************************************
...
...
@@ -77,15 +83,18 @@ inline Dart ImplicitHierarchicalMap3::phi1(Dart d)
unsigned
int
edgeId
=
m_edgeId
[
d
]
;
Dart
it
=
d
;
do
{
it
=
Map3
::
phi1
(
it
)
;
if
(
m_dartLevel
[
it
]
<=
m_curLevel
)
finished
=
true
;
else
{
if
(
m_edgeId
[
it
]
!=
edgeId
)
while
(
m_edgeId
[
it
]
!=
edgeId
)
it
=
Map3
::
phi1
(
phi2bis
(
it
));
}
}
while
(
!
finished
)
;
...
...
@@ -106,8 +115,8 @@ inline Dart ImplicitHierarchicalMap3::phi_1(Dart d)
else
{
it
=
Map3
::
phi_1
(
it
)
;
if
(
m_edgeId
[
it
]
!=
edgeId
)
it
=
Map3
::
phi_1
(
phi2bis
(
it
))
;
while
(
m_edgeId
[
it
]
!=
edgeId
)
it
=
Map3
::
phi_1
(
phi2bis
(
it
));
}
}
while
(
!
finished
)
;
...
...
@@ -117,10 +126,7 @@ inline Dart ImplicitHierarchicalMap3::phi_1(Dart d)
//TODO A verifier si besoin d'assertion
inline
Dart
ImplicitHierarchicalMap3
::
phi2bis
(
Dart
d
)
{
//assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ;
unsigned
int
faceId
=
m_faceId
[
d
];
Dart
it
=
d
;
it
=
Map3
::
phi2
(
it
)
;
...
...
@@ -129,8 +135,11 @@ inline Dart ImplicitHierarchicalMap3::phi2bis(Dart d)
return
it
;
else
{
while
(
m_faceId
[
it
]
!=
faceId
)
it
=
Map3
::
alpha_2
(
it
);
do
{
it
=
Map3
::
phi2
(
Map3
::
phi3
(
it
));
}
while
(
m_faceId
[
it
]
!=
faceId
);
return
it
;
}
...
...
@@ -160,7 +169,7 @@ inline Dart ImplicitHierarchicalMap3::alpha0(Dart d)
inline
Dart
ImplicitHierarchicalMap3
::
alpha1
(
Dart
d
)
{
assert
(
m_dartLevel
[
d
]
<=
m_curLevel
||
!
"Access to a dart introduced after current level"
)
;
//
assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ;
return
Map3
::
alpha1
(
d
)
;
}
...
...
@@ -183,6 +192,8 @@ inline Dart ImplicitHierarchicalMap3::alpha2(Dart d)
e
=
phi3
(
f
);
}
return
f
;
//return Map3::alpha2(d);
}
inline
Dart
ImplicitHierarchicalMap3
::
alpha_2
(
Dart
d
)
...
...
@@ -202,6 +213,8 @@ inline Dart ImplicitHierarchicalMap3::alpha_2(Dart d)
f
=
phi2
(
e
);
}
return
e
;
//return Map3::alpha_2(d);
}
inline
Dart
ImplicitHierarchicalMap3
::
begin
()
...
...
@@ -222,7 +235,7 @@ inline void ImplicitHierarchicalMap3::next(Dart& d)
do
{
Map3
::
next
(
d
)
;
}
while
(
m_dartLevel
[
d
]
>
m_curLevel
&&
d
!=
Map3
::
end
()
)
;
}
while
(
d
!=
Map3
::
end
()
&&
m_dartLevel
[
d
]
>
m_curLevel
)
;
}
inline
bool
ImplicitHierarchicalMap3
::
foreach_dart_of_vertex
(
Dart
d
,
FunctorType
&
f
)
...
...
@@ -350,6 +363,99 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_cc(Dart d, FunctorType& f)
return
foreach_dart_of_oriented_volume
(
d
,
f
)
;
}
/**************************************************
* EMBEDDED FUNCTIONS *
**************************************************/
//void ImplicitHierarchicalMap3::cutEdge(Dart d)
//{
// Dart dd = phi2(d) ;
// EmbeddedMap3<Map3>::cutEdge(d);
//
// //
// //mise a jour de l'id d'arrete sur chaque moitie d'arete
// //
// unsigned int eId;
//
// //Test si id existe
// if(m_edgeId[d] == EMBNULL)
// {
// eId = getNewEdgeId();
// }
// else
// {
// eId = getEdgeId(d) ;
// }
//
// //tour de la 1ere moitie de l'arete avec modification
// Dart e = d;
// do
// {
// m_edgeId[e] = eId; //cas ou l'arete n'est pas du tout plonge
// m_edgeId[Map3::phi2(e)] = eId;
//
// e = Map3::alpha2(e);
// } while(e != d);
//
//
// e = dd;
// do
// {
// m_edgeId[e] = eId;
// m_edgeId[Map3::phi2(e)] = eId;
//
// e = Map3::alpha2(e);
// } while(e != dd);
//
//
// //
// //mise a jour de l'id de face sur chaque brin de chaque moitie d'arete
// //
//
//}
//
//void ImplicitHierarchicalMap3::splitFace(Dart d, Dart e)
//{
// //
// //Verification que les brins precedents ceux que l'on split n'ont pas le meme id
// //
// if(m_edgeId[d] == m_edgeId[Map3::phi_1(d)])
// {
// unsigned int eId = getNewEdgeId() ;
//
// Dart e = d;
// do
// {
// m_edgeId[e] = eId; //cas ou l'arete n'est pas du tout plonge
// m_edgeId[Map3::phi2(e)] = eId;
//
// e = Map3::alpha2(e);
// } while(e != d);
// }
//
// EmbeddedMap3<Map3>::splitFace(d,e);
//
// //
// //creation d'un id d'arete sur la nouvelle arete
// //
//
// unsigned int eId = getNewEdgeId() ;
// Dart a =Map3:: phi_1(d);
//
// do
// {
// m_edgeId[a] = eId;
// m_edgeId[Map3::phi2(a)] = eId;
//
// a = Map3::alpha2(a);
// } while(a != Map3::phi_1(d));
//
//}
//
//void ImplicitHierarchicalMap3::sewVolumes(Dart d, Dart e)
//{
//
//}
/***************************************************
* LEVELS MANAGEMENT *
***************************************************/
...
...
@@ -429,26 +535,28 @@ inline unsigned int ImplicitHierarchicalMap3::getFaceId(Dart d)
return
m_faceId
[
d
]
;
}
inline
void
ImplicitHierarchicalMap3
::
setFaceId
(
Dart
d
,
unsigned
int
i
,
unsigned
int
orbit
)
inline
void
ImplicitHierarchicalMap3
::
setFaceId
(
unsigned
int
orbit
,
Dart
d
)
{
//Mise a jour de l'id de face pour les brins autour d'une arete
if
(
orbit
==
EDGE_ORBIT
)
{
Dart
e
=
d
;
unsigned
int
fid
;
do
{
fid
=
getFaceId
(
e
);
m_faceId
[
e
]
=
fid
;
m_faceId
[
Map3
::
phi2
(
e
)]
=
fid
;
m_faceId
[
Map3
::
phi1
(
e
)]
=
m_faceId
[
e
];
e
=
Map3
::
alpha2
(
e
);
}
while
(
e
!=
d
);
}
}
inline
void
ImplicitHierarchicalMap3
::
setFaceId
(
Dart
d
,
unsigned
int
i
,
unsigned
int
orbit
)
{
//Mise a jour de l'id de face pour les brins autour de la face
else
if
(
orbit
==
FACE_ORBIT
)
if
(
orbit
==
FACE_ORBIT
)
{
Dart
e
=
d
;
...
...
@@ -466,6 +574,9 @@ inline void ImplicitHierarchicalMap3::setFaceId(Dart d, unsigned int i, unsigned
else
if
(
orbit
==
DART_ORBIT
)
{
m_faceId
[
d
]
=
i
;
if
(
Map3
::
phi3
(
d
)
!=
d
)
m_faceId
[
Map3
::
phi3
(
d
)]
=
i
;
}