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
b29a40b3
Commit
b29a40b3
authored
Sep 11, 2014
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of /home/git/repositories/thery/cgogn into develop
parents
4018ac0a
26dd6409
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
58 additions
and
30 deletions
+58
-30
Apps/Examples/viewer.cpp
Apps/Examples/viewer.cpp
+3
-1
Apps/Examples/volumeExplorer.cpp
Apps/Examples/volumeExplorer.cpp
+2
-0
SCHNApps/Plugins/surface_import/src/surface_import.cpp
SCHNApps/Plugins/surface_import/src/surface_import.cpp
+0
-6
SCHNApps/src/main.cpp
SCHNApps/src/main.cpp
+6
-2
SCHNApps/src/view.cpp
SCHNApps/src/view.cpp
+4
-2
include/Algo/Topo/Map2/uniformOrientation.hpp
include/Algo/Topo/Map2/uniformOrientation.hpp
+8
-8
include/Utils/Shaders/shaderFlat.geom
include/Utils/Shaders/shaderFlat.geom
+4
-4
src/Utils/GLSLShader.cpp
src/Utils/GLSLShader.cpp
+31
-6
src/Utils/Qt/qtgl.cpp
src/Utils/Qt/qtgl.cpp
+0
-1
No files found.
Apps/Examples/viewer.cpp
View file @
b29a40b3
...
@@ -78,7 +78,9 @@ void Viewer::initGUI()
...
@@ -78,7 +78,9 @@ void Viewer::initGUI()
void
Viewer
::
cb_initGL
()
void
Viewer
::
cb_initGL
()
{
{
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
)
;
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
3
)
;
CGoGNout
<<
"GL VERSION = "
<<
glGetString
(
GL_VERSION
)
<<
CGoGNendl
;
Utils
::
GLSLShader
::
areShadersSupported
();
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
()
;
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
()
;
m_topoRender
=
new
Algo
::
Render
::
GL2
::
TopoRenderMap
<
PFP
>
()
;
m_topoRender
=
new
Algo
::
Render
::
GL2
::
TopoRenderMap
<
PFP
>
()
;
...
...
Apps/Examples/volumeExplorer.cpp
View file @
b29a40b3
...
@@ -206,6 +206,8 @@ void MyQT::cb_initGL()
...
@@ -206,6 +206,8 @@ void MyQT::cb_initGL()
{
{
// choose to use GL version 2
// choose to use GL version 2
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
CGoGNout
<<
"GL VERSION = "
<<
glGetString
(
GL_VERSION
)
<<
CGoGNendl
;
Utils
::
GLSLShader
::
areShadersSupported
();
// create the renders
// create the renders
m_topo_render
=
new
Algo
::
Render
::
GL2
::
Topo3RenderMap
<
PFP
>
();
m_topo_render
=
new
Algo
::
Render
::
GL2
::
Topo3RenderMap
<
PFP
>
();
...
...
SCHNApps/Plugins/surface_import/src/surface_import.cpp
View file @
b29a40b3
...
@@ -31,12 +31,6 @@ MapHandlerGen* Surface_Import_Plugin::importFromFile(const QString& fileName)
...
@@ -31,12 +31,6 @@ MapHandlerGen* Surface_Import_Plugin::importFromFile(const QString& fileName)
if
(
fi
.
exists
())
if
(
fi
.
exists
())
{
{
MapHandlerGen
*
mhg
=
m_schnapps
->
addMap
(
fi
.
baseName
(),
2
);
MapHandlerGen
*
mhg
=
m_schnapps
->
addMap
(
fi
.
baseName
(),
2
);
std
::
cout
<<
"IMPORT PLUGIN 2"
<<
std
::
endl
;
std
::
cout
<<
"PTR="
<<
GenericMap
::
s_instances
<<
std
::
endl
;
for
(
auto
inst
:
*
GenericMap
::
s_instances
)
std
::
cout
<<
inst
<<
std
::
endl
;
if
(
mhg
)
if
(
mhg
)
{
{
MapHandler
<
PFP2
>*
mh
=
static_cast
<
MapHandler
<
PFP2
>*>
(
mhg
);
MapHandler
<
PFP2
>*
mh
=
static_cast
<
MapHandler
<
PFP2
>*>
(
mhg
);
...
...
SCHNApps/src/main.cpp
View file @
b29a40b3
...
@@ -24,9 +24,13 @@ int main(int argc, char* argv[])
...
@@ -24,9 +24,13 @@ int main(int argc, char* argv[])
// get a smart pointer to the __main__ module of the Python interpreter
// get a smart pointer to the __main__ module of the Python interpreter
PythonQtObjectPtr
pythonContext
=
PythonQt
::
self
()
->
getMainModule
();
PythonQtObjectPtr
pythonContext
=
PythonQt
::
self
()
->
getMainModule
();
PythonQtScriptingConsole
pythonConsole
(
NULL
,
pythonContext
);
CGoGN
::
SCHNApps
::
SCHNApps
schnapps
(
app
.
applicationDirPath
(),
pythonContext
,
pythonConsole
);
// PythonQtScriptingConsole pythonConsole(NULL, pythonContext);
// CGoGN::SCHNApps::SCHNApps schnapps(app.applicationDirPath(), pythonContext, pythonConsole);
PythonQtScriptingConsole
*
pythonConsole
=
new
PythonQtScriptingConsole
(
NULL
,
pythonContext
);
CGoGN
::
SCHNApps
::
SCHNApps
schnapps
(
app
.
applicationDirPath
(),
pythonContext
,
*
pythonConsole
);
schnapps
.
show
();
schnapps
.
show
();
pythonContext
.
addObject
(
"schnapps"
,
&
schnapps
);
pythonContext
.
addObject
(
"schnapps"
,
&
schnapps
);
...
...
SCHNApps/src/view.cpp
View file @
b29a40b3
...
@@ -108,7 +108,8 @@ void View::unlinkPlugin(PluginInteraction* plugin)
...
@@ -108,7 +108,8 @@ void View::unlinkPlugin(PluginInteraction* plugin)
{
{
plugin
->
unlinkView
(
this
);
plugin
->
unlinkView
(
this
);
emit
(
pluginUnlinked
(
plugin
));
emit
(
pluginUnlinked
(
plugin
));
updateGL
();
// removed because of crash when application close
// updateGL();
}
}
}
}
...
@@ -159,7 +160,8 @@ void View::unlinkMap(MapHandlerGen* map)
...
@@ -159,7 +160,8 @@ void View::unlinkMap(MapHandlerGen* map)
emit
(
mapUnlinked
(
map
));
emit
(
mapUnlinked
(
map
));
updateCurrentCameraBB
();
updateCurrentCameraBB
();
updateGL
();
// removed because of crash when application close
// updateGL();
disconnect
(
map
->
getFrame
(),
SIGNAL
(
modified
()),
this
,
SLOT
(
updateGL
()));
disconnect
(
map
->
getFrame
(),
SIGNAL
(
modified
()),
this
,
SLOT
(
updateGL
()));
disconnect
(
map
,
SIGNAL
(
selectedCellsChanged
(
CellSelectorGen
*
)),
this
,
SLOT
(
updateGL
()));
disconnect
(
map
,
SIGNAL
(
selectedCellsChanged
(
CellSelectorGen
*
)),
this
,
SLOT
(
updateGL
()));
...
...
include/Algo/Topo/Map2/uniformOrientation.hpp
View file @
b29a40b3
...
@@ -106,7 +106,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
...
@@ -106,7 +106,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
DartMarker
<
MAP
>
cmf
(
map
);
DartMarker
<
MAP
>
cmf
(
map
);
cmf
.
markOrbit
<
FACE
>
(
faceSeed
);
cmf
.
template
markOrbit
<
FACE
>(
faceSeed
);
propag
.
push_back
(
faceSeed
);
propag
.
push_back
(
faceSeed
);
while
(
!
propag
.
empty
()
||
!
propag_inv
.
empty
())
while
(
!
propag
.
empty
()
||
!
propag_inv
.
empty
())
...
@@ -120,7 +120,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
...
@@ -120,7 +120,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
do
do
{
{
Dart
e
=
map
.
phi2
(
d
);
Dart
e
=
map
.
phi2
(
d
);
if
(
map
.
isBoundaryMarked2
(
e
))
if
(
map
.
template
isBoundaryMarked
<
2
>
(
e
))
{
{
e
=
findOtherInCouplesOfDarts
(
couples
,
d
);
e
=
findOtherInCouplesOfDarts
(
couples
,
d
);
if
(
e
!=
NIL
)
if
(
e
!=
NIL
)
...
@@ -129,7 +129,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
...
@@ -129,7 +129,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
{
{
propag_inv
.
push_back
(
e
);
propag_inv
.
push_back
(
e
);
face2invert
.
push_back
(
e
);
face2invert
.
push_back
(
e
);
cmf
.
markOrbit
<
FACE
>
(
e
);
cmf
.
template
markOrbit
<
FACE
>(
e
);
}
}
cmf
.
mark
(
map
.
phi2
(
e
));
// use cmf also to mark boudary cycle to invert
cmf
.
mark
(
map
.
phi2
(
e
));
// use cmf also to mark boudary cycle to invert
}
}
...
@@ -140,7 +140,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
...
@@ -140,7 +140,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
if
(
!
cmf
.
isMarked
(
e
))
if
(
!
cmf
.
isMarked
(
e
))
{
{
propag
.
push_back
(
e
);
propag
.
push_back
(
e
);
cmf
.
markOrbit
<
FACE
>
(
e
);
cmf
.
template
markOrbit
<
FACE
>(
e
);
}
}
}
}
d
=
map
.
phi1
(
d
);
d
=
map
.
phi1
(
d
);
...
@@ -157,7 +157,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
...
@@ -157,7 +157,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
do
do
{
{
Dart
e
=
map
.
phi2
(
d
);
Dart
e
=
map
.
phi2
(
d
);
if
(
map
.
isBoundaryMarked2
(
e
))
if
(
map
.
template
isBoundaryMarked
<
2
>
(
e
))
{
{
e
=
findOtherInCouplesOfDarts
(
couples
,
d
);
e
=
findOtherInCouplesOfDarts
(
couples
,
d
);
if
(
e
!=
NIL
)
if
(
e
!=
NIL
)
...
@@ -165,7 +165,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
...
@@ -165,7 +165,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
if
(
!
cmf
.
isMarked
(
e
))
if
(
!
cmf
.
isMarked
(
e
))
{
{
propag
.
push_back
(
e
);
propag
.
push_back
(
e
);
cmf
.
markOrbit
<
FACE
>
(
e
);
cmf
.
template
markOrbit
<
FACE
>(
e
);
}
}
cmf
.
mark
(
map
.
phi2
(
d
));
// use cmf also to mark boudary cycle to invert
cmf
.
mark
(
map
.
phi2
(
d
));
// use cmf also to mark boudary cycle to invert
}
}
...
@@ -176,7 +176,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
...
@@ -176,7 +176,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
{
{
propag_inv
.
push_back
(
e
);
propag_inv
.
push_back
(
e
);
face2invert
.
push_back
(
e
);
face2invert
.
push_back
(
e
);
cmf
.
markOrbit
<
FACE
>
(
e
);
cmf
.
template
markOrbit
<
FACE
>(
e
);
}
}
}
}
d
=
map
.
phi1
(
d
);
// traverse all edges of face
d
=
map
.
phi1
(
d
);
// traverse all edges of face
...
@@ -195,7 +195,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
...
@@ -195,7 +195,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
if
(
cmf
.
isMarked
(
e
))
// check cmf for wrong orientation
if
(
cmf
.
isMarked
(
e
))
// check cmf for wrong orientation
{
{
reverse2MapFaceKeepPhi2
<
MAP
>
(
map
,
e
);
reverse2MapFaceKeepPhi2
<
MAP
>
(
map
,
e
);
cmf
.
unmarkOrbit
<
FACE
>
(
e
);
cmf
.
template
unmarkOrbit
<
FACE
>(
e
);
}
}
}
}
...
...
include/Utils/Shaders/shaderFlat.geom
View file @
b29a40b3
...
@@ -16,7 +16,7 @@ void main(void)
...
@@ -16,7 +16,7 @@ void main(void)
N
=
normalize
(
vec3
(
NormalMatrix
*
vec4
(
N
,
0
.
0
)));
N
=
normalize
(
vec3
(
NormalMatrix
*
vec4
(
N
,
0
.
0
)));
vec3
center
=
POSITION_IN
(
0
).
xyz
+
POSITION_IN
(
1
).
xyz
+
POSITION_IN
(
2
).
xyz
;
vec3
center
=
POSITION_IN
(
0
).
xyz
+
POSITION_IN
(
1
).
xyz
+
POSITION_IN
(
2
).
xyz
;
center
/=
3
.
0
;
center
/=
3
.
0
;
vec4
newPos
=
ModelViewMatrix
*
vec4
(
center
,
0
.
0
);
vec4
newPos
=
ModelViewMatrix
*
vec4
(
center
,
1
.
0
);
vec3
L
=
normalize
(
lightPosition
-
newPos
.
xyz
);
vec3
L
=
normalize
(
lightPosition
-
newPos
.
xyz
);
float
lambertTerm
=
dot
(
N
,
L
);
float
lambertTerm
=
dot
(
N
,
L
);
ColorFS
=
ambient
;
ColorFS
=
ambient
;
...
...
src/Utils/GLSLShader.cpp
View file @
b29a40b3
...
@@ -148,10 +148,35 @@ bool GLSLShader::areGeometryShadersSupported()
...
@@ -148,10 +148,35 @@ bool GLSLShader::areGeometryShadersSupported()
bool
GLSLShader
::
areShadersSupported
()
bool
GLSLShader
::
areShadersSupported
()
{
{
if
(
!
glewGetExtension
(
"GL_ARB_vertex_shader"
))
return
false
;
if
(
!
glewIsSupported
(
"GL_ARB_vertex_shader"
))
if
(
!
glewGetExtension
(
"GL_ARB_fragment_shader"
))
return
false
;
{
if
(
!
glewGetExtension
(
"GL_ARB_shader_objects"
))
return
false
;
CGoGNerr
<<
" vertex shaders not supported!"
<<
CGoGNendl
;
if
(
!
glewGetExtension
(
"GL_ARB_shading_language_100"
))
return
false
;
return
false
;
}
if
(
!
glewIsSupported
(
"GL_ARB_fragment_shader"
))
{
CGoGNerr
<<
" fragment shaders not supported!"
<<
CGoGNendl
;
return
false
;
}
if
(
!
glewIsSupported
(
"GL_ARB_geometry_shader4"
))
{
CGoGNerr
<<
" geometry shaders not supported!"
<<
CGoGNendl
;
return
false
;
}
if
(
!
glewIsSupported
(
"GL_ARB_shader_objects"
))
{
CGoGNerr
<<
" shaders not supported!"
<<
CGoGNendl
;
return
false
;
}
if
(
!
glewIsSupported
(
"GL_ARB_shading_language_100"
))
{
CGoGNerr
<<
" GLSL no supported!"
<<
CGoGNendl
;
return
false
;
}
return
true
;
return
true
;
}
}
...
@@ -399,7 +424,7 @@ bool GLSLShader::loadGeometryShaderSourceString( const char *geom_shader_source
...
@@ -399,7 +424,7 @@ bool GLSLShader::loadGeometryShaderSourceString( const char *geom_shader_source
*
m_geom_shader_object
=
0
;
*
m_geom_shader_object
=
0
;
}
}
/*** create shader object ***/
/*** create shader object ***/
*
m_geom_shader_object
=
glCreateShader
(
GL_GEOMETRY_SHADER
_EXT
);
*
m_geom_shader_object
=
glCreateShader
(
GL_GEOMETRY_SHADER
);
if
(
!*
m_geom_shader_object
)
if
(
!*
m_geom_shader_object
)
{
{
...
@@ -1088,9 +1113,9 @@ void GLSLShader::enableVertexAttribs(unsigned int stride, unsigned int begin) co
...
@@ -1088,9 +1113,9 @@ void GLSLShader::enableVertexAttribs(unsigned int stride, unsigned int begin) co
this
->
bind
();
this
->
bind
();
for
(
std
::
vector
<
Utils
::
GLSLShader
::
VAStr
>::
const_iterator
it
=
m_va_vbo_binding
.
begin
();
it
!=
m_va_vbo_binding
.
end
();
++
it
)
for
(
std
::
vector
<
Utils
::
GLSLShader
::
VAStr
>::
const_iterator
it
=
m_va_vbo_binding
.
begin
();
it
!=
m_va_vbo_binding
.
end
();
++
it
)
{
{
assert
(((
it
->
vbo_ptr
->
nbElts
()
==
0
)
||
(
it
->
vbo_ptr
->
dataSize
()
!=
0
)
)
||
!
"dataSize of VBO is 0 ! could not draw"
);
glBindBuffer
(
GL_ARRAY_BUFFER
,
it
->
vbo_ptr
->
id
());
glBindBuffer
(
GL_ARRAY_BUFFER
,
it
->
vbo_ptr
->
id
());
glEnableVertexAttribArray
(
it
->
va_id
);
glEnableVertexAttribArray
(
it
->
va_id
);
assert
((
it
->
vbo_ptr
->
dataSize
()
!=
0
)
||
!
"dataSize of VBO is 0 ! could not draw"
);
glVertexAttribPointer
(
it
->
va_id
,
it
->
vbo_ptr
->
dataSize
(),
GL_FLOAT
,
false
,
stride
,
(
const
GLvoid
*
)((
unsigned
long
)(
begin
)));
glVertexAttribPointer
(
it
->
va_id
,
it
->
vbo_ptr
->
dataSize
(),
GL_FLOAT
,
false
,
stride
,
(
const
GLvoid
*
)((
unsigned
long
)(
begin
)));
}
}
// this->unbind();
// this->unbind();
...
...
src/Utils/Qt/qtgl.cpp
View file @
b29a40b3
...
@@ -193,7 +193,6 @@ glm::vec3& GLWidget::getObjPos()
...
@@ -193,7 +193,6 @@ glm::vec3& GLWidget::getObjPos()
void
GLWidget
::
initializeGL
()
void
GLWidget
::
initializeGL
()
{
{
std
::
cout
<<
"GL VERSION = "
<<
glGetString
(
GL_VERSION
)
<<
std
::
endl
;
glEnable
(
GL_DEPTH_TEST
);
glEnable
(
GL_DEPTH_TEST
);
if
(
m_cbs
)
if
(
m_cbs
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment