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
921efcb1
Commit
921efcb1
authored
Jul 17, 2013
by
untereiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some changes
parent
71e149b3
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1587 additions
and
1220 deletions
+1587
-1220
Apps/Tuto/show_traversors.cpp
Apps/Tuto/show_traversors.cpp
+547
-485
Apps/Tuto/tuto_oper2.cpp
Apps/Tuto/tuto_oper2.cpp
+17
-3
Apps/Tuto/tuto_oper2.h
Apps/Tuto/tuto_oper2.h
+11
-3
Apps/Tuto/tuto_oper3.cpp
Apps/Tuto/tuto_oper3.cpp
+644
-587
Apps/Tuto/tuto_oper3.h
Apps/Tuto/tuto_oper3.h
+12
-3
Apps/Tuto/tuto_oper3.ui
Apps/Tuto/tuto_oper3.ui
+5
-0
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
+250
-42
include/Algo/Multiresolution/Map3MR/Masks/mcCrackenJoy.h
include/Algo/Multiresolution/Map3MR/Masks/mcCrackenJoy.h
+16
-12
include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.hpp
include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.hpp
+27
-27
src/Utils/svg.cpp
src/Utils/svg.cpp
+58
-58
No files found.
Apps/Tuto/show_traversors.cpp
View file @
921efcb1
...
@@ -29,6 +29,8 @@
...
@@ -29,6 +29,8 @@
#include "Algo/Modelisation/polyhedron.h"
#include "Algo/Modelisation/polyhedron.h"
#include "Algo/Modelisation/subdivision.h"
#include "Algo/Modelisation/subdivision.h"
#include "Algo/Import/import.h"
#include "Algo/Render/GL2/topo3Render.h"
#include "Algo/Render/GL2/topo3Render.h"
#include "Algo/Render/SVG/mapSVGRender.h"
#include "Algo/Render/SVG/mapSVGRender.h"
...
@@ -156,31 +158,42 @@ void MyQT::cb_mousePress(int /*button*/, int x, int y)
...
@@ -156,31 +158,42 @@ void MyQT::cb_mousePress(int /*button*/, int x, int y)
void
MyQT
::
cb_Save
()
void
MyQT
::
cb_Save
()
{
{
// std::string filename = selectFileSave("Export SVG file ",".","(*.svg)");
std
::
string
filename
=
selectFileSave
(
"Export SVG file "
,
"."
,
"(*.svg)"
);
// Utils::SVG::SVGOut svg(filename,modelViewMatrix(),projectionMatrix());
// m_drawer.toSVG(svg);
std
::
string
filename1
=
filename
+
std
::
string
(
"Drawer"
)
+
std
::
string
(
".svg"
);
// m_render_topo->toSVG(svg);
std
::
string
filename2
=
filename
+
std
::
string
(
"Topo"
)
+
std
::
string
(
".svg"
);
Utils
::
SVG
::
SVGOut
svg1
(
modelViewMatrix
(),
projectionMatrix
());
// std::string filename = selectFileSave("Export SVG file ",".","(*.svg)");
// Utils::SVG::SVGOut svg(filename,modelViewMatrix(),projectionMatrix());
// m_drawer.toSVG(svg);
// m_render_topo->toSVG(svg);
Utils
::
SVG
::
SVGOut
svg1
(
filename1
,
modelViewMatrix
(),
projectionMatrix
());
m_drawer
.
toSVG
(
svg1
);
m_drawer
.
toSVG
(
svg1
);
// svg1.addOpacityAnimation(1.0f);
svg1
.
write
();
// svg1.addOpacityAnimation(1.0f);
// svg1.addOpacityAnimation(1.0f);
// svg1.addOpacityAnimation(0.0f);
// svg1.addOpacityAnimation(1.0f);
// svg1.addOpacityAnimation(0.0f);
Utils
::
SVG
::
SVGOut
svg2
(
modelViewMatrix
(),
projectionMatrix
());
Utils
::
SVG
::
SVGOut
svg2
(
filename2
,
modelViewMatrix
(),
projectionMatrix
());
m_render_topo
->
toSVG
(
svg2
);
m_render_topo
->
toSVG
(
svg2
);
// svg2.addOpacityAnimation(1.0f);
svg2
.
write
();
// svg2.addOpacityAnimation(0.0f);
// svg2.addOpacityAnimation(1.0f);
// svg2.addOpacityAnimation(1.0f);
// svg2.addOpacityAnimation(0.0f);
// svg2.addOpacityAnimation(1.0f);
Utils
::
SVG
::
AnimatedSVGOut
anim
;
// Utils::SVG::AnimatedSVGOut anim;
// anim.add(&svg1);
// anim.add(&svg2);
// anim.write(filename, 2.0f);
anim
.
add
(
&
svg1
);
anim
.
add
(
&
svg2
);
std
::
string
filename
=
selectFileSave
(
"Export SVG file "
,
"."
,
"(*.svg)"
);
anim
.
write
(
filename
,
2.0
f
);
}
}
template
<
unsigned
int
ORBIT
>
template
<
unsigned
int
ORBIT
>
...
@@ -196,7 +209,7 @@ void MyQT::traverse2()
...
@@ -196,7 +209,7 @@ void MyQT::traverse2()
if
(
m_selected
==
NIL
)
if
(
m_selected
==
NIL
)
return
;
return
;
m_last
=
2
;
m_last
=
2
;
// int code = (m_ajd_or_inci2)*100+m_first2*10+m_second2;
// int code = (m_ajd_or_inci2)*100+m_first2*10+m_second2;
m_drawer
.
newList
(
GL_COMPILE
);
m_drawer
.
newList
(
GL_COMPILE
);
m_drawer
.
lineWidth
(
7.0
f
);
m_drawer
.
lineWidth
(
7.0
f
);
...
@@ -226,7 +239,7 @@ void MyQT::traverse2()
...
@@ -226,7 +239,7 @@ void MyQT::traverse2()
m_drawer
.
endList
();
m_drawer
.
endList
();
// SelectorMarked sm(*m_dm_topo);
// SelectorMarked sm(*m_dm_topo);
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
0.95
f
,
0.9
f
,
0.8
f
);
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
0.95
f
,
0.9
f
,
0.8
f
);
updateGL
();
updateGL
();
...
@@ -255,7 +268,6 @@ void MyQT::dynamicMarkOrbit(unsigned int orb)
...
@@ -255,7 +268,6 @@ void MyQT::dynamicMarkOrbit(unsigned int orb)
}
}
}
}
void
MyQT
::
traverse3
()
void
MyQT
::
traverse3
()
{
{
if
(
m_selected
==
NIL
)
if
(
m_selected
==
NIL
)
...
@@ -271,7 +283,7 @@ void MyQT::traverse3()
...
@@ -271,7 +283,7 @@ void MyQT::traverse3()
m_drawer
.
color3f
(
0.0
f
,
0.7
f
,
0.0
f
);
m_drawer
.
color3f
(
0.0
f
,
0.7
f
,
0.0
f
);
m_dm_topo
->
unmarkAll
();
m_dm_topo
->
unmarkAll
();
SelectorMarked
sm
(
*
m_dm_topo
);
//
SelectorMarked sm(*m_dm_topo);
if
(
m_ajd_or_inci3
==
0
)
// incident
if
(
m_ajd_or_inci3
==
0
)
// incident
{
{
...
@@ -597,11 +609,61 @@ void MyQT::dyn_trav3XY(unsigned int first, unsigned int second)
...
@@ -597,11 +609,61 @@ void MyQT::dyn_trav3XY(unsigned int first, unsigned int second)
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
{
{
if
(
argc
==
1
)
{
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
Algo
::
Volume
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
myMap
,
position
);
Algo
::
Volume
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
myMap
,
position
);
dglobal
=
prim
.
hexaGrid_topo
(
4
,
4
,
4
);
dglobal
=
prim
.
hexaGrid_topo
(
3
,
3
,
3
);
prim
.
embedHexaGrid
(
1.0
f
,
1.0
f
,
1.0
f
);
prim
.
embedHexaGrid
(
1.0
f
,
1.0
f
,
1.0
f
);
}
else
{
std
::
string
filename
(
argv
[
1
]);
size_t
pos
=
filename
.
rfind
(
"."
);
// position of "." in filename
std
::
string
extension
=
filename
.
substr
(
pos
);
std
::
vector
<
std
::
string
>
attrNames
;
if
(
extension
==
std
::
string
(
".off"
))
{
if
(
!
Algo
::
Volume
::
Import
::
importMeshToExtrude
<
PFP
>
(
myMap
,
filename
,
attrNames
,
1.5
,
2
))
{
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
-
1
;
}
myMap
.
closeMap
();
}
// if(extension == std::string(".off"))
// {
// if(!Algo::Surface::Import::importMeshSAsV<PFP>(myMap, filename, attrNames))
// {
// std::cerr << "could not import " << std::endl ;
// return ;
// }
// /myMap.closeMap();
// }
else
if
(
extension
==
std
::
string
(
".map"
))
{
myMap
.
clear
(
true
);
if
(
!
myMap
.
loadMapBin
(
filename
))
{
std
::
cout
<<
"could not load file"
<<
std
::
endl
;
}
//myMap.dumpAttributesAndMarkers();
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
"position"
);
}
else
if
(
!
Algo
::
Volume
::
Import
::
importMesh
<
PFP
>
(
myMap
,
filename
,
attrNames
))
{
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
-
1
;
}
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
}
// un peu d'interface
// un peu d'interface
QApplication
app
(
argc
,
argv
);
QApplication
app
(
argc
,
argv
);
...
...
Apps/Tuto/tuto_oper2.cpp
View file @
921efcb1
...
@@ -194,7 +194,12 @@ void MyQT::createMap(int n)
...
@@ -194,7 +194,12 @@ void MyQT::createMap(int n)
m_render_topo
->
setDartWidth
(
4.0
f
);
m_render_topo
->
setDartWidth
(
4.0
f
);
m_render_topo
->
setInitialDartsColor
(
0.0
f
,
0.0
f
,
0.0
f
);
m_render_topo
->
setInitialDartsColor
(
0.0
f
,
0.0
f
,
0.0
f
);
m_render_topo
->
setInitialBoundaryDartsColor
(
0.0
f
,
0.0
f
,
0.0
f
);
m_render_topo
->
setInitialBoundaryDartsColor
(
0.0
f
,
0.0
f
,
0.0
f
);
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
0.9
f
,
0.9
f
,
true
);
// nb
#ifdef PRIMAL_TOPO
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
0.9
);
#else
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
0.9
f
,
0.9
f
,
true
);
#endif
for
(
Dart
d
=
myMap
.
begin
();
d
!=
myMap
.
end
();
myMap
.
next
(
d
))
for
(
Dart
d
=
myMap
.
begin
();
d
!=
myMap
.
end
();
myMap
.
next
(
d
))
{
{
...
@@ -213,7 +218,12 @@ void MyQT::createMap(int n)
...
@@ -213,7 +218,12 @@ void MyQT::createMap(int n)
void
MyQT
::
updateMap
()
void
MyQT
::
updateMap
()
{
{
m_render_topo
->
setInitialBoundaryDartsColor
(
0.0
f
,
0.0
f
,
0.0
f
);
m_render_topo
->
setInitialBoundaryDartsColor
(
0.0
f
,
0.0
f
,
0.0
f
);
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
0.9
f
,
0.9
f
,
true
);
// nb
#ifdef PRIMAL_TOPO
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
0.9
);
#else
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
0.9
f
,
0.9
f
,
true
);
#endif
for
(
Dart
d
=
myMap
.
begin
();
d
!=
myMap
.
end
();
myMap
.
next
(
d
))
for
(
Dart
d
=
myMap
.
begin
();
d
!=
myMap
.
end
();
myMap
.
next
(
d
))
{
{
if
(
dm
.
isMarked
(
d
)
&&
(
!
myMap
.
isBoundaryMarked2
(
d
)))
if
(
dm
.
isMarked
(
d
)
&&
(
!
myMap
.
isBoundaryMarked2
(
d
)))
...
@@ -229,7 +239,11 @@ void MyQT::updateMap()
...
@@ -229,7 +239,11 @@ void MyQT::updateMap()
void
MyQT
::
cb_initGL
()
void
MyQT
::
cb_initGL
()
{
{
glClearColor
(
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
);
glClearColor
(
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
);
#ifdef PRIMAL_TOPO
m_render_topo
=
new
Algo
::
Render
::
GL2
::
TopoPrimalRender
()
;
#else
m_render_topo
=
new
Algo
::
Render
::
GL2
::
TopoRender
(
0.01
f
)
;
m_render_topo
=
new
Algo
::
Render
::
GL2
::
TopoRender
(
0.01
f
)
;
#endif
}
}
// redraw GL callback (clear and swap already done)
// redraw GL callback (clear and swap already done)
...
...
Apps/Tuto/tuto_oper2.h
View file @
921efcb1
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
//#define USE_GMAP
//#define USE_GMAP
//#define PRIMAL_TOPO 1
#include "Topology/generic/parameters.h"
#include "Topology/generic/parameters.h"
...
@@ -36,8 +37,11 @@
...
@@ -36,8 +37,11 @@
#include "Topology/map/embeddedMap2.h"
#include "Topology/map/embeddedMap2.h"
#endif
#endif
#include "Algo/Render/GL2/topoRender.h"
#ifdef PRIMAL_TOPO
#include "Algo/Render/GL2/topoPrimalRender.h"
#else
#include "Algo/Render/GL2/topoRender.h"
#endif
#include "ui_tuto_oper2.h"
#include "ui_tuto_oper2.h"
#include "Utils/Qt/qtui.h"
#include "Utils/Qt/qtui.h"
...
@@ -88,7 +92,11 @@ protected:
...
@@ -88,7 +92,11 @@ protected:
DartAttribute
<
VEC3
>
colorDarts
;
DartAttribute
<
VEC3
>
colorDarts
;
// render (for the topo)
// render (for the topo)
#ifdef PRIMAL_TOPO
Algo
::
Render
::
GL2
::
TopoPrimalRender
*
m_render_topo
;
#else
Algo
::
Render
::
GL2
::
TopoRender
*
m_render_topo
;
Algo
::
Render
::
GL2
::
TopoRender
*
m_render_topo
;
#endif
Dart
m_selected
;
Dart
m_selected
;
Dart
m_selected2
;
Dart
m_selected2
;
DartMarker
dm
;
DartMarker
dm
;
...
...
Apps/Tuto/tuto_oper3.cpp
View file @
921efcb1
...
@@ -110,7 +110,6 @@ void MyQT::operation(int x)
...
@@ -110,7 +110,6 @@ void MyQT::operation(int x)
CGoGNout
<<
"delete vertex"
<<
CGoGNendl
;
CGoGNout
<<
"delete vertex"
<<
CGoGNendl
;
if
(
m_selected
!=
NIL
)
if
(
m_selected
!=
NIL
)
{
{
dm
.
markAll
();
m_selected
=
myMap
.
deleteVertex
(
m_selected
);
m_selected
=
myMap
.
deleteVertex
(
m_selected
);
m_selected
=
NIL
;
m_selected
=
NIL
;
updateMap
();
updateMap
();
...
@@ -120,7 +119,6 @@ void MyQT::operation(int x)
...
@@ -120,7 +119,6 @@ void MyQT::operation(int x)
CGoGNout
<<
"cut edge"
<<
CGoGNendl
;
CGoGNout
<<
"cut edge"
<<
CGoGNendl
;
if
(
m_selected
!=
NIL
)
if
(
m_selected
!=
NIL
)
{
{
dm
.
markAll
();
PFP
::
VEC3
Q
=
position
[
myMap
.
phi1
(
m_selected
)];
PFP
::
VEC3
Q
=
position
[
myMap
.
phi1
(
m_selected
)];
myMap
.
cutEdge
(
m_selected
);
myMap
.
cutEdge
(
m_selected
);
position
[
myMap
.
phi1
(
m_selected
)]
=
(
position
[
m_selected
]
+
Q
)
/
2.0
f
;
position
[
myMap
.
phi1
(
m_selected
)]
=
(
position
[
m_selected
]
+
Q
)
/
2.0
f
;
...
@@ -131,7 +129,6 @@ void MyQT::operation(int x)
...
@@ -131,7 +129,6 @@ void MyQT::operation(int x)
CGoGNout
<<
"uncut edge"
<<
CGoGNendl
;
CGoGNout
<<
"uncut edge"
<<
CGoGNendl
;
if
(
m_selected
!=
NIL
)
if
(
m_selected
!=
NIL
)
{
{
dm
.
markAll
();
myMap
.
uncutEdge
(
m_selected
);
myMap
.
uncutEdge
(
m_selected
);
updateMap
();
updateMap
();
}
}
...
@@ -142,7 +139,6 @@ void MyQT::operation(int x)
...
@@ -142,7 +139,6 @@ void MyQT::operation(int x)
{
{
if
(
myMap
.
deleteEdgePreCond
(
m_selected
))
if
(
myMap
.
deleteEdgePreCond
(
m_selected
))
{
{
dm
.
markAll
();
myMap
.
deleteEdge
(
m_selected
);
myMap
.
deleteEdge
(
m_selected
);
m_selected
=
NIL
;
m_selected
=
NIL
;
updateMap
();
updateMap
();
...
@@ -159,7 +155,6 @@ void MyQT::operation(int x)
...
@@ -159,7 +155,6 @@ void MyQT::operation(int x)
{
{
PFP
::
VEC3
Q
=
(
position
[
myMap
.
phi1
(
m_selected
)]
+
position
[
m_selected
])
/
2.0
f
;
PFP
::
VEC3
Q
=
(
position
[
myMap
.
phi1
(
m_selected
)]
+
position
[
m_selected
])
/
2.0
f
;
Dart
x
=
myMap
.
collapseEdge
(
m_selected
);
Dart
x
=
myMap
.
collapseEdge
(
m_selected
);
dm
.
markAll
();
position
[
x
]
=
Q
;
position
[
x
]
=
Q
;
m_selected
=
NIL
;
m_selected
=
NIL
;
updateMap
();
updateMap
();
...
@@ -170,7 +165,6 @@ void MyQT::operation(int x)
...
@@ -170,7 +165,6 @@ void MyQT::operation(int x)
if
(
m_selected
!=
NIL
)
if
(
m_selected
!=
NIL
)
{
{
myMap
.
splitFace
(
m_selected
,
m_selected2
);
myMap
.
splitFace
(
m_selected
,
m_selected2
);
dm
.
markAll
();
updateMap
();
updateMap
();
}
}
break
;
break
;
...
@@ -179,7 +173,6 @@ void MyQT::operation(int x)
...
@@ -179,7 +173,6 @@ void MyQT::operation(int x)
if
(
m_selected
!=
NIL
)
if
(
m_selected
!=
NIL
)
{
{
myMap
.
mergeVolumes
(
m_selected
);
myMap
.
mergeVolumes
(
m_selected
);
dm
.
markAll
();
updateMap
();
updateMap
();
}
}
break
;
break
;
...
@@ -195,8 +188,6 @@ void MyQT::operation(int x)
...
@@ -195,8 +188,6 @@ void MyQT::operation(int x)
myMap
.
splitVolume
(
m_selecteds
);
myMap
.
splitVolume
(
m_selecteds
);
m_selecteds
.
clear
();
m_selecteds
.
clear
();
dm
.
markAll
();
updateMap
();
updateMap
();
}
}
break
;
break
;
...
@@ -206,7 +197,6 @@ void MyQT::operation(int x)
...
@@ -206,7 +197,6 @@ void MyQT::operation(int x)
{
{
PFP
::
VEC3
Q
=
Algo
::
Surface
::
Geometry
::
faceCentroid
<
PFP
>
(
myMap
,
m_selected
,
position
);
PFP
::
VEC3
Q
=
Algo
::
Surface
::
Geometry
::
faceCentroid
<
PFP
>
(
myMap
,
m_selected
,
position
);
Dart
x
=
myMap
.
collapseFace
(
m_selected
);
Dart
x
=
myMap
.
collapseFace
(
m_selected
);
dm
.
markAll
();
position
[
x
]
=
Q
;
position
[
x
]
=
Q
;
m_selected
=
NIL
;
m_selected
=
NIL
;
updateMap
();
updateMap
();
...
@@ -218,7 +208,6 @@ void MyQT::operation(int x)
...
@@ -218,7 +208,6 @@ void MyQT::operation(int x)
{
{
PFP
::
VEC3
Q
=
Algo
::
Surface
::
Geometry
::
volumeCentroid
<
PFP
>
(
myMap
,
m_selected
,
position
);
PFP
::
VEC3
Q
=
Algo
::
Surface
::
Geometry
::
volumeCentroid
<
PFP
>
(
myMap
,
m_selected
,
position
);
Dart
x
=
myMap
.
collapseVolume
(
m_selected
);
Dart
x
=
myMap
.
collapseVolume
(
m_selected
);
dm
.
markAll
();
position
[
x
]
=
Q
;
position
[
x
]
=
Q
;
m_selected
=
NIL
;
m_selected
=
NIL
;
updateMap
();
updateMap
();
...
@@ -237,7 +226,6 @@ void MyQT::operation(int x)
...
@@ -237,7 +226,6 @@ void MyQT::operation(int x)
//position[dit] = position[dit] - c1*0.5f;
//position[dit] = position[dit] - c1*0.5f;
m_selecteds
.
clear
();
m_selecteds
.
clear
();
m_selected
=
NIL
;
m_selected
=
NIL
;
dm
.
markAll
();
updateMap
();
updateMap
();
std
::
cout
<<
"nb darts after = "
<<
myMap
.
getNbDarts
()
<<
std
::
endl
;
std
::
cout
<<
"nb darts after = "
<<
myMap
.
getNbDarts
()
<<
std
::
endl
;
}
}
...
@@ -247,7 +235,15 @@ void MyQT::operation(int x)
...
@@ -247,7 +235,15 @@ void MyQT::operation(int x)
if
(
m_selected
!=
NIL
)
if
(
m_selected
!=
NIL
)
{
{
myMap
.
unsewVolumes
(
m_selected
);
myMap
.
unsewVolumes
(
m_selected
);
dm
.
markAll
();
m_selected
=
NIL
;
updateMap
();
}
break
;
case
12
:
CGoGNout
<<
"delete volume"
<<
CGoGNendl
;
if
(
m_selected
!=
NIL
)
{
myMap
.
deleteVolume
(
m_selected
);
m_selected
=
NIL
;
m_selected
=
NIL
;
updateMap
();
updateMap
();
}
}
...
@@ -270,17 +266,17 @@ void MyQT::createMap(int n)
...
@@ -270,17 +266,17 @@ void MyQT::createMap(int n)
prim
.
hexaGrid_topo
(
n
,
n
,
n
);
prim
.
hexaGrid_topo
(
n
,
n
,
n
);
prim
.
embedHexaGrid
(
1.0
f
,
1.0
f
,
1.0
f
);
prim
.
embedHexaGrid
(
1.0
f
,
1.0
f
,
1.0
f
);
// Algo::Surface::Modelisation::Polyhedron<PFP> poly(myMap, position);
// Algo::Surface::Modelisation::Polyhedron<PFP> poly(myMap, position);
// poly.cylinder_topo(6,1,true,true);
// poly.cylinder_topo(6,1,true,true);
// poly.embedCylinder(6.0,6.0,5.0);
// poly.embedCylinder(6.0,6.0,5.0);
myMap
.
closeMap
();
myMap
.
closeMap
();
// Dart d = Algo::Surface::Modelisation::embedPrism<PFP>(myMap, position, 5, true,6.0,6.0,5.0);
// Dart d = Algo::Surface::Modelisation::embedPrism<PFP>(myMap, position, 5, true,6.0,6.0,5.0);
// Dart d2 = Algo::Surface::Modelisation::embedPyramid<PFP>(myMap, position, 4, true,6.0,5.0);
// Dart d2 = Algo::Surface::Modelisation::embedPyramid<PFP>(myMap, position, 4, true,6.0,5.0);
// myMap.sewVolumes(myMap.phi2(d),d2);
// myMap.sewVolumes(myMap.phi2(d),d2);
// position[myMap.phi_1(myMap.phi2(d2))] += VEC3(9.0,-5.0,-2.5);
// position[myMap.phi_1(myMap.phi2(d2))] += VEC3(9.0,-5.0,-2.5);
myMap
.
check
();
myMap
.
check
();
...
@@ -301,7 +297,11 @@ void MyQT::createMap(int n)
...
@@ -301,7 +297,11 @@ void MyQT::createMap(int n)
void
MyQT
::
updateMap
()
void
MyQT
::
updateMap
()
{
{
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
m_ex1
,
m_ex2
,
m_ex3
/*, nb*/
);
#ifdef PRIMAL_TOPO
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
m_ex1
,
m_ex2
);
#else
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
m_ex1
,
m_ex2
,
m_ex3
);
#endif
m_render_topo_boundary
->
updateDataBoundary
<
PFP
>
(
myMap
,
position
,
m_ex1
,
m_ex2
,
m_shift
);
m_render_topo_boundary
->
updateDataBoundary
<
PFP
>
(
myMap
,
position
,
m_ex1
,
m_ex2
,
m_shift
);
}
}
...
@@ -309,8 +309,12 @@ void MyQT::updateMap()
...
@@ -309,8 +309,12 @@ void MyQT::updateMap()
void
MyQT
::
cb_initGL
()
void
MyQT
::
cb_initGL
()
{
{
glClearColor
(
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
);
glClearColor
(
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
);
m_render_topo
=
new
Algo
::
Render
::
GL2
::
Topo3Render
()
;
#ifdef PRIMAL_TOPO
m_render_topo
=
new
Algo
::
Render
::
GL2
::
Topo3PrimalRender
()
;
#else
m_render_topo
=
new
Algo
::
Render
::
GL2
::
Topo3Render
()
;
#endif
m_render_topo_boundary
=
new
Algo
::
Render
::
GL2
::
TopoRender
();
m_render_topo_boundary
=
new
Algo
::
Render
::
GL2
::
TopoRender
();
m_render_topo_boundary
->
setInitialDartsColor
(
0.0
f
,
0.9
f
,
0.0
f
);
m_render_topo_boundary
->
setInitialDartsColor
(
0.0
f
,
0.9
f
,
0.0
f
);
...
@@ -352,7 +356,7 @@ void MyQT::cb_redraw()
...
@@ -352,7 +356,7 @@ void MyQT::cb_redraw()
m_render_topo
->
drawTopo
();
m_render_topo
->
drawTopo
();
m_render_topo_boundary
->
drawTopo
();
//
m_render_topo_boundary->drawTopo();
glDisable
(
GL_POLYGON_OFFSET_FILL
);
glDisable
(
GL_POLYGON_OFFSET_FILL
);
...
@@ -417,15 +421,6 @@ void MyQT::cb_mousePress(int button, int x, int y)
...
@@ -417,15 +421,6 @@ void MyQT::cb_mousePress(int button, int x, int y)
if
(
Control
())
if
(
Control
())
{
{
// Dart d = m_render_topo->picking<PFP>(myMap, x,y/*, nb*/);
// if (button == Qt::LeftButton)
// {
// if (d != Dart::nil())
// m_selecteds.push_back(d);
// }
// updateGL();
if
(
button
==
Qt
::
LeftButton
)
if
(
button
==
Qt
::
LeftButton
)
{
{
Dart
d
=
m_render_topo_boundary
->
picking
<
PFP
>
(
myMap
,
x
,
y
,
true
);
Dart
d
=
m_render_topo_boundary
->
picking
<
PFP
>
(
myMap
,
x
,
y
,
true
);
...
@@ -440,6 +435,7 @@ void MyQT::cb_mousePress(int button, int x, int y)
...
@@ -440,6 +435,7 @@ void MyQT::cb_mousePress(int button, int x, int y)
Dart
d
=
m_render_topo
->
picking
<
PFP
>
(
myMap
,
x
,
y
/*, nb*/
);
Dart
d
=
m_render_topo
->
picking
<
PFP
>
(
myMap
,
x
,
y
/*, nb*/
);
if
(
d
!=
Dart
::
nil
())
if
(
d
!=
Dart
::
nil
())
{
{
m_selecteds
.
push_back
(
d
);
Dart
e
=
myMap
.
phi2
(
d
);
Dart
e
=
myMap
.
phi2
(
d
);
std
::
cout
<<
"Dart "
<<
d
.
index
<<
" / phi2:"
<<
e
.
index
<<
std
::
endl
;
std
::
cout
<<
"Dart "
<<
d
.
index
<<
" / phi2:"
<<
e
.
index
<<
std
::
endl
;
}
}
...
@@ -586,51 +582,108 @@ void MyQT::cb_keyPress(int keycode)
...
@@ -586,51 +582,108 @@ void MyQT::cb_keyPress(int keycode)
case
'w'
:
case
'w'
:
m_ex1
=
0.99
f
;
m_ex1
=
0.99
f
;
m_ex2
=
0.99
f
;
m_ex2
=
0.99
f
;
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
m_ex1
,
m_ex2
,
m_ex3
/*, nb*/
);
#ifdef PRIMAL_TOPO
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
m_ex1
,
m_ex2
);
#else
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
m_ex1
,
m_ex2
,
m_ex3
);
#endif
updateGL
();
updateGL
();
break
;
break
;
case
'W'
:
case
'W'
:
m_ex1
=
0.95
f
;
m_ex1
=
0.95
f
;
m_ex2
=
0.95
f
;
m_ex2
=
0.95
f
;
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
m_ex1
,
m_ex2
,
m_ex3
/*, nb*/
);
#ifdef PRIMAL_TOPO
updateGL
();
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
m_ex1
,
m_ex2
);
break
;
#else
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
m_ex1
,
m_ex2
,
m_ex3
);
// case 'c':
#endif
// for (Dart d=myMap.begin(); d!=myMap.end(); myMap.next(d))
updateGL
();
// {
break
;
// if (!myMap.isBoundaryMarked3(d))
case
'-'
:
// {
if
(
Control
())
// int n = random();
m_ex2
-=
0.05
f
;
// float r = float(n&0x7f)/255.0f + 0.25f;
else