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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sauvage
CGoGN
Commits
ad03bdaf
Commit
ad03bdaf
authored
Apr 27, 2011
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge..
parent
5ac4eeac
Changes
69
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
69 changed files
with
1102 additions
and
1677 deletions
+1102
-1677
Apps/Examples/extrusionView.cpp
Apps/Examples/extrusionView.cpp
+2
-2
Apps/Examples/polyhedronsView.cpp
Apps/Examples/polyhedronsView.cpp
+2
-14
Apps/Tuto/tp_master.cpp
Apps/Tuto/tp_master.cpp
+2
-8
Apps/Tuto/tp_master.h
Apps/Tuto/tp_master.h
+5
-7
Apps/Tuto/tuto1.cpp
Apps/Tuto/tuto1.cpp
+5
-19
Apps/Tuto/tuto1.h
Apps/Tuto/tuto1.h
+12
-16
Apps/Tuto/tuto2.cpp
Apps/Tuto/tuto2.cpp
+7
-26
Apps/Tuto/tuto2.h
Apps/Tuto/tuto2.h
+6
-10
Apps/Tuto/tuto3.cpp
Apps/Tuto/tuto3.cpp
+6
-27
Apps/Tuto/tuto3.h
Apps/Tuto/tuto3.h
+5
-3
Apps/Tuto/tuto4.cpp
Apps/Tuto/tuto4.cpp
+2
-19
Apps/Tuto/tuto4.h
Apps/Tuto/tuto4.h
+3
-1
Apps/Tuto/tuto5.cpp
Apps/Tuto/tuto5.cpp
+27
-45
Apps/Tuto/tuto5.h
Apps/Tuto/tuto5.h
+21
-19
Apps/Tuto/tuto_mt.cpp
Apps/Tuto/tuto_mt.cpp
+7
-36
Apps/Tuto/tuto_mt.h
Apps/Tuto/tuto_mt.h
+7
-11
Apps/Tuto/tuto_ogl2.cpp
Apps/Tuto/tuto_ogl2.cpp
+0
-183
Apps/Tuto/tuto_ogl3.cpp
Apps/Tuto/tuto_ogl3.cpp
+3
-21
Apps/Tuto/tuto_ogl3.h
Apps/Tuto/tuto_ogl3.h
+5
-9
Apps/Tuto/tuto_subdivision.cpp
Apps/Tuto/tuto_subdivision.cpp
+0
-3
include/Algo/MovingObjects/particle_cell_2D.h
include/Algo/MovingObjects/particle_cell_2D.h
+19
-21
include/Algo/MovingObjects/particle_cell_2D.hpp
include/Algo/MovingObjects/particle_cell_2D.hpp
+139
-125
include/Algo/Render/GL1/map_glRender.h
include/Algo/Render/GL1/map_glRender.h
+1
-1
include/Algo/Render/GL1/map_glRender.hpp
include/Algo/Render/GL1/map_glRender.hpp
+0
-2
include/Algo/Render/GL1/renderFunctor.h
include/Algo/Render/GL1/renderFunctor.h
+0
-3
include/Algo/Render/GL2/mapRender.h
include/Algo/Render/GL2/mapRender.h
+14
-28
include/Algo/Render/GL2/mapRender.hpp
include/Algo/Render/GL2/mapRender.hpp
+49
-58
include/Container/attributeMultiVector.h
include/Container/attributeMultiVector.h
+4
-0
include/Container/attributeMultiVector.hpp
include/Container/attributeMultiVector.hpp
+8
-0
include/Container/convert.h
include/Container/convert.h
+37
-29
include/Geometry/matrix.hpp
include/Geometry/matrix.hpp
+3
-2
include/Topology/generic/dartmarker.h
include/Topology/generic/dartmarker.h
+17
-19
include/Topology/generic/genericmap.h
include/Topology/generic/genericmap.h
+8
-11
include/Topology/generic/genericmap.hpp
include/Topology/generic/genericmap.hpp
+11
-4
include/Utils/GLSLShader.h
include/Utils/GLSLShader.h
+19
-57
include/Utils/cgognStream.h
include/Utils/cgognStream.h
+19
-20
include/Utils/cgognStream.hpp
include/Utils/cgognStream.hpp
+20
-24
include/Utils/drawer.h
include/Utils/drawer.h
+7
-11
include/Utils/qtInputs.h
include/Utils/qtInputs.h
+19
-15
include/Utils/qtSimple.h
include/Utils/qtSimple.h
+32
-41
include/Utils/qtgl.h
include/Utils/qtgl.h
+12
-17
include/Utils/qtui.h
include/Utils/qtui.h
+3
-4
include/Utils/shaderColorPerVertex.h
include/Utils/shaderColorPerVertex.h
+7
-6
include/Utils/shaderFlat.h
include/Utils/shaderFlat.h
+7
-5
include/Utils/shaderPhong.h
include/Utils/shaderPhong.h
+17
-18
include/Utils/shaderSimpleColor.h
include/Utils/shaderSimpleColor.h
+8
-4
include/Utils/shaderVectorPerVertex.h
include/Utils/shaderVectorPerVertex.h
+26
-29
include/Utils/text3d.h
include/Utils/text3d.h
+8
-7
include/Utils/texture.h
include/Utils/texture.h
+8
-10
include/Utils/texture.hpp
include/Utils/texture.hpp
+20
-26
include/Utils/vbo.h
include/Utils/vbo.h
+10
-10
include/Utils/vbo.hpp
include/Utils/vbo.hpp
+3
-4
src/Algo/Render/mapRender.cpp
src/Algo/Render/mapRender.cpp
+21
-34
src/Algo/Render/topo3Render.cpp
src/Algo/Render/topo3Render.cpp
+4
-8
src/Algo/Render/topoRender.cpp
src/Algo/Render/topoRender.cpp
+4
-20
src/Utils/GLSLShader.cpp
src/Utils/GLSLShader.cpp
+54
-112
src/Utils/cgognStream.cpp
src/Utils/cgognStream.cpp
+3
-5
src/Utils/drawer.cpp
src/Utils/drawer.cpp
+11
-21
src/Utils/pointSprite.cpp
src/Utils/pointSprite.cpp
+22
-29
src/Utils/qtSimple.cpp
src/Utils/qtSimple.cpp
+35
-55
src/Utils/qtgl.cpp
src/Utils/qtgl.cpp
+65
-65
src/Utils/qtinputs.cpp
src/Utils/qtinputs.cpp
+30
-57
src/Utils/shaderColorPerVertex.cpp
src/Utils/shaderColorPerVertex.cpp
+3
-3
src/Utils/shaderFlat.cpp
src/Utils/shaderFlat.cpp
+17
-25
src/Utils/shaderPhong.cpp
src/Utils/shaderPhong.cpp
+15
-26
src/Utils/shaderSimpleColor.cpp
src/Utils/shaderSimpleColor.cpp
+9
-11
src/Utils/shaderVectorPerVertex.cpp
src/Utils/shaderVectorPerVertex.cpp
+78
-58
src/Utils/text3d.cpp
src/Utils/text3d.cpp
+34
-40
src/Utils/vbo.cpp
src/Utils/vbo.cpp
+15
-18
No files found.
Apps/Examples/extrusionView.cpp
View file @
ad03bdaf
...
...
@@ -80,8 +80,8 @@ void MyQT::cb_initGL()
m_shader2
->
setColor
(
Geom
::
Vec4f
(
1.
,
1.
,
0.
,
0.
));
register
Running
(
m_shader
);
register
Running
(
m_shader2
);
register
Shader
(
m_shader
);
register
Shader
(
m_shader2
);
}
...
...
Apps/Examples/polyhedronsView.cpp
View file @
ad03bdaf
...
...
@@ -44,18 +44,14 @@
using
namespace
CGoGN
;
struct
PFP
:
public
PFP_STANDARD
{
// definition de la carte
typedef
EmbeddedMap2
<
Map2
>
MAP
;
};
PFP
::
MAP
myMap
;
void
MyQT
::
cb_initGL
()
{
// choose to use GL version 2
...
...
@@ -78,11 +74,10 @@ void MyQT::cb_initGL()
m_shader2
->
setColor
(
Geom
::
Vec4f
(
1.
,
1.
,
0.
,
0.
));
register
Running
(
m_shader
);
register
Running
(
m_shader2
);
register
Shader
(
m_shader
);
register
Shader
(
m_shader2
);
}
void
MyQT
::
cb_redraw
()
{
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_FILL
);
...
...
@@ -98,8 +93,6 @@ void MyQT::cb_redraw()
glDisable
(
GL_POLYGON_OFFSET_FILL
);
}
int
main
(
int
argc
,
char
**
argv
)
{
// interface:
...
...
@@ -108,7 +101,6 @@ int main(int argc, char **argv)
PFP
::
TVEC3
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
"position"
)
;
// create a cylinder
Algo
::
Modelisation
::
Polyhedron
<
PFP
>
prim1
(
myMap
,
position
);
prim1
.
cylinder_topo
(
16
,
8
,
true
,
false
);
...
...
@@ -148,7 +140,6 @@ int main(int argc, char **argv)
Geom
::
translate
<
float
>
(
270.0
f
,
0.0
,
0.0
,
trf
);
prim4
.
transform
(
trf
);
// bounding box
Geom
::
BoundingBox
<
PFP
::
VEC3
>
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
position
);
float
lWidthObj
=
std
::
max
<
PFP
::
REAL
>
(
std
::
max
<
PFP
::
REAL
>
(
bb
.
size
(
0
),
bb
.
size
(
1
)),
bb
.
size
(
2
));
...
...
@@ -174,8 +165,5 @@ int main(int argc, char **argv)
// et on attend la fin.
return
app
.
exec
();
return
0
;
}
Apps/Tuto/tp_master.cpp
View file @
ad03bdaf
...
...
@@ -49,11 +49,9 @@
#include "Utils/drawer.h"
/// pour simplifier l'ecriture du code
using
namespace
CGoGN
;
/// definition de la structure qui decrit le type de carte utilise
struct
PFP
:
public
PFP_STANDARD
...
...
@@ -95,10 +93,6 @@ Dart d_maison;
///
/// Fonction Carre: construit un carre et renvoit un brin
///
...
...
@@ -347,8 +341,8 @@ void MyQT::cb_initGL()
m_shader2
=
new
Utils
::
ShaderSimpleColor
();
m_shader2
->
setAttributePosition
(
m_positionVBO
);
m_shader2
->
setColor
(
Geom
::
Vec4f
(
0.
,
0.1
,
0.
,
0.
));
register
Running
(
m_shader
);
register
Running
(
m_shader2
);
register
Shader
(
m_shader
);
register
Shader
(
m_shader2
);
}
...
...
Apps/Tuto/tp_master.h
View file @
ad03bdaf
...
...
@@ -25,15 +25,13 @@
#ifndef TP_MASTER_H_
#define TP_MASTER_H_
#include <iostream>
#include "Utils/qtSimple.h"
// forward definitions (minimize includes)
namespace
CGoGN
{
namespace
Algo
{
namespace
Render
{
namespace
GL2
{
class
MapRender
;
}
}}
}
namespace
CGoGN
{
namespace
Algo
{
namespace
Render
{
namespace
GL2
{
class
TopoRenderMapD
;
}
}}
}
namespace
CGoGN
{
namespace
Algo
{
namespace
Render
{
namespace
GL2
{
class
MapRender
;
}
}
}
}
namespace
CGoGN
{
namespace
Algo
{
namespace
Render
{
namespace
GL2
{
class
TopoRenderMapD
;
}
}
}
}
namespace
CGoGN
{
namespace
Utils
{
class
VBO
;
}
}
namespace
CGoGN
{
namespace
Utils
{
class
ShaderPhong
;
}
}
namespace
CGoGN
{
namespace
Utils
{
class
ShaderSimpleColor
;
}
}
...
...
@@ -44,7 +42,6 @@ using namespace CGoGN ;
/**
* A class for a little interface and rendering
*/
class
MyQT
:
public
Utils
::
QT
::
SimpleQT
{
Q_OBJECT
...
...
@@ -52,6 +49,7 @@ class MyQT: public Utils::QT::SimpleQT
protected:
bool
m_drawTopo
;
void
drawSelected
();
public:
// render
Algo
::
Render
::
GL2
::
MapRender
*
m_render
;
...
...
@@ -76,7 +74,8 @@ public:
m_render
(
NULL
),
m_render_topo
(
NULL
),
m_positionVBO
(
NULL
),
m_normalVBO
(
NULL
),
m_shader
(
NULL
),
m_shader2
(
NULL
),
renderTopo
(
true
)
{}
renderTopo
(
true
)
{}
// callbacks of simpleQT to overdefine:
void
cb_redraw
();
...
...
@@ -87,4 +86,3 @@ public:
};
#endif
Apps/Tuto/tuto1.cpp
View file @
ad03bdaf
...
...
@@ -21,7 +21,9 @@
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
//#define GL3_PROTOTYPES
#include "tuto1.h"
#include <iostream>
...
...
@@ -37,13 +39,10 @@
#include "Algo/Render/GL2/mapRender.h"
#include "Utils/shaderSimpleColor.h"
#include <glm/gtc/type_ptr.hpp>
using
namespace
CGoGN
;
/**
* Struct that contains some informations about the types of the manipulated objects
* Mainly here to be used by the algorithms that are parameterized by it
...
...
@@ -54,8 +53,6 @@ struct PFP: public PFP_STANDARD
typedef
EmbeddedMap2
<
Map2
>
MAP
;
};
void
MyQT
::
cb_initGL
()
{
// choose to use GL version 2
...
...
@@ -70,12 +67,10 @@ void MyQT::cb_initGL()
// using simple shader with color
m_shader
=
new
Utils
::
ShaderSimpleColor
();
m_shader
->
setAttributePosition
(
m_positionVBO
);
m_shader
->
setColor
(
Geom
::
Vec4f
(
0.
,
1.
,
0.
,
0.
));
register
Running
(
m_shader
);
m_shader
->
setColor
(
Geom
::
Vec4f
(
0.
0
f
,
1.0
f
,
0.0
f
,
0.0
f
));
register
Shader
(
m_shader
);
}
void
MyQT
::
cb_redraw
()
{
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_FILL
);
...
...
@@ -97,7 +92,6 @@ void MyQT::cb_redraw()
}
}
void
MyQT
::
cb_keyPress
(
int
code
)
{
if
((
code
>
65
)
&&
(
code
<
123
))
...
...
@@ -105,17 +99,13 @@ void MyQT::cb_keyPress(int code)
if
((
code
>
'0'
)
&&
(
code
<=
'9'
))
CGoGNout
<<
" key num "
<<
code
-
'0'
<<
"pressed"
<<
CGoGNendl
;
}
int
main
(
int
argc
,
char
**
argv
)
{
// declaration of the map
PFP
::
MAP
myMap
;
// creation of 2 new faces: 1 triangle and 1 square
Dart
d1
=
myMap
.
newFace
(
3
);
Dart
d2
=
myMap
.
newFace
(
4
);
...
...
@@ -135,9 +125,6 @@ int main(int argc, char **argv)
position
[
myMap
.
phi
<
11
>
(
d2
)]
=
PFP
::
VEC3
(
0
,
-
2
,
0
);
position
[
myMap
.
phi_1
(
d2
)]
=
PFP
::
VEC3
(
2
,
-
2
,
0
);
// interface:
QApplication
app
(
argc
,
argv
);
MyQT
sqt
;
...
...
@@ -157,7 +144,7 @@ int main(int argc, char **argv)
Geom
::
Vec3f
lPosObj
=
(
bb
.
min
()
+
bb
.
max
())
/
PFP
::
REAL
(
2
);
// envoit info BB a l'interface
sqt
.
setParamObject
(
lWidthObj
,
lPosObj
.
data
());
sqt
.
setParamObject
(
lWidthObj
,
lPosObj
.
data
());
// show 1 pour GL context
sqt
.
show
();
...
...
@@ -175,5 +162,4 @@ int main(int argc, char **argv)
// et on attend la fin.
return
app
.
exec
();
}
Apps/Tuto/tuto1.h
View file @
ad03bdaf
...
...
@@ -21,18 +21,17 @@
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef TUTO1
#define TUTO1
#ifndef _TUTO1_
#define _TUTO1_
#include <iostream>
#include "Utils/qtSimple.h"
#include "Utils/cgognStream.h"
// forward definitions (minimize includes)
namespace
CGoGN
{
namespace
Algo
{
namespace
Render
{
namespace
GL2
{
class
MapRender
;
}
}}
}
namespace
CGoGN
{
namespace
Algo
{
namespace
Render
{
namespace
GL2
{
class
MapRender
;
}
}
}
}
namespace
CGoGN
{
namespace
Utils
{
class
VBO
;
}
}
namespace
CGoGN
{
namespace
Utils
{
class
ShaderSimpleColor
;
}
}
...
...
@@ -41,10 +40,10 @@ using namespace CGoGN ;
/**
* A class for a little interface and rendering
*/
class
MyQT
:
public
Utils
::
QT
::
SimpleQT
class
MyQT
:
public
Utils
::
QT
::
SimpleQT
{
Q_OBJECT
public:
// render
Algo
::
Render
::
GL2
::
MapRender
*
m_render
;
...
...
@@ -55,25 +54,22 @@ public:
// shader basic
Utils
::
ShaderSimpleColor
*
m_shader
;
MyQT
()
:
m_render
(
NULL
),
m_positionVBO
(
NULL
),
m_shader
(
NULL
)
{}
MyQT
()
:
m_render
(
NULL
),
m_positionVBO
(
NULL
),
m_shader
(
NULL
)
{}
// callbacks of simpleQT to overdefine:
void
cb_redraw
();
void
cb_initGL
();
void
cb_redraw
();
void
cb_keyPress
(
int
code
);
void
cb_New
()
{
CGoGNout
<<
"New ..."
<<
CGoGNendl
;}
void
cb_Save
()
{
CGoGNout
<<
"Rien a sauver ..."
<<
CGoGNendl
;
}
void
cb_New
()
{
CGoGNout
<<
"New ..."
<<
CGoGNendl
;
}
void
cb_Save
()
{
CGoGNout
<<
"Rien a sauver ..."
<<
CGoGNendl
;
}
// callbacks (slots) locally defined
public
slots
:
void
menu_slot1
()
{
CGoGNout
<<
"Exemple de menu"
<<
CGoGNendl
;
}
void
menu_slot1
()
{
CGoGNout
<<
"Exemple de menu"
<<
CGoGNendl
;
}
};
#endif
Apps/Tuto/tuto2.cpp
View file @
ad03bdaf
...
...
@@ -36,8 +36,6 @@
#include "tuto2.h"
using
namespace
CGoGN
;
struct
PFP
:
public
PFP_STANDARD
...
...
@@ -46,7 +44,6 @@ struct PFP: public PFP_STANDARD
typedef
Map2
MAP
;
};
PFP
::
MAP
myMap
;
SelectorTrue
allDarts
;
...
...
@@ -55,7 +52,6 @@ PFP::TVEC3 position ;
PFP
::
TVEC3
normal
;
AttributeHandler
<
Geom
::
Vec4f
>
color
;
void
MyQT
::
cb_initGL
()
{
// choose to use GL version 2
...
...
@@ -74,15 +70,12 @@ void MyQT::cb_initGL()
m_color
=
Geom
::
Vec4f
(
0.
,
1.
,
0.
,
0.
);
m_shader
->
setColor
(
m_color
);
registerRunning
(
m_shader
);
m_with_lines
=
true
;
m_line_width
=
4.0
;
registerShader
(
m_shader
);
m_with_lines
=
true
;
m_line_width
=
4.0
;
}
void
MyQT
::
cb_redraw
()
{
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_FILL
);
...
...
@@ -106,15 +99,12 @@ void MyQT::cb_redraw()
}
}
void
MyQT
::
lines_slot
(
bool
x
)
{
m_with_lines
=
x
;
updateGL
();
}
void
MyQT
::
line_width_slot
(
int
x
)
{
...
...
@@ -122,8 +112,6 @@ void MyQT::line_width_slot(int x)
updateGL
();
}
void
MyQT
::
color_slot
()
{
QColor
col
=
QColorDialog
::
getColor
();
...
...
@@ -135,12 +123,11 @@ void MyQT::color_slot()
}
else
{
CGoGNout
<<
"Cancel Color"
<<
CGoGNendl
;
CGoGNout
<<
"Cancel Color"
<<
CGoGNendl
;
}
}
// Algorithme qui parcours une carte et affiche l'attribut position de chaque brin
//
template
<
typename
PFP
>
void
TestDeParcoursAFF
(
typename
PFP
::
MAP
&
m
,
MapBrowser
&
mb
,
const
typename
PFP
::
TVEC3
&
pos
)
{
...
...
@@ -151,7 +138,6 @@ void TestDeParcoursAFF(typename PFP::MAP& m, MapBrowser& mb, const typename PFP:
}
}
int
main
(
int
argc
,
char
**
argv
)
{
/// Utilisation des MapBrowsers
...
...
@@ -160,7 +146,7 @@ int main(int argc, char **argv)
Dart
d2
=
myMap
.
newOrientedFace
(
3
);
Dart
d3
=
myMap
.
newOrientedFace
(
4
);
myMap
.
sewFaces
(
d2
,
d3
);
myMap
.
sewFaces
(
d2
,
d3
);
position
=
myMap
.
addAttribute
<
Geom
::
Vec3f
>
(
VERTEX_ORBIT
,
"position"
);
...
...
@@ -176,12 +162,11 @@ int main(int argc, char **argv)
position
[
d3
]
=
PFP
::
VEC3
(
2.0
f
,
-
2.0
f
,
0.0
f
);
d3
=
myMap
.
phi1
(
d3
);
// MapBrowser: la carte elle meme
CGoGNout
<<
"Parcours avec la carte"
<<
CGoGNendl
;
CGoGNout
<<
"Parcours avec la carte"
<<
CGoGNendl
;
TestDeParcoursAFF
<
PFP
>
(
myMap
,
myMap
,
position
);
// MapBrowserLinkedAuto
// sous-carte dans une liste avec attribut gere par le browser
CGoGNout
<<
"Parcours avec le browser (les sommets)"
<<
CGoGNendl
;
...
...
@@ -196,7 +181,6 @@ int main(int argc, char **argv)
TestDeParcoursAFF
<
PFP
>
(
myMap
,
mbl
,
position
);
// MapBrowserLinkedAttr
// sous-carte dans une liste avec attribut gere par l'appelant
CGoGNout
<<
"Parcours avec le browser (le triangle)"
<<
CGoGNendl
;
...
...
@@ -217,7 +201,6 @@ int main(int argc, char **argv)
TestDeParcoursAFF
<
PFP
>
(
myMap
,
mbl2
,
position
);
// MapBrowserSelector
// sous-carte avec des brins marques (equivalent de l'utilisation de good dans les algos)
CGoGNout
<<
"Parcours avec le browser selector"
<<
CGoGNendl
;
...
...
@@ -248,7 +231,6 @@ int main(int argc, char **argv)
sqt
.
setCallBack
(
dock
.
color_button
,
SIGNAL
(
pressed
()),
SLOT
(
color_slot
())
);
sqt
.
setCallBack
(
dock
.
dial_line_width
,
SIGNAL
(
valueChanged
(
int
)),
SLOT
(
line_width_slot
(
int
))
);
// message d'aide
sqt
.
setHelpMsg
(
"Second Tuto"
);
...
...
@@ -278,5 +260,4 @@ int main(int argc, char **argv)
// et on attend la fin.
return
app
.
exec
();
}
Apps/Tuto/tuto2.h
View file @
ad03bdaf
...
...
@@ -21,13 +21,12 @@
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef __TUTO2_
#define __TUTO2_
#ifndef _TUTO2_
#define _TUTO2_
#include <iostream>
#include "Utils/qtSimple.h"
#include "ui_tuto2.h"
#include "Utils/qtui.h"
...
...
@@ -35,7 +34,7 @@
#include "Geometry/vector_gen.h"
// forward definitions (minimize includes)
namespace
CGoGN
{
namespace
Algo
{
namespace
Render
{
namespace
GL2
{
class
MapRender
;
}
}}
}
namespace
CGoGN
{
namespace
Algo
{
namespace
Render
{
namespace
GL2
{
class
MapRender
;
}
}
}
}
namespace
CGoGN
{
namespace
Utils
{
class
VBO
;
}
}
namespace
CGoGN
{
namespace
Utils
{
class
ShaderSimpleColor
;
}
}
...
...
@@ -56,8 +55,8 @@ class MyQT: public Utils::QT::SimpleQT
bool
m_with_lines
;
Geom
::
Vec4f
m_color
;
int
m_line_width
;
public:
public:
// render
Algo
::
Render
::
GL2
::
MapRender
*
m_render
;
...
...
@@ -67,8 +66,8 @@ public:
// shader basic
Utils
::
ShaderSimpleColor
*
m_shader
;
MyQT
()
:
m_render
(
NULL
),
m_positionVBO
(
NULL
),
m_shader
(
NULL
)
{}
MyQT
()
:
m_render
(
NULL
),
m_positionVBO
(
NULL
),
m_shader
(
NULL
)
{}
void
cb_redraw
();
...
...
@@ -79,9 +78,6 @@ public slots:
void
lines_slot
(
bool
x
);
void
line_width_slot
(
int
x
);
void
color_slot
();
};
#endif
Apps/Tuto/tuto3.cpp
View file @
ad03bdaf
...
...
@@ -47,10 +47,6 @@ struct PFP: public PFP_STANDARD
typedef
Map2
MAP
;
};
void
MyQT
::
cb_initGL
()
{
// choose to use GL version 2
...
...
@@ -72,12 +68,10 @@ void MyQT::cb_initGL()
m_shader2
->
setAttributePosition
(
m_positionVBO
);
m_shader2
->
setAttributeColor
(
m_colorVBO
);
registerRunning
(
m_shader
);
registerRunning
(
m_shader2
);
registerShader
(
m_shader
);
registerShader
(
m_shader2
);
}
void
MyQT
::
cb_redraw
()
{
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_FILL
);
...
...
@@ -90,10 +84,8 @@ void MyQT::cb_redraw()
glPolygonOffset
(
1.0
f
,
1.0
f
);
m_render
->
draw
(
m_shader2
,
Algo
::
Render
::
GL2
::
TRIANGLES
);
glDisable
(
GL_POLYGON_OFFSET_FILL
);
}
void
MyQT
::
cb_keyPress
(
int
code
)
{
switch
(
code
)
...
...
@@ -105,14 +97,10 @@ void MyQT::cb_keyPress(int code)
sqt2_ptr
->
synchronize
(
sqt1_ptr
);
break
;
}
}
int
main
(
int
argc
,
char
**
argv
)
{
PFP
::
MAP
myMap
;
SelectorTrue
allDarts
;
...
...
@@ -144,7 +132,6 @@ int main(int argc, char **argv)
color
[
d3
]
=
PFP
::
VEC3
(
0.0
f
,
1.0
f
,
1.0
f
);
d3
=
myMap
.
phi1
(
d3
);
//MARK !!!
// on reserve des marqueur de brins
...
...
@@ -169,19 +156,17 @@ int main(int argc, char **argv)
CGoGNout
<<
"Sommet de dart "
<<
d
.
label
()
<<
" marque par mcv"
<<
CGoGNendl
;
}
//nettoyage
cm
.
unmarkAll
();
// interface:
// interface:
QApplication
app
(
argc
,
argv
);
MyQT
sqt
;
sqt1_ptr
=
&
sqt
;
sqt1_ptr
=
&
sqt
;
MyQT
sqt2
;
sqt2_ptr
=
&
sqt2
;
sqt2_ptr
=
&
sqt2
;
// message d'aide
sqt
.
setHelpMsg
(
"Tuto3:
\n
"
...
...
@@ -194,7 +179,7 @@ int main(int argc, char **argv)
Geom
::
Vec3f
lPosObj
=
(
bb
.
min
()
+
bb
.
max
())
/
PFP
::
REAL
(
2
);
// envoit info BB a l'interface
sqt
.
setParamObject
(
lWidthObj
,
lPosObj
.
data
());
sqt
.
setParamObject
(
lWidthObj
,
lPosObj
.
data
());
// show 1 pour GL context
sqt
.
show
();
...
...
@@ -204,7 +189,6 @@ int main(int argc, char **argv)
// update du VBO color
sqt
.
m_colorVBO
->
updateData
(
color
);
// update des primitives du renderer
sqt
.
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
TRIANGLES
);
sqt
.
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
LINES
);
...
...
@@ -235,8 +219,6 @@ int main(int argc, char **argv)
position2
[
dx
]
=
PFP
::
VEC3
(
0.0
f
,
2.0
f
,
0.0
f
);
color2
[
dx
]
=
PFP
::
VEC3
(
0.0
f
,
1.0
f
,
1.0
f
);
sqt2
.
setHelpMsg
(
"Fenetre 2!!"
);
sqt2
.
setParamObject
(
lWidthObj
,
lPosObj
.
data
());
...
...
@@ -249,13 +231,10 @@ int main(int argc, char **argv)
// update du VBO color
sqt2
.
m_colorVBO
->
updateData
(
color2
);
// update des primitives du renderer
sqt2
.
m_render
->
initPrimitives
<
PFP
>
(
myMap2
,
allDarts
,
Algo
::
Render
::
GL2
::
TRIANGLES
);
sqt2
.
m_render
->
initPrimitives
<
PFP
>
(
myMap2
,
allDarts
,
Algo
::
Render
::
GL2
::
LINES
);