Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
David Cazier
CGoGN
Commits
d61d1583
Commit
d61d1583
authored
Apr 14, 2015
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into 'develop'
Develop See merge request
!64
parents
eadfb56d
b6a91c26
Changes
44
Hide 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 @
d61d1583
...
...
@@ -134,9 +134,9 @@ void MyQT::cb_redraw()
for
(
std
::
vector
<
Utils
::
Pickable
*>::
iterator
it
=
m_pickables
.
begin
();
it
!=
m_pickables
.
end
();
++
it
)
{
if
(
*
it
==
m_lastPickedObject
)
glLineWidth
(
2
.0
);
(
*
it
)
->
setLineWidth
(
3
.0
);
else
gl
LineWidth
(
1.0
);
(
*
it
)
->
set
LineWidth
(
1.0
);
(
*
it
)
->
draw
();
}
...
...
Apps/Examples/mcmesh.cpp
View file @
d61d1583
...
...
@@ -29,7 +29,8 @@ MCMesh::MCMesh() :
m_drawFaces
(
true
),
m_render
(
NULL
),
m_flatShader
(
NULL
),
m_simpleColorShader
(
NULL
)
m_simpleColorShader
(
NULL
),
m_linesShader
(
NULL
)
{}
void
MCMesh
::
initGUI
()
...
...
@@ -58,31 +59,67 @@ void MCMesh::cb_initGL()
m_flatShader
->
setDiffuse
(
colDif
);
m_flatShader
->
setExplode
(
1.0
f
);
m_simpleColorShader
=
new
Utils
::
ShaderSimpleColor
();
m_simpleColorShader
->
setAttributePosition
(
m_positionVBO
);
//m_simpleColorShader = new Utils::ShaderSimpleColor();
//m_simpleColorShader->setAttributePosition(m_positionVBO);
m_linesShader
=
new
Utils
::
ShaderBoldLines
();
m_linesShader
->
setAttributePosition
(
m_positionVBO
);
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
()
{
glEnable
(
GL_BLEND
);
m_dr
->
callList
(
0.1
f
);
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);
// }
{
glLineWidth
(
1
.0
f
);
m_linesShader
->
setLineWidth
(
2
.0
f
);
if
(
m_drawFaces
)
{
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
{
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
);
glEnable
(
GL_LIGHTING
);
glEnable
(
GL_POLYGON_OFFSET_FILL
);
...
...
Apps/Examples/mcmesh.h
View file @
d61d1583
...
...
@@ -39,9 +39,11 @@
#include "Algo/Render/GL2/mapRender.h"
#include "Utils/Shaders/shaderFlat.h"
#include "Utils/Shaders/shaderSimpleColor.h"
#include "Utils/Shaders/shaderBoldLines.h"
#include "Utils/vbo.h"
#include "Algo/Geometry/boundingbox.h"
#include "Utils/drawer.h"
using
namespace
CGoGN
;
...
...
@@ -79,9 +81,14 @@ public:
Algo
::
Render
::
GL2
::
MapRender
*
m_render
;
Utils
::
VBO
*
m_positionVBO
;
Utils
::
VBO
*
m_colorVBO
;
Utils
::
ShaderFlat
*
m_flatShader
;
Utils
::
ShaderSimpleColor
*
m_simpleColorShader
;
Utils
::
ShaderBoldLines
*
m_linesShader
;
Utils
::
Drawer
*
m_dr
;
DATATYPE
valLabel
;
SAlgo
::
MC
::
Image
<
DATATYPE
>*
myImg
;
...
...
Apps/Examples/volumeExplorer.cpp
View file @
d61d1583
...
...
@@ -218,6 +218,7 @@ void MyQT::cb_initGL()
registerShader
(
m_explode_render
->
shaderLines
());
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
->
setSize
(
m_WidthObj
/
2.0
f
);
...
...
@@ -254,6 +255,7 @@ void MyQT::cb_redraw()
if
(
clip_volume
&&
!
hide_clipping
)
{
m_frame
->
draw
();
m_PlanePick
->
setLineWidth
(
2.0
f
);
m_PlanePick
->
draw
();
}
...
...
CGoGN/include/Algo/Modelisation/subdivision.hpp
View file @
d61d1583
...
...
@@ -442,7 +442,7 @@ void CatmullClarkInterpolSubdivision(typename PFP::MAP& map, EMBV& attributs)
typedef typename PFP::MAP MAP;
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_edges;
...
...
@@ -464,14 +464,14 @@ void CatmullClarkInterpolSubdivision(typename PFP::MAP& map, EMBV& attributs)
{
if (!me.isMarked(d))
{
mf.markOrbit<EDGE>(d);
mf.
template
markOrbit<EDGE>(d);
Dart f = map.phi1(d);
Dart e = map.cutEdge(d);
attributs[e] = (attributs[d] + attributs[f]) /2.0;
me.template markOrbit<EDGE>(d);
me.template markOrbit<EDGE>(e);
// 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));
else
l_edges.push_back(e);
...
...
@@ -522,7 +522,7 @@ void CatmullClarkInterpolSubdivision(typename PFP::MAP& map, EMBV& attributs)
// compute face average of "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 f = map.template phi<211>(e);
...
...
@@ -537,10 +537,10 @@ void CatmullClarkInterpolSubdivision(typename PFP::MAP& map, EMBV& attributs)
{
Dart xb = map.phi2(x);
if (map.isBoundaryMarked<2>(x))
if (map.
template
isBoundaryMarked<2>(x))
std::cout << "ERROR " << attributs[x];
if (!map.isBoundaryMarked<2>(xb))
if (!map.
template
isBoundaryMarked<2>(xb))
{
Dart v1 = map.phi1(x);
Dart v2 = map.phi_1(map.phi2(map.phi_1(x)));
...
...
@@ -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));
}
dm.markOrbit<FACE>(nf);
dm.
template
markOrbit<FACE>(nf);
fp.push_back(map.phi1(nf));
fp.push_back(map.phi_1(nf));
}
dm.markOrbit<EDGE1>(e);
dm.
template
markOrbit<EDGE1>(e);
e = map.phi1(e);
} while (e!=d);
}
...
...
CGoGN/include/Container/attributeMultiVectorBool.hpp
View file @
d61d1583
...
...
@@ -118,7 +118,7 @@ public:
// }
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
;
}
...
...
CGoGN/include/Container/sizeblock.h
View file @
d61d1583
...
...
@@ -28,7 +28,6 @@
#include "Utils/gzstream.h"
#include "Utils/cgognStream.h"
//#define _BLOCKSIZE_ 4096
const
unsigned
int
_BLOCKSIZE_
=
4096
;
//typedef std::ifstream CGoGNistream;
...
...
CGoGN/include/Utils/Shaders/shaderBoldColorLines.frag
0 → 100644
View file @
d61d1583
// 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 @
d61d1583
// 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 @
d61d1583
/*******************************************************************************
* 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 @
d61d1583
// 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 @
d61d1583
// 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 @
d61d1583
// 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 @
d61d1583
/*******************************************************************************
* 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
();
void
sendParams
();
void
restoreUniformsAttribs
();
public:
ShaderBoldLines
();
void
setLineWidth
(
float
pix
);
void
updatePixelWidth
();
void
setColor
(
const
Geom
::
Vec4f
&
color
);
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/shaderBoldLines.vert
0 → 100644
View file @
d61d1583
// ShaderBoldLines::vertexShaderText
ATTRIBUTE
vec3
VertexPosition
;
uniform
mat4
ModelViewProjectionMatrix
;
VARYING_VERT
vec3
posClip
;
INVARIANT_POS
;
void
main
()
{
posClip
=
VertexPosition
;
gl_Position
=
ModelViewProjectionMatrix
*
vec4
(
VertexPosition
,
1
.
0
);
}
CGoGN/include/Utils/drawer.h
View file @
d61d1583
...
...
@@ -29,6 +29,7 @@
#include "Utils/gl_def.h"
#include "Geometry/vector_gen.h"
#include "Utils/Shaders/shaderColorPerVertex.h"
#include "Utils/Shaders/shaderBoldColorLines.h"
namespace
CGoGN
{
namespace
Utils
{
class
VBO
;
}
}
namespace
CGoGN
{
namespace
Utils
{
namespace
SVG
{
class
SVGOut
;
}
}
}
...
...
@@ -65,10 +66,12 @@ protected:
std
::
vector
<
Geom
::
Vec3f
>
m_dataPos
;
std
::
vector
<
Geom
::
Vec3f
>
m_dataCol
;
std
::
vector
<
PrimParam
>
m_begins
;
float
m_currentWidth
;
float
m_currentSize
;
GLenum
m_compile
;
Utils
::
ShaderColorPerVertex
*
m_shader
;
Utils
::
ShaderBoldColorLines
*
m_shader2
;
public:
...
...
@@ -83,7 +86,11 @@ public:
*/
~
Drawer
();
Utils
::
ShaderColorPerVertex
*
getShader
();
// Utils::ShaderColorPerVertex* getShader();
std
::
vector
<
Utils
::
GLSLShader
*>
getShaders
();
void
updateMatrices
(
const
glm
::
mat4
&
projection
,
const
glm
::
mat4
&
modelview
);
/**
* init the data structure
...
...
@@ -144,12 +151,12 @@ public:
/**
* call a set of sub-lists
*/
void
callSubLists
(
std
::
vector
<
int
>
indices
,
float
opacity
);
//
void callSubLists(std::vector<int> indices, float opacity);
/**
* call a set of sub-lists
*/
void
callSubLists
(
int
first
,
int
nb
,
float
opacity
);
//
void callSubLists(int first, int nb, float opacity);
/**
...
...
CGoGN/include/Utils/frameManipulator.h
View file @
d61d1583
...
...
@@ -29,6 +29,7 @@
#include "Utils/vbo_base.h"
#include "glm/glm.hpp"
#include "Utils/Shaders/shaderSimpleColor.h"
#include "Utils/Shaders/shaderBoldLines.h"
#include "Utils/pickables.h"
#include "Utils/dll.h"
...
...
@@ -71,12 +72,13 @@ protected:
/**
* VBO for color
*/
Utils
::
VBO
*
m_vboCol
;
//
Utils::VBO* m_vboCol;
/**
* Shader
*/
Utils
::
ShaderSimpleColor
*
m_shader
;
Utils
::
ShaderBoldLines
*
m_shaderBL
;
/**
* the axis to be highlighted
...
...
CGoGN/include/Utils/pickables.h
View file @
d61d1583
...
...
@@ -28,8 +28,8 @@
#include "Utils/vbo_base.h"
#include "glm/glm.hpp"
#include "Utils/Shaders/shaderColorPerVertex
.h"
#include "Utils/Shaders/shader
SimpleColor
.h"
//#include "Utils/Shaders/shaderSimpleColor
.h"
#include "Utils/Shaders/shader
BoldLines
.h"
#include "Utils/dll.h"
...
...
@@ -56,7 +56,8 @@ protected:
/**
* Shader
*/
Utils
::
ShaderSimpleColor
*
m_shader
;
// static Utils::ShaderSimpleColor* s_shader;
static
Utils
::
ShaderBoldLines
*
s_shader
;