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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
KennethVanhoey
CGoGN
Commits
298bb571
Commit
298bb571
authored
Nov 17, 2014
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of /home/git/repositories/cgogn/cgogn
parents
8811f892
c19302bb
Changes
92
Hide whitespace changes
Inline
Side-by-side
Showing
92 changed files
with
766 additions
and
414 deletions
+766
-414
Apps/Examples/clipping.cpp
Apps/Examples/clipping.cpp
+0
-3
Apps/Examples/concave_rendering.cpp
Apps/Examples/concave_rendering.cpp
+0
-3
Apps/Examples/extrusionView.cpp
Apps/Examples/extrusionView.cpp
+0
-3
Apps/Examples/frame_manip.cpp
Apps/Examples/frame_manip.cpp
+0
-3
Apps/Examples/mcmesh.cpp
Apps/Examples/mcmesh.cpp
+0
-2
Apps/Examples/simpleGMap2.cpp
Apps/Examples/simpleGMap2.cpp
+0
-2
Apps/Examples/simpleGMap3.cpp
Apps/Examples/simpleGMap3.cpp
+0
-2
Apps/Examples/simpleMap3.cpp
Apps/Examples/simpleMap3.cpp
+0
-2
Apps/Examples/texturesExample.cpp
Apps/Examples/texturesExample.cpp
+0
-3
Apps/Examples/viewer.cpp
Apps/Examples/viewer.cpp
+15
-5
Apps/Examples/viewer.h
Apps/Examples/viewer.h
+4
-0
Apps/Examples/viewerOBJ.cpp
Apps/Examples/viewerOBJ.cpp
+0
-3
Apps/Examples/volumeExplorer.cpp
Apps/Examples/volumeExplorer.cpp
+1
-6
Apps/SandBox/testPlaneCutting.cpp
Apps/SandBox/testPlaneCutting.cpp
+0
-2
Apps/SandBox/tilings.cpp
Apps/SandBox/tilings.cpp
+0
-2
Apps/SandBox/wallPaper.cpp
Apps/SandBox/wallPaper.cpp
+13
-4
Apps/SandBox/wallPaper.h
Apps/SandBox/wallPaper.h
+1
-0
Apps/Tuto/Attributes/vbo_attribs.cpp
Apps/Tuto/Attributes/vbo_attribs.cpp
+0
-3
Apps/Tuto/Traversals/show_traversors2.cpp
Apps/Tuto/Traversals/show_traversors2.cpp
+0
-3
Apps/Tuto/Traversals/show_traversors3.cpp
Apps/Tuto/Traversals/show_traversors3.cpp
+0
-3
Apps/Tuto/tuto2.cpp
Apps/Tuto/tuto2.cpp
+0
-2
Apps/Tuto/tuto5.cpp
Apps/Tuto/tuto5.cpp
+0
-3
Apps/Tuto/tuto_histo.cpp
Apps/Tuto/tuto_histo.cpp
+0
-3
Apps/Tuto/tuto_orbits.cpp
Apps/Tuto/tuto_orbits.cpp
+0
-3
CMakeLists.txt
CMakeLists.txt
+7
-1
SCHNApps/CMakeLists.txt
SCHNApps/CMakeLists.txt
+6
-0
SCHNApps/Plugins/surface_render/src/surface_render.cpp
SCHNApps/Plugins/surface_render/src/surface_render.cpp
+27
-26
SCHNApps/Plugins/surface_renderTopo/src/surface_renderTopo_dockTab.cpp
...ins/surface_renderTopo/src/surface_renderTopo_dockTab.cpp
+0
-3
SCHNApps/include/mapHandler.h
SCHNApps/include/mapHandler.h
+4
-2
SCHNApps/include/mapHandler.hpp
SCHNApps/include/mapHandler.hpp
+19
-6
SCHNApps/include/view.h
SCHNApps/include/view.h
+6
-2
SCHNApps/include/viewButtonArea.h
SCHNApps/include/viewButtonArea.h
+9
-12
SCHNApps/src/camera.cpp
SCHNApps/src/camera.cpp
+33
-31
SCHNApps/src/plugin.cpp
SCHNApps/src/plugin.cpp
+1
-0
SCHNApps/src/schnapps.cpp
SCHNApps/src/schnapps.cpp
+26
-4
SCHNApps/src/view.cpp
SCHNApps/src/view.cpp
+113
-24
SCHNApps/src/viewButtonArea.cpp
SCHNApps/src/viewButtonArea.cpp
+29
-19
include/Algo/Render/GL2/mapRender.hpp
include/Algo/Render/GL2/mapRender.hpp
+4
-4
include/Algo/Render/GL2/topo3PrimalRender.hpp
include/Algo/Render/GL2/topo3PrimalRender.hpp
+5
-5
include/Algo/Render/GL2/topo3Render.hpp
include/Algo/Render/GL2/topo3Render.hpp
+20
-20
include/Algo/Render/GL2/topoPrimalRender.hpp
include/Algo/Render/GL2/topoPrimalRender.hpp
+5
-5
include/Utils/GLSLShader.h
include/Utils/GLSLShader.h
+29
-19
include/Utils/Qt/qtQGLV_glw.h
include/Utils/Qt/qtQGLV_glw.h
+1
-1
include/Utils/Qt/qtgl.h
include/Utils/Qt/qtgl.h
+2
-0
include/Utils/Shaders/shaderColorPerVertex.frag
include/Utils/Shaders/shaderColorPerVertex.frag
+1
-1
include/Utils/Shaders/shaderEnvMap.frag
include/Utils/Shaders/shaderEnvMap.frag
+1
-1
include/Utils/Shaders/shaderExplodeSmoothVolumes.frag
include/Utils/Shaders/shaderExplodeSmoothVolumes.frag
+2
-2
include/Utils/Shaders/shaderExplodeVolumes.frag
include/Utils/Shaders/shaderExplodeVolumes.frag
+4
-1
include/Utils/Shaders/shaderExplodeVolumesLines.frag
include/Utils/Shaders/shaderExplodeVolumesLines.frag
+4
-1
include/Utils/Shaders/shaderFlat.frag
include/Utils/Shaders/shaderFlat.frag
+2
-2
include/Utils/Shaders/shaderFlatColor.frag
include/Utils/Shaders/shaderFlatColor.frag
+1
-1
include/Utils/Shaders/shaderIsoLines.frag
include/Utils/Shaders/shaderIsoLines.frag
+1
-1
include/Utils/Shaders/shaderMatCustom.frag
include/Utils/Shaders/shaderMatCustom.frag
+2
-2
include/Utils/Shaders/shaderPhong.frag
include/Utils/Shaders/shaderPhong.frag
+1
-1
include/Utils/Shaders/shaderPhongTexture.frag
include/Utils/Shaders/shaderPhongTexture.frag
+1
-1
include/Utils/Shaders/shaderScalarField.frag
include/Utils/Shaders/shaderScalarField.frag
+2
-2
include/Utils/Shaders/shaderSimpleColor.frag
include/Utils/Shaders/shaderSimpleColor.frag
+1
-1
include/Utils/Shaders/shaderSimpleFlat.frag
include/Utils/Shaders/shaderSimpleFlat.frag
+3
-2
include/Utils/Shaders/shaderSimpleTexture.frag
include/Utils/Shaders/shaderSimpleTexture.frag
+1
-1
include/Utils/Shaders/shaderTextureDepth.frag
include/Utils/Shaders/shaderTextureDepth.frag
+1
-1
include/Utils/Shaders/shaderTextureMask.frag
include/Utils/Shaders/shaderTextureMask.frag
+1
-1
include/Utils/Shaders/shaderVectorPerVertex.frag
include/Utils/Shaders/shaderVectorPerVertex.frag
+1
-1
include/Utils/Shaders/shaderWallPaper.frag
include/Utils/Shaders/shaderWallPaper.frag
+1
-1
include/Utils/Shaders/shaderWallPaper.h
include/Utils/Shaders/shaderWallPaper.h
+18
-0
include/Utils/Shaders/shaderWallPaper.vert
include/Utils/Shaders/shaderWallPaper.vert
+6
-2
include/Utils/gl_def.h
include/Utils/gl_def.h
+2
-2
include/Utils/gl_matrices.h
include/Utils/gl_matrices.h
+1
-1
include/Utils/pointSprite.frag
include/Utils/pointSprite.frag
+1
-1
include/Utils/textures.hpp
include/Utils/textures.hpp
+3
-2
include/Utils/vbo_base.h
include/Utils/vbo_base.h
+1
-1
src/Utils/GLSLShader.cpp
src/Utils/GLSLShader.cpp
+112
-68
src/Utils/Qt/qtQGLV.cpp
src/Utils/Qt/qtQGLV.cpp
+26
-9
src/Utils/Qt/qtQGLV_glw.cpp
src/Utils/Qt/qtQGLV_glw.cpp
+3
-2
src/Utils/Qt/qtSimple.cpp
src/Utils/Qt/qtSimple.cpp
+32
-4
src/Utils/Qt/qtgl.cpp
src/Utils/Qt/qtgl.cpp
+26
-2
src/Utils/Shaders/shaderColorPerVertex.cpp
src/Utils/Shaders/shaderColorPerVertex.cpp
+1
-1
src/Utils/Shaders/shaderCustomTex.cpp
src/Utils/Shaders/shaderCustomTex.cpp
+3
-3
src/Utils/Shaders/shaderEnvMap.cpp
src/Utils/Shaders/shaderEnvMap.cpp
+1
-1
src/Utils/Shaders/shaderExplodeSmoothVolumes.cpp
src/Utils/Shaders/shaderExplodeSmoothVolumes.cpp
+1
-1
src/Utils/Shaders/shaderPhongTexture.cpp
src/Utils/Shaders/shaderPhongTexture.cpp
+1
-1
src/Utils/Shaders/shaderSimpleColor.cpp
src/Utils/Shaders/shaderSimpleColor.cpp
+1
-1
src/Utils/Shaders/shaderSimpleTexture.cpp
src/Utils/Shaders/shaderSimpleTexture.cpp
+3
-3
src/Utils/Shaders/shaderTextureDepth.cpp
src/Utils/Shaders/shaderTextureDepth.cpp
+4
-4
src/Utils/Shaders/shaderTextureMask.cpp
src/Utils/Shaders/shaderTextureMask.cpp
+4
-4
src/Utils/Shaders/shaderWallPaper.cpp
src/Utils/Shaders/shaderWallPaper.cpp
+90
-13
src/Utils/clippingShader.cpp
src/Utils/clippingShader.cpp
+3
-3
src/Utils/frameManipulator.cpp
src/Utils/frameManipulator.cpp
+2
-2
src/Utils/pickables.cpp
src/Utils/pickables.cpp
+1
-1
src/Utils/scene_graph.cpp
src/Utils/scene_graph.cpp
+1
-1
src/Utils/text3d.cpp
src/Utils/text3d.cpp
+3
-3
src/Utils/vbo.cpp
src/Utils/vbo.cpp
+1
-1
src/Utils/vboRender.cpp
src/Utils/vboRender.cpp
+4
-4
No files found.
Apps/Examples/clipping.cpp
View file @
298bb571
...
...
@@ -837,9 +837,6 @@ void Clipping::importMesh(std::string& filename)
void
Clipping
::
cb_initGL
()
{
// choose to use GL version 2
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
// create the render
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
();
m_render_topo
=
new
Algo
::
Render
::
GL2
::
Topo3RenderMap
<
PFP
>
();
...
...
Apps/Examples/concave_rendering.cpp
View file @
298bb571
...
...
@@ -139,9 +139,6 @@ unsigned int nb_ears;
void
MyQT
::
cb_initGL
()
{
// choose to use GL version 2
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
// create the render
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
();
...
...
Apps/Examples/extrusionView.cpp
View file @
298bb571
...
...
@@ -59,9 +59,6 @@ MAP myMap;
void
MyQT
::
cb_initGL
()
{
// choose to use GL version 2
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
// create the render
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
();
...
...
Apps/Examples/frame_manip.cpp
View file @
298bb571
...
...
@@ -57,9 +57,6 @@ PFP::MAP myMap;
void
MyQT
::
cb_initGL
()
{
// choose to use GL version 2
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
m_frame
=
new
Utils
::
FrameManipulator
();
// frame is rendered twice the size of normal
...
...
Apps/Examples/mcmesh.cpp
View file @
298bb571
...
...
@@ -49,8 +49,6 @@ void MCMesh::cb_initGL()
Geom
::
Vec4f
colDif
(
0.8
f
,
0.9
f
,
0.7
f
,
1.0
f
);
Geom
::
Vec4f
colSpec
(
0.9
f
,
0.9
f
,
0.9
f
,
1.0
f
);
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
();
m_positionVBO
=
new
Utils
::
VBO
();
...
...
Apps/Examples/simpleGMap2.cpp
View file @
298bb571
...
...
@@ -60,8 +60,6 @@ void SimpleGMap2::initGUI()
void
SimpleGMap2
::
cb_initGL
()
{
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
1
)
;
Geom
::
BoundingBox
<
VEC3
>
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
position
)
;
VEC3
gPosObj
=
bb
.
center
()
;
float
tailleX
=
bb
.
size
(
0
)
;
...
...
Apps/Examples/simpleGMap3.cpp
View file @
298bb571
...
...
@@ -122,8 +122,6 @@ void SimpleGMap3::cb_keyPress(int code)
void
SimpleGMap3
::
cb_initGL
()
{
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
)
;
Geom
::
BoundingBox
<
PFP
::
VEC3
>
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
position
)
;
VEC3
gPosObj
=
bb
.
center
()
;
float
tailleX
=
bb
.
size
(
0
)
;
...
...
Apps/Examples/simpleMap3.cpp
View file @
298bb571
...
...
@@ -95,8 +95,6 @@ void SimpleMap3::initGUI()
void
SimpleMap3
::
cb_initGL
()
{
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
)
;
Geom
::
BoundingBox
<
PFP
::
VEC3
>
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
position
)
;
VEC3
gPosObj
=
bb
.
center
()
;
float
tailleX
=
bb
.
size
(
0
)
;
...
...
Apps/Examples/texturesExample.cpp
View file @
298bb571
...
...
@@ -48,9 +48,6 @@ TexView::~TexView()
void
TexView
::
cb_initGL
()
{
// choose to use GL version 2
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
// create VBO for position
m_positionVBO
=
new
Utils
::
VBO
;
m_texcoordVBO
=
new
Utils
::
VBO
;
...
...
Apps/Examples/viewer.cpp
View file @
298bb571
...
...
@@ -23,7 +23,6 @@
*******************************************************************************/
#include "viewer.h"
#include "Utils/chrono.h"
Viewer
::
Viewer
()
:
m_renderStyle
(
FLAT
),
...
...
@@ -38,7 +37,8 @@ Viewer::Viewer() :
m_flatShader
(
NULL
),
m_vectorShader
(
NULL
),
m_simpleColorShader
(
NULL
),
m_pointSprite
(
NULL
)
m_pointSprite
(
NULL
),
m_nbFrames
(
0
)
{
normalScaleFactor
=
1.0
f
;
vertexScaleFactor
=
0.1
f
;
...
...
@@ -78,9 +78,11 @@ void Viewer::initGUI()
void
Viewer
::
cb_initGL
()
{
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
)
;
CGoGNout
<<
"GL VERSION = "
<<
glGetString
(
GL_VERSION
)
<<
CGoGNendl
;
Utils
::
GLSLShader
::
areShadersSupported
();
int
major
=
0
;
int
minor
=
0
;
glGetIntegerv
(
GL_MAJOR_VERSION
,
&
major
);
glGetIntegerv
(
GL_MINOR_VERSION
,
&
minor
);
CGoGNout
<<
"Using GL "
<<
major
<<
"."
<<
minor
<<
CGoGNendl
;
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
()
;
m_topoRender
=
new
Algo
::
Render
::
GL2
::
TopoRender
()
;
...
...
@@ -174,6 +176,14 @@ void Viewer::cb_redraw()
glLineWidth
(
1.0
f
)
;
m_render
->
draw
(
m_vectorShader
,
Algo
::
Render
::
GL2
::
POINTS
)
;
}
m_nbFrames
++
;
if
(
m_nbFrames
>=
100
)
{
std
::
cout
<<
100000.0
/
m_frame_ch
.
elapsed
()
<<
" fps"
<<
std
::
endl
;
m_nbFrames
=
0
;
m_frame_ch
.
start
();
}
}
void
Viewer
::
cb_Open
()
...
...
Apps/Examples/viewer.h
View file @
298bb571
...
...
@@ -48,6 +48,7 @@
#include "Utils/pointSprite.h"
#include "Utils/text3d.h"
#include "Utils/vbo.h"
#include "Utils/chrono.h"
#include "Utils/Qt/qtInputs.h"
...
...
@@ -115,6 +116,9 @@ public:
Utils
::
ShaderSimpleColor
*
m_simpleColorShader
;
Utils
::
PointSprite
*
m_pointSprite
;
Utils
::
Chrono
m_frame_ch
;
unsigned
int
m_nbFrames
;
Viewer
()
;
void
initGUI
()
;
...
...
Apps/Examples/viewerOBJ.cpp
View file @
298bb571
...
...
@@ -96,9 +96,6 @@ void ObjView::cb_keyPress(int k)
void
ObjView
::
cb_initGL
()
{
// choose to use GL version 2
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
m_dr
=
new
Utils
::
Drawer
;
// create VBO for position
...
...
Apps/Examples/volumeExplorer.cpp
View file @
298bb571
...
...
@@ -204,11 +204,6 @@ void MyQT::cb_Save()
void
MyQT
::
cb_initGL
()
{
// choose to use GL version 2
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
CGoGNout
<<
"GL VERSION = "
<<
glGetString
(
GL_VERSION
)
<<
CGoGNendl
;
Utils
::
GLSLShader
::
areShadersSupported
();
// create the renders
m_topo_render
=
new
Algo
::
Render
::
GL2
::
Topo3RenderMap
<
PFP
>
();
m_explode_render
=
new
Algo
::
Render
::
GL2
::
ExplodeVolumeRender
(
true
,
true
,
true
);
...
...
@@ -447,7 +442,7 @@ int main(int argc, char **argv)
{
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
,
MAP
>
(
"position"
);
int
nb
=
64
;
int
nb
=
32
;
Algo
::
Volume
::
Tilings
::
Cubic
::
Grid
<
PFP
>
cubic
(
myMap
,
nb
,
nb
,
nb
);
cubic
.
embedIntoGrid
(
position
,
1.0
f
,
1.0
f
,
1.0
f
);
...
...
Apps/SandBox/testPlaneCutting.cpp
View file @
298bb571
...
...
@@ -82,8 +82,6 @@ void Viewer::initGUI()
void
Viewer
::
cb_initGL
()
{
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
)
;
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
()
;
m_topoRender
=
new
Algo
::
Render
::
GL2
::
TopoRender
()
;
...
...
Apps/SandBox/tilings.cpp
View file @
298bb571
...
...
@@ -60,8 +60,6 @@ VertexAttribute<VEC3, MAP> normal;
void
MyQT
::
cb_initGL
()
{
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
// create the render
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
();
...
...
Apps/SandBox/wallPaper.cpp
View file @
298bb571
...
...
@@ -37,8 +37,6 @@ void MyQT::cb_initGL()
Geom
::
Vec3f
lPosObj
=
(
bb
.
min
()
+
bb
.
max
())
/
PFP
::
REAL
(
2
);
setParamObject
(
lWidthObj
,
lPosObj
.
data
());
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
// create the render
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
();
...
...
@@ -58,11 +56,19 @@ void MyQT::cb_initGL()
// FOR WALL PAPER
m_textureWP
=
new
Utils
::
Texture
<
2
,
Geom
::
Vec3uc
>
(
GL_UNSIGNED_BYTE
);
if
(
!
m_textureWP
->
load
(
"../SCHNApps/resources/cgogn/cgogn2.png"
))
if
(
!
m_textureWP
->
load
(
"../
../
SCHNApps/resources/cgogn/cgogn2.png"
))
computeTexture
();
m_textureWP
->
update
();
m_textureWP
->
setWrapping
(
GL_CLAMP_TO_EDGE
);
m_textureWP2
=
new
Utils
::
Texture
<
2
,
Geom
::
Vec3uc
>
(
GL_UNSIGNED_BYTE
);
if
(
!
m_textureWP2
->
load
(
"../../SCHNApps/resources/icons/cameras.png"
))
computeTexture
();
m_textureWP2
->
update
();
m_textureWP2
->
setWrapping
(
GL_CLAMP_TO_EDGE
);
m_shaderWP
=
new
Utils
::
ShaderWallPaper
();
m_shaderWP
->
setTextureUnit
(
GL_TEXTURE0
);
m_shaderWP
->
setTexture
(
m_textureWP
);
...
...
@@ -78,7 +84,10 @@ void MyQT::cb_redraw()
// FOR WALL PAPER
m_render
->
draw
(
m_shader
,
Algo
::
Render
::
GL2
::
LINES
);
m_shaderWP
->
setTexture
(
m_textureWP
);
m_shaderWP
->
draw
();
m_shaderWP
->
drawFront
(
this
->
getWidth
(),
this
->
getHeight
(),
150
,
10
,
200
,
200
,
m_textureWP2
);
}
...
...
@@ -87,7 +96,7 @@ void MyQT::cb_keyPress(int keycode)
switch
(
keycode
)
{
case
'l'
:
if
(
m_textureWP
->
load
(
"../SCHNApps/resources/cgogn/cgogn2.png"
))
if
(
m_textureWP
->
load
(
"../
../
SCHNApps/resources/cgogn/cgogn2.png"
))
m_textureWP
->
update
();
m_textureWP
->
setWrapping
(
GL_CLAMP_TO_EDGE
);
break
;
...
...
Apps/SandBox/wallPaper.h
View file @
298bb571
...
...
@@ -74,6 +74,7 @@ public:
// FOR WALL PAPER
Utils
::
Texture
<
2
,
Geom
::
Vec3uc
>*
m_textureWP
;
Utils
::
Texture
<
2
,
Geom
::
Vec3uc
>*
m_textureWP2
;
Utils
::
ShaderWallPaper
*
m_shaderWP
;
MyQT
()
:
...
...
Apps/Tuto/Attributes/vbo_attribs.cpp
View file @
298bb571
...
...
@@ -124,9 +124,6 @@ void MyQT::createMap()
// initialization GL callback
void
MyQT
::
cb_initGL
()
{
// choose to use GL version 2
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
// create the render
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
();
...
...
Apps/Tuto/Traversals/show_traversors2.cpp
View file @
298bb571
...
...
@@ -82,9 +82,6 @@ void MyQT::cb_explode(int x)
void
MyQT
::
cb_initGL
()
{
// choose to use GL version 2
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
m_render_topo
=
new
Algo
::
Render
::
GL2
::
TopoRender
();
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
0.95
f
,
0.9
f
,
0.8
f
);
m_dm_topo
=
new
DartMarker
<
MAP
>
(
myMap
);
...
...
Apps/Tuto/Traversals/show_traversors3.cpp
View file @
298bb571
...
...
@@ -113,9 +113,6 @@ void MyQT::cb_explode(int x)
void
MyQT
::
cb_initGL
()
{
// choose to use GL version 2
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
m_render_topo
=
new
Algo
::
Render
::
GL2
::
Topo3RenderMap
<
PFP
>
();
m_render_topo
->
updateData
(
myMap
,
position
,
0.95
f
,
0.9
f
,
0.8
f
);
...
...
Apps/Tuto/tuto2.cpp
View file @
298bb571
...
...
@@ -124,8 +124,6 @@ void MyQT::createMap()
// initialization GL callback
void
MyQT
::
cb_initGL
()
{
// choose to use GL version 2
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
// create the render
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
();
...
...
Apps/Tuto/tuto5.cpp
View file @
298bb571
...
...
@@ -110,9 +110,6 @@ void MyQT::storeVerticesInfo()
void
MyQT
::
cb_initGL
()
{
// choose to use GL version 2
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
// create the render
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
();
...
...
Apps/Tuto/tuto_histo.cpp
View file @
298bb571
...
...
@@ -245,9 +245,6 @@ void MyQT::cb_keyPress(int keycode)
void
MyQT
::
cb_initGL
()
{
// choose to use GL version 2
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
// create the render
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
();
...
...
Apps/Tuto/tuto_orbits.cpp
View file @
298bb571
...
...
@@ -129,9 +129,6 @@ void MyQT::storeVerticesInfoGen(unsigned int orb, const AttributeHandlerGen* att
void
MyQT
::
cb_initGL
()
{
// choose to use GL version 2
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
m_render_topo
=
new
Algo
::
Render
::
GL2
::
Topo3RenderMap
<
PFP
>
();
m_render_topo
->
updateData
(
myMap
,
position
,
0.9
f
,
0.8
f
,
0.8
f
);
...
...
CMakeLists.txt
View file @
298bb571
...
...
@@ -48,6 +48,7 @@ SET ( COMPILE_SANDBOX ON CACHE BOOL "compile all in sandbox" )
SET
(
ONELIB OFF CACHE BOOL
"build CGoGN in one lib"
)
SET
(
WITH_GLEWMX OFF CACHE BOOL
"use multi-contex GLEW"
)
SET
(
USE_OGL_CORE_PROFILE OFF CACHE BOOL
"use OpenGL 3.3 core profile (do not work on mac)"
)
IF
(
WIN32
)
...
...
@@ -83,9 +84,14 @@ ELSE (WITH_GLEWMX)
ENDIF
(
WITH_GLEWMX
)
add_definitions
(
-DSHADERPATH=
"
${
CGoGN_ROOT_DIR
}
/lib/Shaders/"
)
IF
(
USE_OGL_CORE_PROFILE
)
add_definitions
(
-DUSE_OGL_CORE_PROFILE=1
)
ENDIF
()
add_definitions
(
-DGLM_FORCE_RADIANS
)
add_definitions
(
-DSHADERPATH=
"
${
CGoGN_ROOT_DIR
}
/lib/Shaders/"
)
# define includes of external libs
SET
(
CGoGN_EXT_INCLUDES
${
CGoGN_ROOT_DIR
}
/ThirdParty/include
...
...
SCHNApps/CMakeLists.txt
View file @
298bb571
...
...
@@ -16,6 +16,8 @@ SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/.. CACHE STRING "CGoGN root dir")
SET
(
CMAKE_MODULE_PATH
${
CGoGN_ROOT_DIR
}
/cmake_modules/
)
SET
(
SLOT_DEBUG_MODE OFF CACHE BOOL
"build with slot debugging mode"
)
SET
(
USE_OGL_CORE_PROFILE OFF CACHE BOOL
"use OpenGL 3.3 core profile (do not work on mac)"
)
find_package
(
OpenGL REQUIRED
)
...
...
@@ -61,6 +63,10 @@ IF(SLOT_DEBUG_MODE)
add_definitions
(
-DSLOT_DEBUG_MODE=1
)
ENDIF
()
IF
(
USE_OGL_CORE_PROFILE
)
add_definitions
(
-DUSE_OGL_CORE_PROFILE=1
)
ENDIF
()
# define includes of external libs
SET
(
EXT_INCLUDES
${
CGoGN_ROOT_DIR
}
/ThirdParty/include
...
...
SCHNApps/Plugins/surface_render/src/surface_render.cpp
View file @
298bb571
...
...
@@ -73,7 +73,32 @@ void Surface_Render_Plugin::drawMap(View* view, MapHandlerGen* map)
const
MapParameters
&
p
=
h_viewParameterSet
[
view
][
map
];
if
(
p
.
positionVBO
)
{
if
(
p
.
renderVertices
)
if
(
p
.
renderFaces
)
{
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_FILL
);
glEnable
(
GL_LIGHTING
);
glEnable
(
GL_POLYGON_OFFSET_FILL
);
glPolygonOffset
(
1.0
f
,
1.0
f
);
switch
(
p
.
faceStyle
)
{
case
MapParameters
::
FLAT
:
m_flatShader
->
setAttributePosition
(
p
.
positionVBO
);
m_flatShader
->
setDiffuse
(
p
.
diffuseColor
);
map
->
draw
(
m_flatShader
,
CGoGN
::
Algo
::
Render
::
GL2
::
TRIANGLES
);
break
;
case
MapParameters
::
PHONG
:
if
(
p
.
normalVBO
!=
NULL
)
{
m_phongShader
->
setAttributePosition
(
p
.
positionVBO
);
m_phongShader
->
setAttributeNormal
(
p
.
normalVBO
);
m_phongShader
->
setDiffuse
(
p
.
diffuseColor
);
map
->
draw
(
m_phongShader
,
CGoGN
::
Algo
::
Render
::
GL2
::
TRIANGLES
);
}
break
;
}
glDisable
(
GL_POLYGON_OFFSET_FILL
);
}
if
(
p
.
renderVertices
)
{
m_pointSprite
->
setSize
(
map
->
getBBdiagSize
()
/
200.0
f
*
p
.
verticesScaleFactor
);
m_pointSprite
->
setAttributePosition
(
p
.
positionVBO
);
...
...
@@ -89,31 +114,7 @@ void Surface_Render_Plugin::drawMap(View* view, MapHandlerGen* map)
m_simpleColorShader
->
setColor
(
p
.
simpleColor
);
map
->
draw
(
m_simpleColorShader
,
CGoGN
::
Algo
::
Render
::
GL2
::
LINES
);
}
if
(
p
.
renderFaces
)
{
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_FILL
);
glEnable
(
GL_LIGHTING
);
glEnable
(
GL_POLYGON_OFFSET_FILL
);
glPolygonOffset
(
1.0
f
,
1.0
f
);
switch
(
p
.
faceStyle
)
{
case
MapParameters
::
FLAT
:
m_flatShader
->
setAttributePosition
(
p
.
positionVBO
);
m_flatShader
->
setDiffuse
(
p
.
diffuseColor
);
map
->
draw
(
m_flatShader
,
CGoGN
::
Algo
::
Render
::
GL2
::
TRIANGLES
);
break
;
case
MapParameters
::
PHONG
:
if
(
p
.
normalVBO
!=
NULL
)
{
m_phongShader
->
setAttributePosition
(
p
.
positionVBO
);
m_phongShader
->
setAttributeNormal
(
p
.
normalVBO
);
m_phongShader
->
setDiffuse
(
p
.
diffuseColor
);
map
->
draw
(
m_phongShader
,
CGoGN
::
Algo
::
Render
::
GL2
::
TRIANGLES
);
}
break
;
}
glDisable
(
GL_POLYGON_OFFSET_FILL
);
}
if
(
p
.
renderBoundary
)
{
glLineWidth
(
5.0
f
);
...
...
SCHNApps/Plugins/surface_renderTopo/src/surface_renderTopo_dockTab.cpp
View file @
298bb571
...
...
@@ -220,8 +220,6 @@ void Surface_RenderTopo_DockTab::updateMapParameters()
const
Surface_RenderTopo_Plugin
::
ViewMapParam
&
p
=
m_plugin
->
h_viewParameterSet
[
view
][
map
];
bool
attChanged
;
QString
vec3TypeName
=
QString
::
fromStdString
(
nameOfType
(
PFP2
::
VEC3
()));
int
i
=
1
;
...
...
@@ -236,7 +234,6 @@ void Surface_RenderTopo_DockTab::updateMapParameters()
if
(
combo_positionAttribute
->
currentIndex
()
!=
i
)
{
combo_positionAttribute
->
setCurrentIndex
(
i
);
attChanged
=
true
;
}
}
++
i
;
...
...
SCHNApps/include/mapHandler.h
View file @
298bb571
...
...
@@ -51,8 +51,8 @@ public slots:
const
QList
<
View
*>&
getLinkedViews
()
const
{
return
l_views
;
}
bool
isLinkedToView
(
View
*
view
)
const
{
return
l_views
.
contains
(
view
);
}
//
const qglviewer::Vec& getBBmin() const { return m_bbMin; }
//
const qglviewer::Vec& getBBmax() const { return m_bbMax; }
const
qglviewer
::
Vec
&
getBBmin
()
const
{
return
m_bbMin
;
}
const
qglviewer
::
Vec
&
getBBmax
()
const
{
return
m_bbMax
;
}
float
getBBdiagSize
()
const
{
return
m_bbDiagSize
;
}
Utils
::
GLSLShader
*
getBBDrawerShader
()
const
...
...
@@ -83,6 +83,7 @@ public:
virtual
void
draw
(
Utils
::
GLSLShader
*
shader
,
int
primitive
)
=
0
;
virtual
void
drawBB
()
=
0
;
virtual
void
transformedBB
(
qglviewer
::
Vec
&
bbMin
,
qglviewer
::
Vec
&
bbMax
)
=
0
;
virtual
void
initBBDrawer
()
=
0
;
void
setPrimitiveDirty
(
int
primitive
)
{
m_render
->
setPrimitiveDirty
(
primitive
);
}
...
...
@@ -256,6 +257,7 @@ public:
void
drawBB
();
void
updateBB
(
const
VertexAttribute
<
VEC3
,
MAP
>&
position
);
void
initBBDrawer
();
void
updateBBDrawer
();
void
transformedBB
(
qglviewer
::
Vec
&
bbMin
,
qglviewer
::
Vec
&
bbMax
);
...
...
SCHNApps/include/mapHandler.hpp
View file @
298bb571
...
...
@@ -82,11 +82,11 @@ void MapHandler<PFP>::draw(Utils::GLSLShader* shader, int primitive)
template
<
typename
PFP
>
void
MapHandler
<
PFP
>::
drawBB
()
{
if
(
!
m_bbDrawer
)
{
m_bbDrawer
=
new
Utils
::
Drawer
();
updateBBDrawer
();
}
//
if(!m_bbDrawer)
//
{
//
m_bbDrawer = new Utils::Drawer();
//
updateBBDrawer();
//
}
// QGLViewer::drawAxis();
m_bbDrawer
->
callList
();
...
...
@@ -97,9 +97,22 @@ void MapHandler<PFP>::updateBB(const VertexAttribute<VEC3, MAP>& position)
{
m_bb
=
CGoGN
::
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
*
(
static_cast
<
MAP
*>
(
m_map
)),
position
);
m_bbDiagSize
=
m_bb
.
diagSize
();
const
typename
PFP
::
VEC3
&
bmin
=
m_bb
.
min
();
m_bbMin
=
qglviewer
::
Vec
(
bmin
[
0
],
bmin
[
1
],
bmin
[
2
]);
const
typename
PFP
::
VEC3
&
bmax
=
m_bb
.
max
();
m_bbMax
=
qglviewer
::
Vec
(
bmax
[
0
],
bmax
[
1
],
bmax
[
2
]);
updateBBDrawer
();
}
template
<
typename
PFP
>
void
MapHandler
<
PFP
>::
initBBDrawer
()
{
if
(
!
m_bbDrawer
)
m_bbDrawer
=
new
Utils
::
Drawer
();
}
template
<
typename
PFP
>
void
MapHandler
<
PFP
>::
updateBBDrawer
()
...
...
@@ -192,7 +205,7 @@ void MapHandler<PFP>::createTopoRender(CGoGN::Utils::GLSLShader* sh1)
if
(
m_map
->
dimension
()
==
2
)
{
CGoGN
::
Utils
::
ShaderSimpleColor
*
ssc
=
static_cast
<
CGoGN
::
Utils
::
ShaderSimpleColor
*>
(
sh1
);
CGoGN
::
Utils
::
ShaderSimpleColor
*
ssc
=
static_cast
<
CGoGN
::
Utils
::
ShaderSimpleColor
*>
(
sh1
);
m_topoRender
=
new
Algo
::
Render
::
GL2
::
TopoRender
(
ssc
);
m_topoRender
->
setInitialDartsColor
(
0.25
f
,
0.25
f
,
0.25
f
)
;
...
...
SCHNApps/include/view.h
View file @
298bb571
...
...
@@ -9,6 +9,8 @@
#include "schnapps.h"
#include "Utils/gl_matrices.h"
#include "Utils/GLSLShader.h"
#include "Utils/drawer.h"
namespace
CGoGN
{
...
...
@@ -31,13 +33,13 @@ class View : public QGLViewer
public:
static
unsigned
int
viewCount
;
View
(
const
QString
&
name
,
SCHNApps
*
s
,
const
QGLWidget
*
shareWidget
=
NULL
);
View
(
const
QString
&
name
,
SCHNApps
*
s
,
QGLFormat
&
format
);
View
(
const
QString
&
name
,
SCHNApps
*
s
,
QGLFormat
&
format
,
const
QGLWidget
*
shareWidget
);
~
View
();
const
QString
&
getName
()
const
{
return
m_name
;
}
MapHandlerGen
*
lastSelectedMap
()
{
return
m_lastSelectedMap
;}
// void setLastSelectedMap(MapHandlerGen* m) { m_lastSelectedMap=m; }
void
closeDialogs
();
...
...
@@ -154,6 +156,8 @@ protected:
ListPopUp
*
m_dialogPlugins
;
ListPopUp
*
m_dialogCameras
;
Utils
::
Drawer
*
m_frameDrawer
;
};
}
// namespace SCHNApps
...
...
SCHNApps/include/viewButtonArea.h
View file @
298bb571
...
...
@@ -9,6 +9,10 @@
#include <iostream>
#define WITH_QT 1
#include "Utils/textures.h"
#include "Utils/Shaders/shaderWallPaper.h"
namespace
CGoGN
{
...
...
@@ -16,7 +20,6 @@ namespace SCHNApps
{
class
View
;
struct
Texture
;
class
ViewButton
:
public
QObject
{
...
...
@@ -29,7 +32,7 @@ public:
QSize
getSize
();
void
click
(
int
x
,
int
y
,
int
globalX
,
int
globalY
);
void
drawAt
(
int
x
,
int
y
);