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
bde7578e
Commit
bde7578e
authored
Dec 12, 2012
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaned bind/unbind on shaders
parent
5845cb12
Changes
41
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
613 additions
and
169 deletions
+613
-169
SCHNApps/Plugins/CMakeLists.txt
SCHNApps/Plugins/CMakeLists.txt
+1
-0
SCHNApps/Plugins/import/import.cpp
SCHNApps/Plugins/import/import.cpp
+1
-5
SCHNApps/Plugins/render/render.cpp
SCHNApps/Plugins/render/render.cpp
+5
-12
SCHNApps/Plugins/renderVector/CMakeLists.txt
SCHNApps/Plugins/renderVector/CMakeLists.txt
+75
-0
SCHNApps/Plugins/renderVector/renderVector.cpp
SCHNApps/Plugins/renderVector/renderVector.cpp
+82
-0
SCHNApps/Plugins/renderVector/renderVector.h
SCHNApps/Plugins/renderVector/renderVector.h
+74
-0
SCHNApps/Plugins/renderVector/renderVector.ui
SCHNApps/Plugins/renderVector/renderVector.ui
+51
-0
SCHNApps/include/mapHandler.h
SCHNApps/include/mapHandler.h
+12
-6
SCHNApps/include/plugin.h
SCHNApps/include/plugin.h
+13
-9
SCHNApps/include/system.h
SCHNApps/include/system.h
+0
-4
SCHNApps/src/camera.cpp
SCHNApps/src/camera.cpp
+3
-4
SCHNApps/src/dialogs/mapsViewDialog.cpp
SCHNApps/src/dialogs/mapsViewDialog.cpp
+1
-0
SCHNApps/src/mapHandler.cpp
SCHNApps/src/mapHandler.cpp
+3
-4
SCHNApps/src/plugin.cpp
SCHNApps/src/plugin.cpp
+27
-1
SCHNApps/src/view.cpp
SCHNApps/src/view.cpp
+1
-0
SCHNApps/src/window.cpp
SCHNApps/src/window.cpp
+2
-0
include/Utils/GLSLShader.h
include/Utils/GLSLShader.h
+1
-1
include/Utils/Shaders/shaderColorPerVertex.h
include/Utils/Shaders/shaderColorPerVertex.h
+1
-1
include/Utils/Shaders/shaderEnvMap.h
include/Utils/Shaders/shaderEnvMap.h
+0
-1
include/Utils/Shaders/shaderExplodeVolumes.h
include/Utils/Shaders/shaderExplodeVolumes.h
+2
-2
include/Utils/Shaders/shaderExplodeVolumesLines.h
include/Utils/Shaders/shaderExplodeVolumesLines.h
+1
-1
include/Utils/Shaders/shaderFlat.h
include/Utils/Shaders/shaderFlat.h
+1
-1
include/Utils/Shaders/shaderFlatColor.h
include/Utils/Shaders/shaderFlatColor.h
+2
-2
include/Utils/Shaders/shaderIsoLines.h
include/Utils/Shaders/shaderIsoLines.h
+2
-2
include/Utils/Shaders/shaderScalarField.h
include/Utils/Shaders/shaderScalarField.h
+2
-2
include/Utils/Shaders/shaderSimpleTexture.h
include/Utils/Shaders/shaderSimpleTexture.h
+0
-1
include/Utils/Shaders/shaderTextureMask.h
include/Utils/Shaders/shaderTextureMask.h
+0
-1
src/Utils/GLSLShader.cpp
src/Utils/GLSLShader.cpp
+9
-8
src/Utils/Shaders/shaderColorPerVertex.cpp
src/Utils/Shaders/shaderColorPerVertex.cpp
+12
-4
src/Utils/Shaders/shaderEnvMap.cpp
src/Utils/Shaders/shaderEnvMap.cpp
+36
-20
src/Utils/Shaders/shaderExplodeVolumes.cpp
src/Utils/Shaders/shaderExplodeVolumes.cpp
+23
-10
src/Utils/Shaders/shaderExplodeVolumesLines.cpp
src/Utils/Shaders/shaderExplodeVolumesLines.cpp
+15
-3
src/Utils/Shaders/shaderFlat.cpp
src/Utils/Shaders/shaderFlat.cpp
+19
-7
src/Utils/Shaders/shaderFlatColor.cpp
src/Utils/Shaders/shaderFlatColor.cpp
+18
-9
src/Utils/Shaders/shaderIsoLines.cpp
src/Utils/Shaders/shaderIsoLines.cpp
+25
-12
src/Utils/Shaders/shaderPhong.cpp
src/Utils/Shaders/shaderPhong.cpp
+34
-17
src/Utils/Shaders/shaderScalarField.cpp
src/Utils/Shaders/shaderScalarField.cpp
+8
-2
src/Utils/Shaders/shaderSimpleColor.cpp
src/Utils/Shaders/shaderSimpleColor.cpp
+5
-1
src/Utils/Shaders/shaderSimpleTexture.cpp
src/Utils/Shaders/shaderSimpleTexture.cpp
+16
-7
src/Utils/Shaders/shaderTextureMask.cpp
src/Utils/Shaders/shaderTextureMask.cpp
+14
-5
src/Utils/Shaders/shaderVectorPerVertex.cpp
src/Utils/Shaders/shaderVectorPerVertex.cpp
+16
-4
No files found.
SCHNApps/Plugins/CMakeLists.txt
View file @
bde7578e
...
@@ -2,3 +2,4 @@ cmake_minimum_required(VERSION 2.8)
...
@@ -2,3 +2,4 @@ cmake_minimum_required(VERSION 2.8)
ADD_SUBDIRECTORY
(
import
)
ADD_SUBDIRECTORY
(
import
)
ADD_SUBDIRECTORY
(
render
)
ADD_SUBDIRECTORY
(
render
)
ADD_SUBDIRECTORY
(
renderVector
)
SCHNApps/Plugins/import/import.cpp
View file @
bde7578e
...
@@ -51,11 +51,7 @@ void ImportPlugin::cb_import()
...
@@ -51,11 +51,7 @@ void ImportPlugin::cb_import()
normalVBO
->
updateData
(
normal
);
normalVBO
->
updateData
(
normal
);
// compute map bounding box
// compute map bounding box
CGoGN
::
Geom
::
BoundingBox
<
VEC3
>
bb
=
CGoGN
::
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
*
m
,
position
);
h
->
updateBB
(
position
);
qglviewer
::
Vec
min
(
bb
.
min
()[
0
],
bb
.
min
()[
1
],
bb
.
min
()[
2
]);
qglviewer
::
Vec
max
(
bb
.
max
()[
0
],
bb
.
max
()[
1
],
bb
.
max
()[
2
]);
h
->
setBBmin
(
min
);
h
->
setBBmax
(
max
);
// compute primitive connectivity VBOs
// compute primitive connectivity VBOs
h
->
updatePrimitives
(
CGoGN
::
Algo
::
Render
::
GL2
::
POINTS
,
CGoGN
::
allDarts
);
h
->
updatePrimitives
(
CGoGN
::
Algo
::
Render
::
GL2
::
POINTS
,
CGoGN
::
allDarts
);
...
...
SCHNApps/Plugins/render/render.cpp
View file @
bde7578e
...
@@ -26,6 +26,11 @@ bool RenderPlugin::enable()
...
@@ -26,6 +26,11 @@ bool RenderPlugin::enable()
m_pointSprite
=
new
CGoGN
::
Utils
::
PointSprite
();
m_pointSprite
=
new
CGoGN
::
Utils
::
PointSprite
();
registerShader
(
m_flatShader
);
registerShader
(
m_phongShader
);
registerShader
(
m_simpleColorShader
);
registerShader
(
m_pointSprite
);
connect
(
m_dockTab
->
check_renderVertices
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
cb_renderVerticesChanged
(
bool
)));
connect
(
m_dockTab
->
check_renderVertices
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
cb_renderVerticesChanged
(
bool
)));
connect
(
m_dockTab
->
slider_verticesScaleFactor
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
cb_verticesScaleFactorChanged
(
int
)));
connect
(
m_dockTab
->
slider_verticesScaleFactor
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
cb_verticesScaleFactorChanged
(
int
)));
connect
(
m_dockTab
->
check_renderEdges
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
cb_renderEdgesChanged
(
bool
)));
connect
(
m_dockTab
->
check_renderEdges
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
cb_renderEdgesChanged
(
bool
)));
...
@@ -91,24 +96,12 @@ void RenderPlugin::redraw(View* view)
...
@@ -91,24 +96,12 @@ void RenderPlugin::redraw(View* view)
void
RenderPlugin
::
viewLinked
(
View
*
view
)
void
RenderPlugin
::
viewLinked
(
View
*
view
)
{
{
assert
(
!
h_viewParams
.
contains
(
view
));
h_viewParams
.
insert
(
view
,
new
TabParams
(
1.0
,
false
,
false
,
true
,
FLAT
));
h_viewParams
.
insert
(
view
,
new
TabParams
(
1.0
,
false
,
false
,
true
,
FLAT
));
CGoGN
::
Utils
::
GLSLShader
::
registerShader
(
view
,
m_flatShader
);
CGoGN
::
Utils
::
GLSLShader
::
registerShader
(
view
,
m_phongShader
);
CGoGN
::
Utils
::
GLSLShader
::
registerShader
(
view
,
m_simpleColorShader
);
CGoGN
::
Utils
::
GLSLShader
::
registerShader
(
view
,
m_pointSprite
);
}
}
void
RenderPlugin
::
viewUnlinked
(
View
*
view
)
void
RenderPlugin
::
viewUnlinked
(
View
*
view
)
{
{
assert
(
h_viewParams
.
contains
(
view
));
h_viewParams
.
remove
(
view
);
h_viewParams
.
remove
(
view
);
CGoGN
::
Utils
::
GLSLShader
::
unregisterShader
(
view
,
m_flatShader
);
CGoGN
::
Utils
::
GLSLShader
::
registerShader
(
view
,
m_phongShader
);
CGoGN
::
Utils
::
GLSLShader
::
unregisterShader
(
view
,
m_simpleColorShader
);
CGoGN
::
Utils
::
GLSLShader
::
unregisterShader
(
view
,
m_pointSprite
);
}
}
void
RenderPlugin
::
currentViewChanged
(
View
*
view
)
void
RenderPlugin
::
currentViewChanged
(
View
*
view
)
...
...
SCHNApps/Plugins/renderVector/CMakeLists.txt
0 → 100644
View file @
bde7578e
cmake_minimum_required
(
VERSION 2.8
)
INCLUDE_DIRECTORIES
(
${
SCHNApps_ROOT_DIR
}
/include
${
SCHNApps_ROOT_DIR
}
/Plugins/renderVector
${
CMAKE_CURRENT_BINARY_DIR
}
)
SET
(
PLUGIN_SRC
${
SCHNApps_ROOT_DIR
}
/Plugins/renderVector/renderVector.cpp
)
SET
(
PLUGIN_H
${
SCHNApps_ROOT_DIR
}
/Plugins/renderVector/renderVector.h
)
SET
(
PLUGIN_FORM
${
SCHNApps_ROOT_DIR
}
/Plugins/renderVector/renderVector.ui
)
IF
(
${
CMAKE_BUILD_TYPE
}
STREQUAL Debug
)
ADD_DEFINITIONS
(
-DDEBUG
)
IF
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Release
)
ELSE
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Debug
${
CGoGN_ROOT_DIR
}
/lib/Release
)
ENDIF
(
WIN32
)
QT4_WRAP_UI
(
PLUGIN_UI
${
PLUGIN_FORM
}
)
QT4_WRAP_CPP
(
PLUGIN_MOC
${
PLUGIN_H
}
)
ADD_LIBRARY
(
RenderVectorPluginD SHARED
${
PLUGIN_SRC
}
${
PLUGIN_UI
}
${
PLUGIN_MOC
}
)
TARGET_LINK_LIBRARIES
(
RenderVectorPluginD
${
CGoGN_LIBS_D
}
${
COMMON_LIBS
}
${
QGLVIEWER_LIBRARIES
}
)
ADD_DEPENDENCIES
(
RenderVectorPluginD SCHNAppsD
)
SET_TARGET_PROPERTIES
(
RenderVectorPluginD PROPERTIES COMPILE_DEFINITIONS
"DEBUG"
)
ELSE
(
${
CMAKE_BUILD_TYPE
}
STREQUAL Debug
)
IF
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Release
)
ELSE
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Release
)
ENDIF
(
WIN32
)
QT4_WRAP_UI
(
PLUGIN_UI
${
PLUGIN_FORM
}
)
QT4_WRAP_CPP
(
PLUGIN_MOC
${
PLUGIN_H
}
)
ADD_LIBRARY
(
RenderVectorPlugin SHARED
${
PLUGIN_SRC
}
${
PLUGIN_UI
}
${
PLUGIN_MOC
}
)
TARGET_LINK_LIBRARIES
(
RenderVectorPlugin
${
CGoGN_LIBS_R
}
${
COMMON_LIBS
}
${
QGLVIEWER_LIBRARIES
}
)
ADD_DEPENDENCIES
(
RenderVectorPlugin SCHNApps
)
ENDIF
(
${
CMAKE_BUILD_TYPE
}
STREQUAL Debug
)
SCHNApps/Plugins/renderVector/renderVector.cpp
0 → 100644
View file @
bde7578e
#include "renderVector.h"
#include "mapHandler.h"
#include "Algo/Import/import.h"
bool
RenderVectorPlugin
::
enable
()
{
m_dockTab
=
new
RenderVectorDockTab
();
addTabInDock
(
m_dockTab
,
"RenderVector"
);
m_vectorShader
=
new
Utils
::
ShaderVectorPerVertex
()
;
m_vectorShader
->
setColor
(
Geom
::
Vec4f
(
1.0
f
,
0.0
f
,
0.0
f
,
1.0
f
))
;
registerShader
(
m_vectorShader
);
connect
(
m_dockTab
->
slider_vectorsScaleFactor
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
cb_vectorsScaleFactorChanged
(
int
)));
return
true
;
}
void
RenderVectorPlugin
::
disable
()
{
delete
m_vectorShader
;
}
void
RenderVectorPlugin
::
redraw
(
View
*
view
)
{
TabParams
*
params
=
h_viewParams
[
view
];
const
QList
<
MapHandlerGen
*>&
maps
=
view
->
getLinkedMaps
();
foreach
(
MapHandlerGen
*
m
,
maps
)
{
CGoGN
::
Utils
::
VBO
*
positionVBO
=
m
->
getVBO
(
"position"
);
CGoGN
::
Utils
::
VBO
*
normalVBO
=
m
->
getVBO
(
"normal"
);
m_vectorShader
->
setScale
(
m
->
getBBdiagSize
()
/
100.0
f
*
params
->
vectorsScaleFactor
)
;
m_vectorShader
->
setAttributePosition
(
positionVBO
)
;
m_vectorShader
->
setAttributeVector
(
normalVBO
)
;
glLineWidth
(
1.0
f
)
;
m
->
draw
(
m_vectorShader
,
Algo
::
Render
::
GL2
::
POINTS
)
;
}
}
void
RenderVectorPlugin
::
viewLinked
(
View
*
view
)
{
h_viewParams
.
insert
(
view
,
new
TabParams
(
1.0
));
}
void
RenderVectorPlugin
::
viewUnlinked
(
View
*
view
)
{
h_viewParams
.
remove
(
view
);
}
void
RenderVectorPlugin
::
currentViewChanged
(
View
*
view
)
{
TabParams
*
params
=
h_viewParams
[
view
];
m_dockTab
->
slider_vectorsScaleFactor
->
setSliderPosition
(
params
->
vectorsScaleFactor
*
50.0
);
}
void
RenderVectorPlugin
::
cb_vectorsScaleFactorChanged
(
int
i
)
{
View
*
current
=
m_window
->
getCurrentView
();
assert
(
isLinkedToView
(
current
));
TabParams
*
params
=
h_viewParams
[
current
];
params
->
vectorsScaleFactor
=
i
/
50.0
;
current
->
updateGL
();
}
/**
* If we want to compile this plugin in debug mode,
* we also define a DEBUG macro at the compilation
*/
#ifndef DEBUG
// essential Qt function:
// arguments are
// - the compiled name of the plugin
// - the main class of our plugin
Q_EXPORT_PLUGIN2
(
RenderVectorPlugin
,
RenderVectorPlugin
)
#else
Q_EXPORT_PLUGIN2
(
RenderVectorPluginD
,
RenderVectorPlugin
)
#endif
SCHNApps/Plugins/renderVector/renderVector.h
0 → 100644
View file @
bde7578e
#ifndef _RENDERVECTOR_PLUGIN_H_
#define _RENDERVECTOR_PLUGIN_H_
#include "plugin.h"
#include "ui_renderVector.h"
#include "Topology/generic/functor.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
#include "Utils/Shaders/shaderVectorPerVertex.h"
using
namespace
CGoGN
;
using
namespace
SCHNApps
;
class
RenderVectorDockTab
:
public
QWidget
,
public
Ui
::
RenderVectorWidget
{
public:
RenderVectorDockTab
()
{
setupUi
(
this
);
}
};
struct
TabParams
{
TabParams
(
float
vsf
)
:
vectorsScaleFactor
(
vsf
)
{}
float
vectorsScaleFactor
;
};
class
RenderVectorPlugin
:
public
Plugin
{
Q_OBJECT
Q_INTERFACES
(
CGoGN
::
SCHNApps
::
Plugin
)
public:
RenderVectorPlugin
()
{
setProvidesRendering
(
true
);
}
~
RenderVectorPlugin
()
{}
virtual
bool
enable
();
virtual
void
disable
();
virtual
void
redraw
(
View
*
view
);
virtual
void
keyPress
(
View
*
view
,
int
key
)
{}
virtual
void
keyRelease
(
View
*
view
,
int
key
)
{}
virtual
void
mousePress
(
View
*
view
,
int
button
,
int
x
,
int
y
)
{}
virtual
void
mouseRelease
(
View
*
view
,
int
button
,
int
x
,
int
y
)
{}
virtual
void
mouseMove
(
View
*
view
,
int
buttons
,
int
x
,
int
y
)
{}
virtual
void
wheelEvent
(
View
*
view
,
int
delta
,
int
x
,
int
y
)
{}
virtual
void
viewLinked
(
View
*
view
);
virtual
void
viewUnlinked
(
View
*
view
);
virtual
void
currentViewChanged
(
View
*
view
);
protected:
RenderVectorDockTab
*
m_dockTab
;
QHash
<
View
*
,
TabParams
*>
h_viewParams
;
CGoGN
::
Utils
::
ShaderVectorPerVertex
*
m_vectorShader
;
public
slots
:
void
cb_vectorsScaleFactorChanged
(
int
i
);
};
#endif
SCHNApps/Plugins/renderVector/renderVector.ui
0 → 100644
View file @
bde7578e
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
RenderVectorWidget
</class>
<widget
class=
"QWidget"
name=
"RenderVectorWidget"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
174
</width>
<height>
397
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
Vectors Size :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QSlider"
name=
"slider_vectorsScaleFactor"
>
<property
name=
"value"
>
<number>
50
</number>
</property>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
</widget>
</item>
<item>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
156
</width>
<height>
161
</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
SCHNApps/include/mapHandler.h
View file @
bde7578e
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
#include "Topology/generic/functor.h"
#include "Topology/generic/functor.h"
#include "Utils/vbo.h"
#include "Utils/vbo.h"
#include "Algo/Render/GL2/mapRender.h"
#include "Algo/Render/GL2/mapRender.h"
#include "Algo/Geometry/boundingbox.h"
namespace
CGoGN
namespace
CGoGN
{
{
...
@@ -32,16 +33,12 @@ public:
...
@@ -32,16 +33,12 @@ public:
GenericMap
*
getGenericMap
()
{
return
m_map
;
}
GenericMap
*
getGenericMap
()
{
return
m_map
;
}
const
qglviewer
::
Vec
&
getBBmin
()
const
{
return
m_bbMin
;
}
const
qglviewer
::
Vec
&
getBBmin
()
const
{
return
m_bbMin
;
}
void
setBBmin
(
qglviewer
::
Vec
&
v
)
{
m_bbMin
=
v
;
}
const
qglviewer
::
Vec
&
getBBmax
()
const
{
return
m_bbMax
;
}
const
qglviewer
::
Vec
&
getBBmax
()
const
{
return
m_bbMax
;
}
void
setBBmax
(
qglviewer
::
Vec
&
v
)
{
m_bbMax
=
v
;
}
float
getBBdiagSize
()
{
return
m_bbDiagSize
;
}
float
getBBdiagSize
()
{
return
(
m_bbMax
-
m_bbMin
).
norm
();
}
bool
isUsed
()
const
{
return
!
l_views
.
empty
();
}
bool
isUsed
()
const
{
return
!
l_views
.
empty
();
}
void
draw
(
Utils
::
GLSLShader
*
shader
,
int
primitive
)
;
void
draw
(
Utils
::
GLSLShader
*
shader
,
int
primitive
)
{
m_render
->
draw
(
shader
,
primitive
);
}
/*********************************************************
/*********************************************************
* MANAGE VBOs
* MANAGE VBOs
...
@@ -68,6 +65,7 @@ protected:
...
@@ -68,6 +65,7 @@ protected:
qglviewer
::
Vec
m_bbMin
;
qglviewer
::
Vec
m_bbMin
;
qglviewer
::
Vec
m_bbMax
;
qglviewer
::
Vec
m_bbMax
;
float
m_bbDiagSize
;
QList
<
View
*>
l_views
;
QList
<
View
*>
l_views
;
...
@@ -90,6 +88,14 @@ public:
...
@@ -90,6 +88,14 @@ public:
typename
PFP
::
MAP
*
getMap
()
{
return
reinterpret_cast
<
typename
PFP
::
MAP
*>
(
m_map
);
}
typename
PFP
::
MAP
*
getMap
()
{
return
reinterpret_cast
<
typename
PFP
::
MAP
*>
(
m_map
);
}
void
updateBB
(
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
)
{
CGoGN
::
Geom
::
BoundingBox
<
typename
PFP
::
VEC3
>
bb
=
CGoGN
::
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
*
(
reinterpret_cast
<
typename
PFP
::
MAP
*>
(
m_map
)),
position
);
m_bbMin
=
qglviewer
::
Vec
(
bb
.
min
()[
0
],
bb
.
min
()[
1
],
bb
.
min
()[
2
]);
m_bbMax
=
qglviewer
::
Vec
(
bb
.
max
()[
0
],
bb
.
max
()[
1
],
bb
.
max
()[
2
]);
m_bbDiagSize
=
(
m_bbMax
-
m_bbMin
).
norm
();
}
void
updatePrimitives
(
int
primitive
,
const
FunctorSelect
&
good
)
void
updatePrimitives
(
int
primitive
,
const
FunctorSelect
&
good
)
{
{
m_render
->
initPrimitives
<
PFP
>
(
*
(
reinterpret_cast
<
typename
PFP
::
MAP
*>
(
m_map
)),
good
,
primitive
)
;
m_render
->
initPrimitives
<
PFP
>
(
*
(
reinterpret_cast
<
typename
PFP
::
MAP
*>
(
m_map
)),
good
,
primitive
)
;
...
...
SCHNApps/include/plugin.h
View file @
bde7578e
...
@@ -2,16 +2,9 @@
...
@@ -2,16 +2,9 @@
#define _PLUGIN_H_
#define _PLUGIN_H_
#include <QtPlugin>
#include <QtPlugin>
#include <QAction>
#include <iostream>
#include "types.h"
#include <list>
#include "window.h"
#include "system.h"
#include "view.h"
#include "camera.h"
#include "mapHandler.h"
#include "vboHandler.h"
namespace
CGoGN
namespace
CGoGN
{
{
...
@@ -19,6 +12,8 @@ namespace CGoGN
...
@@ -19,6 +12,8 @@ namespace CGoGN
namespace
SCHNApps
namespace
SCHNApps
{
{
class
Window
;
class
Plugin
:
public
QObject
class
Plugin
:
public
QObject
{
{
public:
public:
...
@@ -64,6 +59,13 @@ public:
...
@@ -64,6 +59,13 @@ public:
const
QList
<
View
*>&
getLinkedViews
()
const
{
return
l_views
;
}
const
QList
<
View
*>&
getLinkedViews
()
const
{
return
l_views
;
}
bool
isLinkedToView
(
View
*
view
)
const
{
return
l_views
.
contains
(
view
);
}
bool
isLinkedToView
(
View
*
view
)
const
{
return
l_views
.
contains
(
view
);
}
/*********************************************************
* MANAGE SHADERS
*********************************************************/
void
registerShader
(
Utils
::
GLSLShader
*
shader
);
void
unregisterShader
(
Utils
::
GLSLShader
*
shader
);
/*********************************************************
/*********************************************************
* MANAGE DOCK TABS
* MANAGE DOCK TABS
*********************************************************/
*********************************************************/
...
@@ -98,6 +100,8 @@ protected:
...
@@ -98,6 +100,8 @@ protected:
QList
<
QAction
*>
l_menuActions
;
QList
<
QAction
*>
l_menuActions
;
QList
<
QAction
*>
l_toolbarActions
;
QList
<
QAction
*>
l_toolbarActions
;
QList
<
Utils
::
GLSLShader
*>
l_shaders
;
// QList<Plugin*> l_dependencies;
// QList<Plugin*> l_dependencies;
// QList<Plugin*> l_dependantPlugins;
// QList<Plugin*> l_dependantPlugins;
...
...
SCHNApps/include/system.h
View file @
bde7578e
...
@@ -4,10 +4,6 @@
...
@@ -4,10 +4,6 @@
#include <QWidget>
#include <QWidget>
#include <QSplashScreen>
#include <QSplashScreen>
#include <unistd.h>
#include <stdarg.h>
#include <iostream>
#include "types.h"
#include "types.h"
//#include "ui_questionSessionDialog.h"
//#include "ui_questionSessionDialog.h"
...
...
SCHNApps/src/camera.cpp
View file @
bde7578e
...
@@ -11,16 +11,15 @@ unsigned int Camera::cameraCount = 0;
...
@@ -11,16 +11,15 @@ unsigned int Camera::cameraCount = 0;
Camera
::
Camera
(
const
QString
&
name
,
Window
*
window
)
:
Camera
::
Camera
(
const
QString
&
name
,
Window
*
window
)
:
m_name
(
name
),
m_name
(
name
),
m_window
(
window
),
m_window
(
window
),
m_draw
(
fals
e
),
m_draw
(
tru
e
),
m_drawFarPlane
(
fals
e
),
m_drawFarPlane
(
tru
e
),
m_drawScale
(
1.0
),
m_drawScale
(
0.1
),
m_drawPath
(
false
),
m_drawPath
(
false
),
m_drawPathAxis
(
false
),
m_drawPathAxis
(
false
),
m_drawPathScale
(
1.0
),
m_drawPathScale
(
1.0
),
m_snapCount
(
0
)
m_snapCount
(
0
)
{
{
++
cameraCount
;
++
cameraCount
;
// setZClippingCoefficient(100);
}
}
Camera
::~
Camera
()
Camera
::~
Camera
()
...
...
SCHNApps/src/dialogs/mapsViewDialog.cpp
View file @
bde7578e
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
#include "window.h"
#include "window.h"
#include "view.h"
#include "view.h"
#include "plugin.h"
#include "plugin.h"
#include "mapHandler.h"
#include <QMessageBox>
#include <QMessageBox>
#include <QMouseEvent>
#include <QMouseEvent>
...
...
SCHNApps/src/mapHandler.cpp
View file @
bde7578e
...
@@ -22,10 +22,9 @@ MapHandlerGen::~MapHandlerGen()
...
@@ -22,10 +22,9 @@ MapHandlerGen::~MapHandlerGen()
delete
vbo
;
delete
vbo
;
}
}
void
MapHandlerGen
::
draw
(
Utils
::
GLSLShader
*
shader
,
int
primitive
)
/*********************************************************
{
* MANAGE VBOs
m_render
->
draw
(
shader
,
primitive
);
*********************************************************/
}
Utils
::
VBO
*
MapHandlerGen
::
getVBO
(
const
std
::
string
&
name
)
Utils
::
VBO
*
MapHandlerGen
::
getVBO
(
const
std
::
string
&
name
)
{
{
...
...
SCHNApps/src/plugin.cpp
View file @
bde7578e
#include "plugin.h"
#include "plugin.h"
#include <GL/glew.h>
#include "window.h"
#include "Utils/GLSLShader.h"
namespace
CGoGN
namespace
CGoGN
{
{
...
@@ -32,7 +37,7 @@ Plugin::~Plugin()
...
@@ -32,7 +37,7 @@ Plugin::~Plugin()
}
}
/*********************************************************
/*********************************************************
* MANAGE VIEWS
* MANAGE
LINKED
VIEWS
*********************************************************/
*********************************************************/
bool
Plugin
::
linkView
(
View
*
view
)
bool
Plugin
::
linkView
(
View
*
view
)
...
@@ -40,6 +45,8 @@ bool Plugin::linkView(View* view)
...
@@ -40,6 +45,8 @@ bool Plugin::linkView(View* view)
if
(
view
&&
!
l_views
.
contains
(
view
))
if
(
view
&&
!
l_views
.
contains
(
view
))
{
{
l_views
.
push_back
(
view
);
l_views
.
push_back
(
view
);
foreach
(
Utils
::
GLSLShader
*
shader
,
l_shaders
)
Utils
::
GLSLShader
::
registerShader
(
view
,
shader
);
viewLinked
(
view
);
viewLinked
(
view
);
return
true
;
return
true
;
}
}
...
@@ -50,7 +57,26 @@ bool Plugin::linkView(View* view)
...
@@ -50,7 +57,26 @@ bool Plugin::linkView(View* view)
void