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
9b508e0e
Commit
9b508e0e
authored
Feb 19, 2013
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolve problem with getShader
parent
bd3680d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
14 deletions
+22
-14
Apps/Examples/volumeExplorer.cpp
Apps/Examples/volumeExplorer.cpp
+17
-14
Apps/Examples/volumeExplorer.h
Apps/Examples/volumeExplorer.h
+5
-0
No files found.
Apps/Examples/volumeExplorer.cpp
View file @
9b508e0e
...
...
@@ -74,16 +74,16 @@ void MyQT::clipping_onoff(bool x)
Geom
::
Vec3f
normal
=
m_PlanePick
->
getAxisScale
(
2
,
pipo
);
// 2 = Z axis = plane normal
float
d
=
-
(
pos
*
normal
);
m_explode_render
->
setClippingPlane
(
Geom
::
Vec4f
(
normal
[
0
],
normal
[
1
],
normal
[
2
],
d
));
m_
topo_render
->
shader1
()
->
setClipPlaneParamsAll
(
clip_id1
,
normal
,
pos
);
m_
topo_render
->
shader2
()
->
setClipPlaneParamsAll
(
clip_id2
,
normal
,
pos
);
m_
sh1
->
setClipPlaneParamsAll
(
clip_id1
,
normal
,
pos
);
m_
sh2
->
setClipPlaneParamsAll
(
clip_id2
,
normal
,
pos
);
}
else
{
m_explode_render
->
setNoClippingPlane
();
m_
topo_render
->
shader1
()
->
setClipPlaneParamsAll
(
clip_id1
,
Geom
::
Vec3f
(
0
,
0
,
1
),
Geom
::
Vec3f
(
0
,
0
,
999999.9
f
));
m_
topo_render
->
shader2
()
->
setClipPlaneParamsAll
(
clip_id2
,
Geom
::
Vec3f
(
0
,
0
,
1
),
Geom
::
Vec3f
(
0
,
0
,
999999.9
f
));
m_
topo_render
->
shader1
()
->
setClipColorAttenuationFactorRelative
(
0.0
f
,
0.0
f
);
m_
topo_render
->
shader2
()
->
setClipColorAttenuationFactorRelative
(
0.0
f
,
0.0
f
);
m_
sh1
->
setClipPlaneParamsAll
(
clip_id1
,
Geom
::
Vec3f
(
0
,
0
,
1
),
Geom
::
Vec3f
(
0
,
0
,
999999.9
f
));
m_
sh2
->
setClipPlaneParamsAll
(
clip_id2
,
Geom
::
Vec3f
(
0
,
0
,
1
),
Geom
::
Vec3f
(
0
,
0
,
999999.9
f
));
m_
sh1
->
setClipColorAttenuationFactorRelative
(
0.0
f
,
0.0
f
);
m_
sh2
->
setClipColorAttenuationFactorRelative
(
0.0
f
,
0.0
f
);
}
updateGL
();
}
...
...
@@ -213,6 +213,9 @@ void MyQT::cb_initGL()
m_explode_render
->
setBackColor
(
Geom
::
Vec4f
(
0.9
f
,
0.9
f
,
0.9
f
,
1.0
f
));
m_explode_render
->
setColorLine
(
Geom
::
Vec4f
(
0.8
f
,
0.2
f
,
0.2
f
,
1.0
f
));
m_sh1
=
static_cast
<
Utils
::
ClippingShader
*>
(
m_topo_render
->
shader1
());
m_sh2
=
static_cast
<
Utils
::
ClippingShader
*>
(
m_topo_render
->
shader2
());
registerShader
(
m_explode_render
->
shaderFaces
());
registerShader
(
m_explode_render
->
shaderLines
());
...
...
@@ -221,14 +224,14 @@ void MyQT::cb_initGL()
m_frame
->
setSize
(
m_WidthObj
/
2.0
f
);
m_
topo_render
->
shader1
()
->
insertClippingCode
();
m_
topo_render
->
shader2
()
->
insertClippingCode
();
m_
sh1
->
insertClippingCode
();
m_
sh2
->
insertClippingCode
();
clip_id1
=
m_
topo_render
->
shader1
()
->
addClipPlane
();
clip_id2
=
m_
topo_render
->
shader2
()
->
addClipPlane
();
clip_id1
=
m_
sh1
->
addClipPlane
();
clip_id2
=
m_
sh2
->
addClipPlane
();
m_
topo_render
->
shader1
()
->
setClipPlaneParamsAll
(
clip_id1
,
Geom
::
Vec3f
(
0
,
0
,
1
),
m_PosObj
);
m_
topo_render
->
shader2
()
->
setClipPlaneParamsAll
(
clip_id2
,
Geom
::
Vec3f
(
0
,
0
,
1
),
m_PosObj
);
m_
sh1
->
setClipPlaneParamsAll
(
clip_id1
,
Geom
::
Vec3f
(
0
,
0
,
1
),
m_PosObj
);
m_
sh2
->
setClipPlaneParamsAll
(
clip_id2
,
Geom
::
Vec3f
(
0
,
0
,
1
),
m_PosObj
);
m_explode_render
->
setClippingPlane
(
Geom
::
Vec4f
(
0
,
0
,
1
,
m_PosObj
*
Geom
::
Vec3f
(
0
,
0
,
-
1
)));
}
...
...
@@ -356,8 +359,8 @@ void MyQT::cb_mouseMove(int buttons, int x, int y)
float
d
=
-
(
pos
*
normal
);
m_explode_render
->
setClippingPlane
(
Geom
::
Vec4f
(
normal
[
0
],
normal
[
1
],
normal
[
2
],
d
));
m_
topo_render
->
shader1
()
->
setClipPlaneParamsAll
(
clip_id1
,
normal
,
pos
);
m_
topo_render
->
shader2
()
->
setClipPlaneParamsAll
(
clip_id2
,
normal
,
pos
);
m_
sh1
->
setClipPlaneParamsAll
(
clip_id1
,
normal
,
pos
);
m_
sh2
->
setClipPlaneParamsAll
(
clip_id2
,
normal
,
pos
);
m_begX
=
x
;
m_begY
=
y
;
...
...
Apps/Examples/volumeExplorer.h
View file @
9b508e0e
...
...
@@ -98,6 +98,11 @@ class MyQT: public Utils::QT::SimpleQT
int
clip_id1
;
int
clip_id2
;
// shader of toporender3
Utils
::
ClippingShader
*
m_sh1
;
Utils
::
ClippingShader
*
m_sh2
;
public:
float
m_WidthObj
;
Geom
::
Vec3f
m_PosObj
;
...
...
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