Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Hurstel
CGoGN
Commits
d60b4130
Commit
d60b4130
authored
Mar 20, 2012
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Plain Diff
Merge cgogn:~thery/CGoGN
parents
871ced88
473a80e0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
12 deletions
+70
-12
Apps/Examples/volumeExplorer.cpp
Apps/Examples/volumeExplorer.cpp
+1
-1
Apps/Tuto/show_traversors.cpp
Apps/Tuto/show_traversors.cpp
+64
-10
Apps/Tuto/show_traversors.h
Apps/Tuto/show_traversors.h
+4
-1
include/Algo/Render/GL2/topo3Render.hpp
include/Algo/Render/GL2/topo3Render.hpp
+1
-0
No files found.
Apps/Examples/volumeExplorer.cpp
View file @
d60b4130
...
...
@@ -354,7 +354,7 @@ int main(int argc, char **argv)
{
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
Algo
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
myMap
,
position
);
int
nb
=
32
;
int
nb
=
8
;
prim
.
hexaGrid_topo
(
nb
,
nb
,
nb
);
prim
.
embedHexaGrid
(
1.0
f
,
1.0
f
,
1.0
f
);
...
...
Apps/Tuto/show_traversors.cpp
View file @
d60b4130
...
...
@@ -125,6 +125,7 @@ void MyQT::cb_initGL()
SelectorDartNoBoundary
<
PFP
::
MAP
>
nb
(
myMap
);
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
0.95
f
,
0.9
f
,
0.8
f
,
nb
);
m_dm_topo
=
new
DartMarker
(
myMap
);
}
...
...
@@ -135,8 +136,8 @@ void MyQT::cb_redraw()
m_render_topo
->
drawTopo
();
if
(
m_selected
!=
NIL
)
m_render_topo
->
overdrawDart
(
m_selected
,
6
,
1.0
f
,
0.0
f
,
1.0
f
);
m_render_topo
->
overdrawDart
(
m_selected
,
7
,
1.0
f
,
0.0
f
,
1.0
f
);
for
(
std
::
vector
<
Dart
>::
iterator
it
=
m_affDarts
.
begin
();
it
!=
m_affDarts
.
end
();
++
it
)
{
m_render_topo
->
overdrawDart
(
*
it
,
6
,
1.0
f
,
1.0
f
,
1.0
f
);
...
...
@@ -165,9 +166,33 @@ void MyQT::cb_mousePress(int button, int x, int y)
void
MyQT
::
cb_Save
()
{
// 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
(
modelViewMatrix
(),
projectionMatrix
());
m_drawer
.
toSVG
(
svg1
);
svg1
.
addOpacityAnimation
(
1.0
f
);
svg1
.
addOpacityAnimation
(
1.0
f
);
svg1
.
addOpacityAnimation
(
0.0
f
);
Utils
::
SVG
::
SVGOut
svg2
(
modelViewMatrix
(),
projectionMatrix
());
m_render_topo
->
toSVG
(
svg2
);
svg2
.
addOpacityAnimation
(
1.0
f
);
svg2
.
addOpacityAnimation
(
0.0
f
);
svg2
.
addOpacityAnimation
(
1.0
f
);
Utils
::
SVG
::
AnimatedSVGOut
anim
;
anim
.
add
(
&
svg1
);
anim
.
add
(
&
svg2
);
std
::
string
filename
=
selectFileSave
(
"Export SVG file "
,
"."
,
"(*.svg)"
);
Utils
::
SVG
::
SVGOut
svg
(
filename
,
modelViewMatrix
(),
projectionMatrix
());
m_drawer
.
toSVG
(
svg
);
anim
.
write
(
filename
,
2.0
f
);
}
void
MyQT
::
colorizeCell
(
Dart
d
,
unsigned
int
orbit
,
float
r
,
float
g
,
float
b
)
...
...
@@ -187,8 +212,8 @@ void MyQT::traverse2()
SelectorDartNoBoundary
<
PFP
::
MAP
>
nb
(
myMap
);
m_drawer
.
newList
(
GL_COMPILE
);
m_drawer
.
lineWidth
(
3
.0
f
);
m_drawer
.
pointSize
(
7
.0
f
);
m_drawer
.
lineWidth
(
7
.0
f
);
m_drawer
.
pointSize
(
9
.0
f
);
m_drawer
.
color3f
(
0.0
f
,
0.7
f
,
0.0
f
);
m_affDarts
.
clear
();
...
...
@@ -216,6 +241,10 @@ void MyQT::traverse2()
}
m_drawer
.
endList
();
SelectorMarked
sm
(
*
m_dm_topo
);
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
0.95
f
,
0.9
f
,
0.8
f
,
sm
);
updateGL
();
}
...
...
@@ -232,30 +261,55 @@ void MyQT::traverse3()
m_affDarts
.
clear
();
m_drawer
.
newList
(
GL_COMPILE
);
m_drawer
.
lineWidth
(
3
.0
f
);
m_drawer
.
pointSize
(
7
.0
f
);
m_drawer
.
lineWidth
(
7
.0
f
);
m_drawer
.
pointSize
(
9
.0
f
);
m_drawer
.
color3f
(
0.0
f
,
0.7
f
,
0.0
f
);
m_dm_topo
->
unmarkAll
();
SelectorMarked
sm
(
*
m_dm_topo
);
if
(
m_ajd_or_inci3
==
0
)
// incident
{
Algo
::
Render
::
drawerCell
<
PFP
>
(
VERTEX
+
m_second3
,
m_drawer
,
myMap
,
m_selected
,
position
,
m_expl
);
m_dm_topo
->
markOrbit
(
VERTEX
+
m_second3
,
m_selected
);
m_drawer
.
color3f
(
1.0
f
,
0.0
f
,
0.0
f
);
Traversor3XY
<
PFP
::
MAP
>
tra
(
myMap
,
m_selected
,
VERTEX
+
m_second3
,
VERTEX
+
m_first3
);
for
(
Dart
d
=
tra
.
begin
();
d
!=
tra
.
end
();
d
=
tra
.
next
())
m_affDarts
.
push_back
(
d
);
{
m_affDarts
.
push_back
(
d
);
m_dm_topo
->
markOrbit
(
VERTEX
+
m_first3
,
d
);
}
Algo
::
Render
::
drawerCells
<
PFP
>
(
VERTEX
+
m_first3
,
m_drawer
,
myMap
,
m_affDarts
,
position
,
m_expl
);
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
0.95
f
,
0.9
f
,
0.8
f
,
sm
);
for
(
std
::
vector
<
Dart
>::
iterator
id
=
m_affDarts
.
begin
();
id
!=
m_affDarts
.
end
();
++
id
)
m_render_topo
->
setDartColor
(
*
id
,
0.7
f
,
0.0
f
,
0.0
f
);
m_render_topo
->
setDartColor
(
m_selected
,
0.0
f
,
0.7
f
,
0.0
f
);
}
else
// adjacent
{
Algo
::
Render
::
drawerCell
<
PFP
>
(
VERTEX
+
m_first3
,
m_drawer
,
myMap
,
m_selected
,
position
,
m_expl
);
m_dm_topo
->
markOrbit
(
VERTEX
+
m_first3
,
m_selected
);
m_drawer
.
color3f
(
1.0
f
,
0.0
f
,
0.0
f
);
Traversor3XXaY
<
PFP
::
MAP
>
tra
(
myMap
,
m_selected
,
VERTEX
+
m_first3
,
VERTEX
+
m_second3
);
for
(
Dart
d
=
tra
.
begin
();
d
!=
tra
.
end
();
d
=
tra
.
next
())
m_affDarts
.
push_back
(
d
);
{
m_affDarts
.
push_back
(
d
);
m_dm_topo
->
markOrbit
(
VERTEX
+
m_first3
,
d
);
}
Algo
::
Render
::
drawerCells
<
PFP
>
(
VERTEX
+
m_first3
,
m_drawer
,
myMap
,
m_affDarts
,
position
,
m_expl
);
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
0.95
f
,
0.9
f
,
0.8
f
,
sm
);
for
(
std
::
vector
<
Dart
>::
iterator
id
=
m_affDarts
.
begin
();
id
!=
m_affDarts
.
end
();
++
id
)
m_render_topo
->
setDartColor
(
*
id
,
0.7
f
,
0.0
f
,
0.0
f
);
m_render_topo
->
setDartColor
(
m_selected
,
0.0
f
,
0.7
f
,
0.0
f
);
}
m_drawer
.
endList
();
updateGL
();
}
...
...
Apps/Tuto/show_traversors.h
View file @
d60b4130
...
...
@@ -110,7 +110,8 @@ public:
m_second2
(
1
),
m_expl
(
0.8
f
),
m_last
(
2
),
m_selected
(
NIL
)
m_selected
(
NIL
),
m_dm_topo
(
NULL
)
{}
...
...
@@ -119,6 +120,8 @@ public:
Utils
::
Drawer
m_drawer
;
DartMarker
*
m_dm_topo
;
protected:
void
storeVerticesInfo
();
...
...
include/Algo/Render/GL2/topo3Render.hpp
View file @
d60b4130
...
...
@@ -515,6 +515,7 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const typename PFP::T
*
positionF1
++
=
fv1
[
d
];
d
=
map
.
beta1
(
d
);
*
positionF1
++
=
fv1
[
d
];
m_nbRel1
++
;
}
while
(
d
!=
*
face
);
}
...
...
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