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
CGoGN
CGoGN
Commits
c1635bb8
Commit
c1635bb8
authored
May 05, 2015
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of icube-forge.unistra.fr:cgogn/cgogn into develop
parents
041bfaed
d61d1583
Changes
44
Show whitespace changes
Inline
Side-by-side
Showing
44 changed files
with
1489 additions
and
218 deletions
+1489
-218
Apps/Examples/frame_manip.cpp
Apps/Examples/frame_manip.cpp
+2
-2
Apps/Examples/mcmesh.cpp
Apps/Examples/mcmesh.cpp
+45
-8
Apps/Examples/mcmesh.h
Apps/Examples/mcmesh.h
+7
-0
Apps/Examples/volumeExplorer.cpp
Apps/Examples/volumeExplorer.cpp
+2
-0
CGoGN/include/Algo/Modelisation/subdivision.hpp
CGoGN/include/Algo/Modelisation/subdivision.hpp
+8
-8
CGoGN/include/Container/attributeMultiVectorBool.hpp
CGoGN/include/Container/attributeMultiVectorBool.hpp
+1
-1
CGoGN/include/Container/sizeblock.h
CGoGN/include/Container/sizeblock.h
+0
-1
CGoGN/include/Utils/Shaders/shaderBoldColorLines.frag
CGoGN/include/Utils/Shaders/shaderBoldColorLines.frag
+17
-0
CGoGN/include/Utils/Shaders/shaderBoldColorLines.geom
CGoGN/include/Utils/Shaders/shaderBoldColorLines.geom
+39
-0
CGoGN/include/Utils/Shaders/shaderBoldColorLines.h
CGoGN/include/Utils/Shaders/shaderBoldColorLines.h
+91
-0
CGoGN/include/Utils/Shaders/shaderBoldColorLines.vert
CGoGN/include/Utils/Shaders/shaderBoldColorLines.vert
+15
-0
CGoGN/include/Utils/Shaders/shaderBoldLines.frag
CGoGN/include/Utils/Shaders/shaderBoldLines.frag
+14
-0
CGoGN/include/Utils/Shaders/shaderBoldLines.geom
CGoGN/include/Utils/Shaders/shaderBoldLines.geom
+31
-0
CGoGN/include/Utils/Shaders/shaderBoldLines.h
CGoGN/include/Utils/Shaders/shaderBoldLines.h
+88
-0
CGoGN/include/Utils/Shaders/shaderBoldLines.vert
CGoGN/include/Utils/Shaders/shaderBoldLines.vert
+12
-0
CGoGN/include/Utils/drawer.h
CGoGN/include/Utils/drawer.h
+10
-3
CGoGN/include/Utils/frameManipulator.h
CGoGN/include/Utils/frameManipulator.h
+3
-1
CGoGN/include/Utils/pickables.h
CGoGN/include/Utils/pickables.h
+8
-4
CGoGN/src/Utils/Shaders/shaderBoldColorLines.cpp
CGoGN/src/Utils/Shaders/shaderBoldColorLines.cpp
+167
-0
CGoGN/src/Utils/Shaders/shaderBoldLines.cpp
CGoGN/src/Utils/Shaders/shaderBoldLines.cpp
+154
-0
CGoGN/src/Utils/drawer.cpp
CGoGN/src/Utils/drawer.cpp
+141
-64
CGoGN/src/Utils/frameManipulator.cpp
CGoGN/src/Utils/frameManipulator.cpp
+81
-45
CGoGN/src/Utils/pickables.cpp
CGoGN/src/Utils/pickables.cpp
+27
-14
SCHNApps/Plugins/surface_modelisation/src/surface_modelisation.cpp
...Plugins/surface_modelisation/src/surface_modelisation.cpp
+2
-1
SCHNApps/Plugins/surface_radiance/include/edgeSelectorRadiance.hpp
...Plugins/surface_radiance/include/edgeSelectorRadiance.hpp
+1
-1
SCHNApps/Plugins/surface_radiance/include/halfEdgeSelectorRadiance.hpp
...ins/surface_radiance/include/halfEdgeSelectorRadiance.hpp
+1
-1
SCHNApps/Plugins/surface_selection/src/surface_selection.cpp
SCHNApps/Plugins/surface_selection/src/surface_selection.cpp
+8
-3
SCHNApps/Plugins/surface_subdivision/forms/dialog_surface_subdivision.ui
...s/surface_subdivision/forms/dialog_surface_subdivision.ui
+40
-26
SCHNApps/Plugins/surface_subdivision/include/surface_subdivision.h
...Plugins/surface_subdivision/include/surface_subdivision.h
+14
-6
SCHNApps/Plugins/surface_subdivision/src/surface_subdivision.cpp
...s/Plugins/surface_subdivision/src/surface_subdivision.cpp
+71
-5
SCHNApps/forms/controlDock_MapTabWidget.ui
SCHNApps/forms/controlDock_MapTabWidget.ui
+28
-0
SCHNApps/include/camera.h
SCHNApps/include/camera.h
+3
-0
SCHNApps/include/controlDock_mapTab.h
SCHNApps/include/controlDock_mapTab.h
+4
-0
SCHNApps/include/mapHandler.h
SCHNApps/include/mapHandler.h
+16
-5
SCHNApps/include/mapHandler.hpp
SCHNApps/include/mapHandler.hpp
+1
-1
SCHNApps/include/plugin_interaction.h
SCHNApps/include/plugin_interaction.h
+4
-0
SCHNApps/include/schnapps.h
SCHNApps/include/schnapps.h
+10
-1
SCHNApps/src/camera.cpp
SCHNApps/src/camera.cpp
+29
-0
SCHNApps/src/controlDock_mapTab.cpp
SCHNApps/src/controlDock_mapTab.cpp
+54
-1
SCHNApps/src/mapHandler.cpp
SCHNApps/src/mapHandler.cpp
+1
-0
SCHNApps/src/plugin_interaction.cpp
SCHNApps/src/plugin_interaction.cpp
+13
-0
SCHNApps/src/schnapps.cpp
SCHNApps/src/schnapps.cpp
+211
-8
SCHNApps/src/view.cpp
SCHNApps/src/view.cpp
+9
-6
apps_cmake.txt
apps_cmake.txt
+6
-2
No files found.
Apps/Examples/frame_manip.cpp
View file @
c1635bb8
...
@@ -134,9 +134,9 @@ void MyQT::cb_redraw()
...
@@ -134,9 +134,9 @@ void MyQT::cb_redraw()
for
(
std
::
vector
<
Utils
::
Pickable
*>::
iterator
it
=
m_pickables
.
begin
();
it
!=
m_pickables
.
end
();
++
it
)
for
(
std
::
vector
<
Utils
::
Pickable
*>::
iterator
it
=
m_pickables
.
begin
();
it
!=
m_pickables
.
end
();
++
it
)
{
{
if
(
*
it
==
m_lastPickedObject
)
if
(
*
it
==
m_lastPickedObject
)
gl
LineWidth
(
2
.0
);
(
*
it
)
->
set
LineWidth
(
3
.0
);
else
else
gl
LineWidth
(
1.0
);
(
*
it
)
->
set
LineWidth
(
1.0
);
(
*
it
)
->
draw
();
(
*
it
)
->
draw
();
}
}
...
...
Apps/Examples/mcmesh.cpp
View file @
c1635bb8
...
@@ -29,7 +29,8 @@ MCMesh::MCMesh() :
...
@@ -29,7 +29,8 @@ MCMesh::MCMesh() :
m_drawFaces
(
true
),
m_drawFaces
(
true
),
m_render
(
NULL
),
m_render
(
NULL
),
m_flatShader
(
NULL
),
m_flatShader
(
NULL
),
m_simpleColorShader
(
NULL
)
m_simpleColorShader
(
NULL
),
m_linesShader
(
NULL
)
{}
{}
void
MCMesh
::
initGUI
()
void
MCMesh
::
initGUI
()
...
@@ -58,31 +59,67 @@ void MCMesh::cb_initGL()
...
@@ -58,31 +59,67 @@ void MCMesh::cb_initGL()
m_flatShader
->
setDiffuse
(
colDif
);
m_flatShader
->
setDiffuse
(
colDif
);
m_flatShader
->
setExplode
(
1.0
f
);
m_flatShader
->
setExplode
(
1.0
f
);
m_simpleColorShader
=
new
Utils
::
ShaderSimpleColor
();
//m_simpleColorShader = new Utils::ShaderSimpleColor();
m_simpleColorShader
->
setAttributePosition
(
m_positionVBO
);
//m_simpleColorShader->setAttributePosition(m_positionVBO);
m_linesShader
=
new
Utils
::
ShaderBoldLines
();
m_linesShader
->
setAttributePosition
(
m_positionVBO
);
registerShader
(
m_flatShader
);
registerShader
(
m_flatShader
);
registerShader
(
m_simpleColorShader
);
// registerShader(m_simpleColorShader);
registerShader
(
m_linesShader
);
m_dr
=
new
Utils
::
Drawer
();
m_dr
->
newList
();
m_dr
->
pointSize
(
4.0
f
);
m_dr
->
lineWidth
(
25.0
f
);
m_dr
->
begin
(
GL_LINES
);
m_dr
->
color3f
(
1.0
,
0.0
,
0.0
);
m_dr
->
vertex3f
(
15.0
,
15.0
,
65.0
);
m_dr
->
vertex3f
(
110.0
,
110.0
,
65.0
);
m_dr
->
color3f
(
0.0
,
1.0
,
0.0
);
m_dr
->
vertex3f
(
110.0
,
15.0
,
75.0
);
m_dr
->
vertex3f
(
15.0
,
110.0
,
75.0
);
m_dr
->
end
();
m_dr
->
endList
();
}
}
void
MCMesh
::
cb_redraw
()
void
MCMesh
::
cb_redraw
()
{
{
glEnable
(
GL_BLEND
);
m_dr
->
callList
(
0.1
f
);
if
(
m_drawEdges
)
if
(
m_drawEdges
)
// {
// glLineWidth(1.0f);
// if (m_drawFaces)
// {
// Geom::Vec4f c(0.0f, 0.0f, 0.0f, 0.0f);
// m_simpleColorShader->setColor(c);
// }
// else
// {
// Geom::Vec4f c(1.0f, 1.0f, 0.0f, 0.0f);
// m_simpleColorShader->setColor(c);
// }
// m_render->draw(m_simpleColorShader, Algo::Render::GL2::LINES);
// }
{
{
gl
LineWidth
(
1
.0
f
);
m_linesShader
->
set
LineWidth
(
2
.0
f
);
if
(
m_drawFaces
)
if
(
m_drawFaces
)
{
{
Geom
::
Vec4f
c
(
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
);
Geom
::
Vec4f
c
(
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
);
m_
simpleColor
Shader
->
setColor
(
c
);
m_
lines
Shader
->
setColor
(
c
);
}
}
else
else
{
{
Geom
::
Vec4f
c
(
1.0
f
,
1.0
f
,
0.0
f
,
0.0
f
);
Geom
::
Vec4f
c
(
1.0
f
,
1.0
f
,
0.0
f
,
0.0
f
);
m_
simpleColor
Shader
->
setColor
(
c
);
m_
lines
Shader
->
setColor
(
c
);
}
}
m_render
->
draw
(
m_
simpleColor
Shader
,
Algo
::
Render
::
GL2
::
LINES
);
m_render
->
draw
(
m_
lines
Shader
,
Algo
::
Render
::
GL2
::
LINES
);
}
}
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_FILL
);
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_FILL
);
glEnable
(
GL_LIGHTING
);
glEnable
(
GL_LIGHTING
);
glEnable
(
GL_POLYGON_OFFSET_FILL
);
glEnable
(
GL_POLYGON_OFFSET_FILL
);
...
...
Apps/Examples/mcmesh.h
View file @
c1635bb8
...
@@ -39,9 +39,11 @@
...
@@ -39,9 +39,11 @@
#include "Algo/Render/GL2/mapRender.h"
#include "Algo/Render/GL2/mapRender.h"
#include "Utils/Shaders/shaderFlat.h"
#include "Utils/Shaders/shaderFlat.h"
#include "Utils/Shaders/shaderSimpleColor.h"
#include "Utils/Shaders/shaderSimpleColor.h"
#include "Utils/Shaders/shaderBoldLines.h"
#include "Utils/vbo.h"
#include "Utils/vbo.h"
#include "Algo/Geometry/boundingbox.h"
#include "Algo/Geometry/boundingbox.h"
#include "Utils/drawer.h"
using
namespace
CGoGN
;
using
namespace
CGoGN
;
...
@@ -79,9 +81,14 @@ public:
...
@@ -79,9 +81,14 @@ public:
Algo
::
Render
::
GL2
::
MapRender
*
m_render
;
Algo
::
Render
::
GL2
::
MapRender
*
m_render
;
Utils
::
VBO
*
m_positionVBO
;
Utils
::
VBO
*
m_positionVBO
;
Utils
::
VBO
*
m_colorVBO
;
Utils
::
ShaderFlat
*
m_flatShader
;
Utils
::
ShaderFlat
*
m_flatShader
;
Utils
::
ShaderSimpleColor
*
m_simpleColorShader
;
Utils
::
ShaderSimpleColor
*
m_simpleColorShader
;
Utils
::
ShaderBoldLines
*
m_linesShader
;
Utils
::
Drawer
*
m_dr
;
DATATYPE
valLabel
;
DATATYPE
valLabel
;
SAlgo
::
MC
::
Image
<
DATATYPE
>*
myImg
;
SAlgo
::
MC
::
Image
<
DATATYPE
>*
myImg
;
...
...
Apps/Examples/volumeExplorer.cpp
View file @
c1635bb8
...
@@ -218,6 +218,7 @@ void MyQT::cb_initGL()
...
@@ -218,6 +218,7 @@ void MyQT::cb_initGL()
registerShader
(
m_explode_render
->
shaderLines
());
registerShader
(
m_explode_render
->
shaderLines
());
m_PlanePick
=
new
Utils
::
Pickable
(
Utils
::
Pickable
::
GRID
,
1
);
m_PlanePick
=
new
Utils
::
Pickable
(
Utils
::
Pickable
::
GRID
,
1
);
m_PlanePick
->
drawable
()
->
setColor
(
Geom
::
Vec4f
(
1.0
f
,
1.0
f
,
0.0
f
,
0.0
f
));
m_frame
=
new
Utils
::
FrameManipulator
();
m_frame
=
new
Utils
::
FrameManipulator
();
m_frame
->
setSize
(
m_WidthObj
/
2.0
f
);
m_frame
->
setSize
(
m_WidthObj
/
2.0
f
);
...
@@ -254,6 +255,7 @@ void MyQT::cb_redraw()
...
@@ -254,6 +255,7 @@ void MyQT::cb_redraw()
if
(
clip_volume
&&
!
hide_clipping
)
if
(
clip_volume
&&
!
hide_clipping
)
{
{
m_frame
->
draw
();
m_frame
->
draw
();
m_PlanePick
->
setLineWidth
(
2.0
f
);
m_PlanePick
->
draw
();
m_PlanePick
->
draw
();
}
}
...
...
CGoGN/include/Algo/Modelisation/subdivision.hpp
View file @
c1635bb8
...
@@ -442,7 +442,7 @@ void CatmullClarkInterpolSubdivision(typename PFP::MAP& map, EMBV& attributs)
...
@@ -442,7 +442,7 @@ void CatmullClarkInterpolSubdivision(typename PFP::MAP& map, EMBV& attributs)
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
EMBV
::
DATA_TYPE
EMB
;
typedef
typename
EMBV
::
DATA_TYPE
EMB
;
VertexAutoAttribute
<
EMB
,
PFP
::
MAP
>
facesAverage
(
map
);
VertexAutoAttribute
<
EMB
,
typename
PFP
::
MAP
>
facesAverage
(
map
);
std
::
vector
<
Dart
>
l_vertices
;
std
::
vector
<
Dart
>
l_vertices
;
std
::
vector
<
Dart
>
l_edges
;
std
::
vector
<
Dart
>
l_edges
;
...
@@ -464,14 +464,14 @@ void CatmullClarkInterpolSubdivision(typename PFP::MAP& map, EMBV& attributs)
...
@@ -464,14 +464,14 @@ void CatmullClarkInterpolSubdivision(typename PFP::MAP& map, EMBV& attributs)
{
{
if
(
!
me
.
isMarked
(
d
))
if
(
!
me
.
isMarked
(
d
))
{
{
mf
.
markOrbit
<
EDGE
>
(
d
);
mf
.
template
markOrbit
<
EDGE
>(
d
);
Dart
f
=
map
.
phi1
(
d
);
Dart
f
=
map
.
phi1
(
d
);
Dart
e
=
map
.
cutEdge
(
d
);
Dart
e
=
map
.
cutEdge
(
d
);
attributs
[
e
]
=
(
attributs
[
d
]
+
attributs
[
f
])
/
2.0
;
attributs
[
e
]
=
(
attributs
[
d
]
+
attributs
[
f
])
/
2.0
;
me
.
template
markOrbit
<
EDGE
>(
d
);
me
.
template
markOrbit
<
EDGE
>(
d
);
me
.
template
markOrbit
<
EDGE
>(
e
);
me
.
template
markOrbit
<
EDGE
>(
e
);
// warning store the dart that does not belong to the boundary
// warning store the dart that does not belong to the boundary
if
(
map
.
isBoundaryMarked
<
2
>
(
e
))
if
(
map
.
template
isBoundaryMarked
<
2
>(
e
))
l_edges
.
push_back
(
map
.
phi2
(
d
));
l_edges
.
push_back
(
map
.
phi2
(
d
));
else
else
l_edges
.
push_back
(
e
);
l_edges
.
push_back
(
e
);
...
@@ -522,7 +522,7 @@ void CatmullClarkInterpolSubdivision(typename PFP::MAP& map, EMBV& attributs)
...
@@ -522,7 +522,7 @@ void CatmullClarkInterpolSubdivision(typename PFP::MAP& map, EMBV& attributs)
// compute face average of "edges"
// compute face average of "edges"
for
(
Dart
e
:
l_edges
)
for
(
Dart
e
:
l_edges
)
{
{
if
(
!
map
.
isBoundaryMarked
<
2
>
(
map
.
phi2
(
e
)))
// faster than map.isBoundaryEdge(e)
if
(
!
map
.
template
isBoundaryMarked
<
2
>(
map
.
phi2
(
e
)))
// faster than map.isBoundaryEdge(e)
{
{
Dart
ff
=
map
.
phi_1
(
e
);
Dart
ff
=
map
.
phi_1
(
e
);
Dart
f
=
map
.
template
phi
<
211
>(
e
);
Dart
f
=
map
.
template
phi
<
211
>(
e
);
...
@@ -537,10 +537,10 @@ void CatmullClarkInterpolSubdivision(typename PFP::MAP& map, EMBV& attributs)
...
@@ -537,10 +537,10 @@ void CatmullClarkInterpolSubdivision(typename PFP::MAP& map, EMBV& attributs)
{
{
Dart
xb
=
map
.
phi2
(
x
);
Dart
xb
=
map
.
phi2
(
x
);
if
(
map
.
isBoundaryMarked
<
2
>
(
x
))
if
(
map
.
template
isBoundaryMarked
<
2
>(
x
))
std
::
cout
<<
"ERROR "
<<
attributs
[
x
];
std
::
cout
<<
"ERROR "
<<
attributs
[
x
];
if
(
!
map
.
isBoundaryMarked
<
2
>
(
xb
))
if
(
!
map
.
template
isBoundaryMarked
<
2
>(
xb
))
{
{
Dart
v1
=
map
.
phi1
(
x
);
Dart
v1
=
map
.
phi1
(
x
);
Dart
v2
=
map
.
phi_1
(
map
.
phi2
(
map
.
phi_1
(
x
)));
Dart
v2
=
map
.
phi_1
(
map
.
phi2
(
map
.
phi_1
(
x
)));
...
@@ -860,11 +860,11 @@ void DooSabin(typename PFP::MAP& map, EMBV& position)
...
@@ -860,11 +860,11 @@ void DooSabin(typename PFP::MAP& map, EMBV& position)
Algo
::
Topo
::
setOrbitEmbedding
<
VERTEX
>
(
map
,
map
.
template
phi
<
11
>(
nf
),
map
.
template
getEmbedding
<
EDGE
>(
e2
));
Algo
::
Topo
::
setOrbitEmbedding
<
VERTEX
>
(
map
,
map
.
template
phi
<
11
>(
nf
),
map
.
template
getEmbedding
<
EDGE
>(
e2
));
}
}
dm
.
markOrbit
<
FACE
>
(
nf
);
dm
.
template
markOrbit
<
FACE
>(
nf
);
fp
.
push_back
(
map
.
phi1
(
nf
));
fp
.
push_back
(
map
.
phi1
(
nf
));
fp
.
push_back
(
map
.
phi_1
(
nf
));
fp
.
push_back
(
map
.
phi_1
(
nf
));
}
}
dm
.
markOrbit
<
EDGE1
>
(
e
);
dm
.
template
markOrbit
<
EDGE1
>(
e
);
e
=
map
.
phi1
(
e
);
e
=
map
.
phi1
(
e
);
}
while
(
e
!=
d
);
}
while
(
e
!=
d
);
}
}
...
...
CGoGN/include/Container/attributeMultiVectorBool.hpp
View file @
c1635bb8
...
@@ -118,7 +118,7 @@ public:
...
@@ -118,7 +118,7 @@ public:
// }
// }
for
(
unsigned
int
i
=
0
;
i
<
atmv
->
m_tableData
.
size
();
++
i
)
for
(
unsigned
int
i
=
0
;
i
<
atmv
->
m_tableData
.
size
();
++
i
)
memcpy
(
m_tableData
[
i
],
atmv
->
m_tableData
[
i
],
_BLOCKSIZE_
/
32
);
memcpy
(
m_tableData
[
i
],
atmv
->
m_tableData
[
i
],
_BLOCKSIZE_
/
8
);
return
true
;
return
true
;
}
}
...
...
CGoGN/include/Container/sizeblock.h
View file @
c1635bb8
...
@@ -28,7 +28,6 @@
...
@@ -28,7 +28,6 @@
#include "Utils/gzstream.h"
#include "Utils/gzstream.h"
#include "Utils/cgognStream.h"
#include "Utils/cgognStream.h"
//#define _BLOCKSIZE_ 4096
const
unsigned
int
_BLOCKSIZE_
=
4096
;
const
unsigned
int
_BLOCKSIZE_
=
4096
;
//typedef std::ifstream CGoGNistream;
//typedef std::ifstream CGoGNistream;
...
...
CGoGN/include/Utils/Shaders/shaderBoldColorLines.frag
0 → 100644
View file @
c1635bb8
// ShaderBoldColorLines::fragmentShaderText
PRECISION
;
VARYING_FRAG
vec3
fragColor
;
uniform
float
alpha
;
uniform
vec4
planeClip
;
VARYING_FRAG
vec3
fragClip
;
FRAG_OUT_DEF
;
void
main
()
{
if
(
dot
(
planeClip
,
vec4
(
fragClip
,
1
.
0
))
>
0
.
0
)
discard
;
FRAG_OUT
=
vec4
(
fragColor
,
alpha
);
}
CGoGN/include/Utils/Shaders/shaderBoldColorLines.geom
0 → 100644
View file @
c1635bb8
// ShaderBoldColorLines::geometryShaderText
uniform
vec2
lineWidth
;
VARYING_IN
vec3
vcolor
[];
VARYING_OUT
vec3
fragColor
;
VARYING_IN
vec3
posClip
[];
VARYING_OUT
vec3
fragClip
;
void
main
()
{
vec3
A
=
POSITION_IN
(
0
).
xyz
/
abs
(
POSITION_IN
(
0
).
w
);
vec3
B
=
POSITION_IN
(
1
).
xyz
/
abs
(
POSITION_IN
(
1
).
w
);
vec3
U
=
normalize
(
B
-
A
);
vec3
V
=
cross
(
U
,
vec3
(
0
.
0
,
0
.
0
,
1
.
0
));
vec3
LW
=
vec3
(
lineWidth
,
1
.
0
);
fragClip
=
posClip
[
0
];
fragColor
=
vcolor
[
0
];
gl_Position
=
vec4
(
A
-
U
*
LW
,
1
.
0
);
EmitVertex
();
gl_Position
=
vec4
(
A
+
V
*
LW
,
1
.
0
);
EmitVertex
();
gl_Position
=
vec4
(
A
-
V
*
LW
,
1
.
0
);
EmitVertex
();
fragColor
=
vcolor
[
1
];
fragClip
=
posClip
[
1
];
gl_Position
=
vec4
(
B
+
V
*
LW
,
1
.
0
);
EmitVertex
();
gl_Position
=
vec4
(
B
-
V
*
LW
,
1
.
0
);
EmitVertex
();
gl_Position
=
vec4
(
B
+
U
*
LW
,
1
.
0
);
EmitVertex
();
EndPrimitive
();
}
CGoGN/include/Utils/Shaders/shaderBoldColorLines.h
0 → 100644
View file @
c1635bb8
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef __CGOGN_SHADER_BOLDCOLORLINES__
#define __CGOGN_SHADER_BOLDCOLORLINES__
#include "Utils/GLSLShader.h"
#include "Utils/clippingShader.h"
#include "Geometry/vector_gen.h"
#include "Utils/dll.h"
namespace
CGoGN
{
namespace
Utils
{
class
CGoGN_UTILS_API
ShaderBoldColorLines
:
public
ClippingShader
{
protected:
// shader sources
static
std
::
string
vertexShaderText
;
static
std
::
string
geometryShaderText
;
static
std
::
string
fragmentShaderText
;
CGoGNGLuint
m_uniform_lineWidth
;
CGoGNGLuint
m_unif_alpha
;
Geom
::
Vec2f
m_lineWidth
;
float
m_pixWidth
;
VBO
*
m_vboPos
;
VBO
*
m_vboCol
;
float
m_opacity
;
/// clipping
CGoGNGLuint
m_unif_planeClip
;
Geom
::
Vec4f
m_planeClip
;
void
getLocations
();
void
sendParams
();
void
restoreUniformsAttribs
();
public:
ShaderBoldColorLines
();
void
setLineWidth
(
float
pix
);
void
updatePixelWidth
();
void
setOpacity
(
float
op
);
unsigned
int
setAttributeColor
(
VBO
*
vbo
);
unsigned
int
setAttributePosition
(
VBO
*
vbo
);
void
setClippingPlane
(
const
Geom
::
Vec4f
&
plane
);
inline
void
setNoClippingPlane
()
{
setClippingPlane
(
Geom
::
Vec4f
(
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
));
}
};
}
// namespace Utils
}
// namespace CGoGN
#endif
CGoGN/include/Utils/Shaders/shaderBoldColorLines.vert
0 → 100644
View file @
c1635bb8
// ShaderBoldColorLines::vertexShaderText
ATTRIBUTE
vec3
VertexPosition
;
ATTRIBUTE
vec3
VertexColor
;
uniform
mat4
ModelViewProjectionMatrix
;
VARYING_VERT
vec3
vcolor
;
VARYING_VERT
vec3
posClip
;
INVARIANT_POS
;
void
main
()
{
posClip
=
VertexPosition
;
vcolor
=
VertexColor
;
gl_Position
=
ModelViewProjectionMatrix
*
vec4
(
VertexPosition
,
1
.
0
);
}
CGoGN/include/Utils/Shaders/shaderBoldLines.frag
0 → 100644
View file @
c1635bb8
// ShaderBoldLines::fragmentShaderText
PRECISION
;
uniform
vec4
lineColor
;
uniform
vec4
planeClip
;
VARYING_FRAG
vec3
fragClip
;
FRAG_OUT_DEF
;
void
main
()
{
if
(
dot
(
planeClip
,
vec4
(
fragClip
,
1
.
0
))
>
0
.
0
)
discard
;
FRAG_OUT
=
lineColor
;
}
CGoGN/include/Utils/Shaders/shaderBoldLines.geom
0 → 100644
View file @
c1635bb8
// ShaderBoldLines::geometryShaderText
uniform
vec2
lineWidth
;
VARYING_IN
vec3
posClip
[];
VARYING_OUT
vec3
fragClip
;
void
main
()
{
vec3
A
=
POSITION_IN
(
0
).
xyz
/
abs
(
POSITION_IN
(
0
).
w
);
vec3
B
=
POSITION_IN
(
1
).
xyz
/
abs
(
POSITION_IN
(
1
).
w
);
vec3
U
=
normalize
(
B
-
A
);
vec3
V
=
cross
(
U
,
vec3
(
0
.
0
,
0
.
0
,
1
.
0
));
vec3
LW
=
vec3
(
lineWidth
,
1
.
0
);
fragClip
=
posClip
[
0
];
gl_Position
=
vec4
(
A
-
U
*
LW
,
1
.
0
);
EmitVertex
();
gl_Position
=
vec4
(
A
+
V
*
LW
,
1
.
0
);
EmitVertex
();
gl_Position
=
vec4
(
A
-
V
*
LW
,
1
.
0
);
EmitVertex
();
fragClip
=
posClip
[
1
];
gl_Position
=
vec4
(
B
+
V
*
LW
,
1
.
0
);
EmitVertex
();
gl_Position
=
vec4
(
B
-
V
*
LW
,
1
.
0
);
EmitVertex
();
gl_Position
=
vec4
(
B
+
U
*
LW
,
1
.
0
);
EmitVertex
();
EndPrimitive
();
}
CGoGN/include/Utils/Shaders/shaderBoldLines.h
0 → 100644
View file @
c1635bb8
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef __CGOGN_SHADER_BOLDLINES__
#define __CGOGN_SHADER_BOLDLINES__
#include "Utils/GLSLShader.h"
#include "Utils/clippingShader.h"
#include "Geometry/vector_gen.h"
#include "Utils/dll.h"
namespace
CGoGN
{
namespace
Utils
{
class
CGoGN_UTILS_API
ShaderBoldLines
:
public
ClippingShader
{
protected:
// shader sources
static
std
::
string
vertexShaderText
;
static
std
::
string
geometryShaderText
;
static
std
::
string
fragmentShaderText
;
CGoGNGLuint
m_uniform_lineWidth
;
CGoGNGLuint
m_uniform_color
;
Geom
::
Vec2f
m_lineWidth
;
float
m_pixWidth
;
Geom
::
Vec4f
m_color
;
VBO
*
m_vboPos
;
/// clipping
CGoGNGLuint
m_unif_planeClip
;
Geom
::
Vec4f
m_planeClip
;
void
getLocations
();