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
ac48435a
Commit
ac48435a
authored
Sep 18, 2014
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolve crash of SCHNApps at exit()
parent
c1c330dd
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
32 additions
and
38 deletions
+32
-38
SCHNApps/CMakeLists.txt
SCHNApps/CMakeLists.txt
+1
-0
SCHNApps/Plugins/surface_import/include/surface_import.h
SCHNApps/Plugins/surface_import/include/surface_import.h
+1
-2
SCHNApps/include/plugin.h
SCHNApps/include/plugin.h
+8
-16
SCHNApps/src/main.cpp
SCHNApps/src/main.cpp
+5
-5
SCHNApps/src/view.cpp
SCHNApps/src/view.cpp
+2
-4
include/Utils/GLSLShader.h
include/Utils/GLSLShader.h
+1
-1
src/Utils/GLSLShader.cpp
src/Utils/GLSLShader.cpp
+10
-6
src/Utils/Qt/qtQGLV.cpp
src/Utils/Qt/qtQGLV.cpp
+2
-2
src/Utils/Qt/qtSimple.cpp
src/Utils/Qt/qtSimple.cpp
+2
-2
No files found.
SCHNApps/CMakeLists.txt
View file @
ac48435a
...
...
@@ -33,6 +33,7 @@ SET( QT_USE_QTXML TRUE )
SET
(
QT_USE_QTDESIGNER TRUE
)
SET
(
QT_USE_QTGUI TRUE
)
SET
(
QT_USE_QTPLUGIN TRUE
)
SET
(
QT_USE_QTSVG TRUE
)
INCLUDE
(
${
QT_USE_FILE
}
)
ADD_DEFINITIONS
(
${
QT_DEFINITIONS
}
)
...
...
SCHNApps/Plugins/surface_import/include/surface_import.h
View file @
ac48435a
...
...
@@ -16,8 +16,7 @@ class Surface_Import_Plugin : public PluginProcessing
public:
Surface_Import_Plugin
()
{
}
{}
~
Surface_Import_Plugin
()
{}
...
...
SCHNApps/include/plugin.h
View file @
ac48435a
...
...
@@ -4,8 +4,6 @@
#include <QtPlugin>
#include <QAction>
#include <GL/glew.h>
#include "types.h"
namespace
CGoGN
...
...
@@ -21,24 +19,18 @@ class Plugin : public QObject
friend
class
SCHNApps
;
public:
Plugin
()
:
m_schnapps
(
NULL
)
{
glewInit
();
}
virtual
~
Plugin
()
{}
const
QString
&
getName
()
const
{
return
m_name
;
}
Plugin
();
virtual
~
Plugin
();
public
slots
:
QString
getName
()
{
return
m_name
;
}
const
QString
&
getFilePath
()
{
return
m_filePath
;
}
SCHNApps
*
getSCHNApps
()
{
return
m_schnapps
;
}
QString
getName
()
;
QString
getFilePath
();
SCHNApps
*
getSCHNApps
()
;
private:
void
setName
(
const
QString
&
name
)
{
m_name
=
name
;
}
void
setFilePath
(
const
QString
&
f
)
{
m_filePath
=
f
;
}
void
setSCHNApps
(
SCHNApps
*
s
)
{
m_schnapps
=
s
;
}
void
setName
(
const
QString
&
name
)
;
void
setFilePath
(
const
QString
&
f
)
;
void
setSCHNApps
(
SCHNApps
*
s
)
;
virtual
bool
enable
()
=
0
;
virtual
void
disable
()
=
0
;
...
...
SCHNApps/src/main.cpp
View file @
ac48435a
...
...
@@ -29,11 +29,11 @@ int main(int argc, char* argv[])
// CGoGN::SCHNApps::SCHNApps schnapps(app.applicationDirPath(), pythonContext, pythonConsole);
PythonQtScriptingConsole
*
pythonConsole
=
new
PythonQtScriptingConsole
(
NULL
,
pythonContext
);
CGoGN
::
SCHNApps
::
SCHNApps
schna
pps
(
app
.
applicationDirPath
(),
pythonContext
,
*
pythonConsole
);
CGoGN
::
SCHNApps
::
SCHNApps
*
schnapps
=
new
CGoGN
::
SCHNApps
::
SCHNA
pps
(
app
.
applicationDirPath
(),
pythonContext
,
*
pythonConsole
);
schnapps
.
show
();
schnapps
->
show
();
pythonContext
.
addObject
(
"schnapps"
,
&
schnapps
);
pythonContext
.
addObject
(
"schnapps"
,
schnapps
);
if
(
argc
>
1
)
{
...
...
@@ -43,8 +43,8 @@ int main(int argc, char* argv[])
pythonContext
.
evalFile
(
fi
.
filePath
());
}
splash
->
finish
(
&
schnapps
);
splash
->
finish
(
schnapps
);
delete
splash
;
return
app
.
exec
();
return
app
.
exec
();
;
}
SCHNApps/src/view.cpp
View file @
ac48435a
...
...
@@ -108,8 +108,7 @@ void View::unlinkPlugin(PluginInteraction* plugin)
{
plugin
->
unlinkView
(
this
);
emit
(
pluginUnlinked
(
plugin
));
// removed because of crash when application close
// updateGL();
updateGL
();
}
}
...
...
@@ -160,8 +159,7 @@ void View::unlinkMap(MapHandlerGen* map)
emit
(
mapUnlinked
(
map
));
updateCurrentCameraBB
();
// removed because of crash when application close
// updateGL();
updateGL
();
disconnect
(
map
->
getFrame
(),
SIGNAL
(
modified
()),
this
,
SLOT
(
updateGL
()));
disconnect
(
map
,
SIGNAL
(
selectedCellsChanged
(
CellSelectorGen
*
)),
this
,
SLOT
(
updateGL
()));
...
...
include/Utils/GLSLShader.h
View file @
ac48435a
...
...
@@ -66,7 +66,7 @@ public:
static
unsigned
int
CURRENT_OGL_VERSION
;
static
std
::
set
<
std
::
pair
<
void
*
,
GLSLShader
*>
>
m_registeredShaders
;
static
std
::
set
<
std
::
pair
<
void
*
,
GLSLShader
*>
>
*
m_registeredShaders
;
// static glm::mat4* s_current_matrices;
static
Utils
::
GL_Matrices
*
s_current_matrices
;
...
...
src/Utils/GLSLShader.cpp
View file @
ac48435a
...
...
@@ -66,7 +66,8 @@ std::string* GLSLShader::DEFINES_GL = NULL;
std
::
vector
<
std
::
string
>
GLSLShader
::
m_pathes
;
std
::
set
<
std
::
pair
<
void
*
,
GLSLShader
*>
>
GLSLShader
::
m_registeredShaders
;
//std::set< std::pair<void*, GLSLShader*> > GLSLShader::m_registeredShaders;
std
::
set
<
std
::
pair
<
void
*
,
GLSLShader
*>
>*
GLSLShader
::
m_registeredShaders
=
NULL
;
//glm::mat4* GLSLShader::s_current_matrices=NULL;
...
...
@@ -90,16 +91,19 @@ GLSLShader::GLSLShader() :
DEFINES_GL
=
&
DEFINES_GL2
;
m_nbMaxVertices
=
16
;
if
(
m_registeredShaders
==
NULL
)
m_registeredShaders
=
new
std
::
set
<
std
::
pair
<
void
*
,
GLSLShader
*>
>
;
}
void
GLSLShader
::
registerShader
(
void
*
ptr
,
GLSLShader
*
shader
)
{
m_registeredShaders
.
insert
(
std
::
pair
<
void
*
,
GLSLShader
*>
(
ptr
,
shader
));
m_registeredShaders
->
insert
(
std
::
pair
<
void
*
,
GLSLShader
*>
(
ptr
,
shader
));
}
void
GLSLShader
::
unregisterShader
(
void
*
ptr
,
GLSLShader
*
shader
)
{
m_registeredShaders
.
erase
(
std
::
pair
<
void
*
,
GLSLShader
*>
(
ptr
,
shader
));
m_registeredShaders
->
erase
(
std
::
pair
<
void
*
,
GLSLShader
*>
(
ptr
,
shader
));
}
std
::
string
GLSLShader
::
defines_Geom
(
const
std
::
string
&
primitivesIn
,
const
std
::
string
&
primitivesOut
,
int
maxVert
)
...
...
@@ -657,7 +661,7 @@ GLSLShader::~GLSLShader()
if
(
m_geom_shader_source
!=
NULL
)
delete
[]
m_geom_shader_source
;
// m_registeredShaders
.
erase(this);
// m_registeredShaders
->
erase(this);
}
std
::
string
GLSLShader
::
findFile
(
const
std
::
string
filename
)
...
...
@@ -1138,7 +1142,7 @@ void GLSLShader::updateCurrentMatrices()
currentPMV
()
=
currentProjection
()
*
model
;
currentNormalMatrix
()
=
glm
::
gtx
::
inverse_transpose
::
inverseTranspose
(
model
);
for
(
std
::
set
<
std
::
pair
<
void
*
,
GLSLShader
*>
>::
iterator
it
=
m_registeredShaders
.
begin
();
it
!=
m_registeredShaders
.
end
();
++
it
)
for
(
std
::
set
<
std
::
pair
<
void
*
,
GLSLShader
*>
>::
iterator
it
=
m_registeredShaders
->
begin
();
it
!=
m_registeredShaders
->
end
();
++
it
)
it
->
second
->
updateMatrices
(
currentProjection
(),
model
,
currentPMV
(),
currentNormalMatrix
());
}
...
...
@@ -1165,7 +1169,7 @@ void GLSLShader::updateAllFromGLMatrices()
currentPMV
()
=
proj
*
model
;
currentNormalMatrix
()
=
glm
::
gtx
::
inverse_transpose
::
inverseTranspose
(
model
);
for
(
std
::
set
<
std
::
pair
<
void
*
,
GLSLShader
*>
>::
iterator
it
=
m_registeredShaders
.
begin
();
it
!=
m_registeredShaders
.
end
();
++
it
)
for
(
std
::
set
<
std
::
pair
<
void
*
,
GLSLShader
*>
>::
iterator
it
=
m_registeredShaders
->
begin
();
it
!=
m_registeredShaders
->
end
();
++
it
)
it
->
second
->
updateMatrices
(
proj
,
model
,
currentPMV
(),
currentNormalMatrix
());
}
...
...
src/Utils/Qt/qtQGLV.cpp
View file @
ac48435a
...
...
@@ -445,8 +445,8 @@ void SimpleQGLV::cb_updateMatrix()
}
else
{
for
(
std
::
set
<
std
::
pair
<
void
*
,
GLSLShader
*>
>::
iterator
it
=
GLSLShader
::
m_registeredShaders
.
begin
();
it
!=
GLSLShader
::
m_registeredShaders
.
end
();
for
(
std
::
set
<
std
::
pair
<
void
*
,
GLSLShader
*>
>::
iterator
it
=
GLSLShader
::
m_registeredShaders
->
begin
();
it
!=
GLSLShader
::
m_registeredShaders
->
end
();
++
it
)
{
if
((
it
->
first
==
NULL
)
||
(
it
->
first
==
this
))
...
...
src/Utils/Qt/qtSimple.cpp
View file @
ac48435a
...
...
@@ -439,8 +439,8 @@ void SimpleQT::cb_updateMatrix()
}
else
{
for
(
std
::
set
<
std
::
pair
<
void
*
,
GLSLShader
*>
>::
iterator
it
=
GLSLShader
::
m_registeredShaders
.
begin
();
it
!=
GLSLShader
::
m_registeredShaders
.
end
();
for
(
std
::
set
<
std
::
pair
<
void
*
,
GLSLShader
*>
>::
iterator
it
=
GLSLShader
::
m_registeredShaders
->
begin
();
it
!=
GLSLShader
::
m_registeredShaders
->
end
();
++
it
)
{
if
((
it
->
first
==
NULL
)
||
(
it
->
first
==
this
))
...
...
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