Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Thomas Pitiot
CGoGN
Commits
5d64b236
Commit
5d64b236
authored
Nov 29, 2012
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCHNApps: petit debug
parent
4081dfdc
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
65 additions
and
43 deletions
+65
-43
SCHNApps/Debug/CMakeLists.txt
SCHNApps/Debug/CMakeLists.txt
+3
-0
SCHNApps/Plugins/firstPlugin/include/firstPlugin.h
SCHNApps/Plugins/firstPlugin/include/firstPlugin.h
+13
-13
SCHNApps/Plugins/firstPlugin/src/firstPlugin.cpp
SCHNApps/Plugins/firstPlugin/src/firstPlugin.cpp
+4
-7
SCHNApps/Release/CMakeLists.txt
SCHNApps/Release/CMakeLists.txt
+3
-0
SCHNApps/include/window.h
SCHNApps/include/window.h
+1
-1
SCHNApps/src/view.cpp
SCHNApps/src/view.cpp
+38
-15
SCHNApps/src/viewButtonArea.cpp
SCHNApps/src/viewButtonArea.cpp
+0
-2
SCHNApps/src/window.cpp
SCHNApps/src/window.cpp
+3
-5
No files found.
SCHNApps/Debug/CMakeLists.txt
View file @
5d64b236
...
...
@@ -29,6 +29,7 @@ file(
${
SCHNApps_ROOT_DIR
}
/src/system.cpp
${
SCHNApps_ROOT_DIR
}
/src/view.cpp
${
SCHNApps_ROOT_DIR
}
/src/window.cpp
${
SCHNApps_ROOT_DIR
}
/src/viewButtonArea.cpp
${
SCHNApps_ROOT_DIR
}
/src/viewSelector.cpp
${
SCHNApps_ROOT_DIR
}
/src/cameraDialog.cpp
${
SCHNApps_ROOT_DIR
}
/src/pluginDialog.cpp
...
...
@@ -38,7 +39,9 @@ file(
SET
(
SCHNApps_H_OBJECT_FILES
${
SCHNApps_ROOT_DIR
}
/include/window.h
${
SCHNApps_ROOT_DIR
}
/include/view.h
${
SCHNApps_ROOT_DIR
}
/include/plugin.h
${
SCHNApps_ROOT_DIR
}
/include/splitArea.h
${
SCHNApps_ROOT_DIR
}
/include/viewButtonArea.h
${
SCHNApps_ROOT_DIR
}
/include/viewSelector.h
${
SCHNApps_ROOT_DIR
}
/include/cameraDialog.h
${
SCHNApps_ROOT_DIR
}
/include/pluginDialog.h
...
...
SCHNApps/Plugins/firstPlugin/include/firstPlugin.h
View file @
5d64b236
...
...
@@ -70,20 +70,20 @@ public:
*/
void
disable
();
void
cb_initGL
(
Scene
*
scene
);
void
cb_initGL
(
View
*
scene
);
virtual
void
cb_updateMatrix
(
View
*
view
)
{}
void
cb_redraw
(
Scene
*
scene
);
virtual
void
cb_keyPress
(
Scene
*
scene
,
int
key
)
{}
virtual
void
cb_keyRelease
(
Scene
*
scene
,
int
key
)
{}
virtual
void
cb_mousePress
(
Scene
*
scene
,
int
button
,
int
x
,
int
y
)
{}
virtual
void
cb_mouseRelease
(
Scene
*
scene
,
int
button
,
int
x
,
int
y
)
{}
// virtual void cb_mouseClick(
Scene
* scene, int button, int x, int y) {}
virtual
void
cb_mouseMove
(
Scene
*
scene
,
int
buttons
,
int
x
,
int
y
)
{}
virtual
void
cb_wheelEvent
(
Scene
*
scene
,
int
delta
,
int
x
,
int
y
)
{}
virtual
void
cb_viewAdded
(
Scene
*
s
)
{}
virtual
void
cb_viewRemoved
(
Scene
*
s
)
{}
void
cb_redraw
(
View
*
scene
);
virtual
void
cb_keyPress
(
View
*
scene
,
int
key
)
{}
virtual
void
cb_keyRelease
(
View
*
scene
,
int
key
)
{}
virtual
void
cb_mousePress
(
View
*
scene
,
int
button
,
int
x
,
int
y
)
{}
virtual
void
cb_mouseRelease
(
View
*
scene
,
int
button
,
int
x
,
int
y
)
{}
// virtual void cb_mouseClick(
View
* scene, int button, int x, int y) {}
virtual
void
cb_mouseMove
(
View
*
scene
,
int
buttons
,
int
x
,
int
y
)
{}
virtual
void
cb_wheelEvent
(
View
*
scene
,
int
delta
,
int
x
,
int
y
)
{}
virtual
void
cb_viewAdded
(
View
*
s
)
{}
virtual
void
cb_viewRemoved
(
View
*
s
)
{}
protected:
/** Attributes that are specific to this plugin **/
...
...
SCHNApps/Plugins/firstPlugin/src/firstPlugin.cpp
View file @
5d64b236
#include "firstPlugin.h"
#include "Algo/Geometry/boundingbox.h"
void
FirstPlugin
::
cb_initGL
(
Scene
*
scene
)
void
FirstPlugin
::
cb_initGL
(
View
*
view
)
{
if
(
scene
)
if
(
view
)
{
// we fit the first (possibly the only) view of the newly liked
// scene to the content of our map
// bounding box of scene
Geom
::
BoundingBox
<
PFP
::
VEC3
>
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
position
);
scene
->
firstViewFitSphere
(
bb
.
center
()[
0
],
bb
.
center
()[
1
],
bb
.
center
()[
2
],
bb
.
maxSize
());
//
scene->firstViewFitSphere(bb.center()[0], bb.center()[1], bb.center()[2], bb.maxSize());
m_render_topo
=
new
Algo
::
Render
::
GL2
::
TopoRender
()
;
...
...
@@ -21,7 +18,7 @@ void FirstPlugin::cb_initGL(Scene *scene)
}
}
void
FirstPlugin
::
cb_redraw
(
Scene
*
scene
)
void
FirstPlugin
::
cb_redraw
(
View
*
view
)
{
m_render_topo
->
drawTopo
();
}
...
...
SCHNApps/Release/CMakeLists.txt
View file @
5d64b236
...
...
@@ -31,6 +31,7 @@ file(
${
SCHNApps_ROOT_DIR
}
/src/system.cpp
${
SCHNApps_ROOT_DIR
}
/src/view.cpp
${
SCHNApps_ROOT_DIR
}
/src/window.cpp
${
SCHNApps_ROOT_DIR
}
/src/viewButtonArea.cpp
${
SCHNApps_ROOT_DIR
}
/src/viewSelector.cpp
${
SCHNApps_ROOT_DIR
}
/src/cameraDialog.cpp
${
SCHNApps_ROOT_DIR
}
/src/pluginDialog.cpp
...
...
@@ -40,7 +41,9 @@ file(
SET
(
SCHNApps_H_OBJECT_FILES
${
SCHNApps_ROOT_DIR
}
/include/window.h
${
SCHNApps_ROOT_DIR
}
/include/view.h
${
SCHNApps_ROOT_DIR
}
/include/plugin.h
${
SCHNApps_ROOT_DIR
}
/include/splitArea.h
${
SCHNApps_ROOT_DIR
}
/include/viewButtonArea.h
${
SCHNApps_ROOT_DIR
}
/include/viewSelector.h
${
SCHNApps_ROOT_DIR
}
/include/cameraDialog.h
${
SCHNApps_ROOT_DIR
}
/include/pluginDialog.h
...
...
SCHNApps/include/window.h
View file @
5d64b236
...
...
@@ -267,7 +267,7 @@ protected:
MapHash
h_maps
;
PluginDialog
*
m_pluginDialog
;
CameraDialog
*
m_camera
View
Dialog
;
CameraDialog
*
m_cameraDialog
;
/**
* \var bool keys[3]
...
...
SCHNApps/src/view.cpp
View file @
5d64b236
...
...
@@ -18,6 +18,7 @@ View::View(const QString& name, Window* w, QWidget* parent, const QGLWidget* sha
QGLViewer
(
parent
,
shareWidget
),
m_name
(
name
),
m_window
(
w
),
m_currentCamera
(
NULL
),
m_cameraButton
(
NULL
),
m_pluginsButton
(
NULL
),
m_mapsButton
(
NULL
),
...
...
@@ -47,20 +48,6 @@ View::~View()
delete
m_buttonArea
;
}
void
View
::
setCurrentCamera
(
Camera
*
c
)
{
if
(
c
!=
m_currentCamera
)
{
if
(
m_currentCamera
!=
NULL
)
m_currentCamera
->
unlinkView
(
this
);
m_currentCamera
=
c
;
m_currentCamera
->
linkView
(
this
);
this
->
setCamera
(
m_currentCamera
);
updateTextInfo
();
updateGL
();
}
}
void
View
::
initGL
()
{
m_cameraButton
=
new
ViewButton
(
":icons/icons/camera_32.png"
,
this
);
...
...
@@ -101,7 +88,7 @@ void View::draw()
glEnd
();
glPushAttrib
(
GL_ALL_ATTRIB_BITS
);
drawButtons
();
//
drawButtons();
drawText
();
glPopAttrib
();
}
...
...
@@ -183,6 +170,42 @@ void View::drawOverpaint(QPainter *painter)
painter
->
restore
();
}
void
View
::
setCurrentCamera
(
Camera
*
c
)
{
if
(
c
!=
m_currentCamera
)
{
if
(
m_currentCamera
!=
NULL
)
m_currentCamera
->
unlinkView
(
this
);
m_currentCamera
=
c
;
m_currentCamera
->
linkView
(
this
);
this
->
setCamera
(
m_currentCamera
);
updateTextInfo
();
updateGL
();
}
}
void
View
::
linkPlugin
(
Plugin
*
plugin
)
{
if
(
plugin
&&
!
l_plugins
.
contains
(
plugin
))
l_plugins
.
push_back
(
plugin
);
}
void
View
::
unlinkPlugin
(
Plugin
*
plugin
)
{
l_plugins
.
removeOne
(
plugin
);
}
void
View
::
linkMap
(
MapHandler
*
map
)
{
if
(
map
&&
!
l_maps
.
contains
(
map
))
l_maps
.
push_back
(
map
);
}
void
View
::
unlinkMap
(
MapHandler
*
map
)
{
l_maps
.
removeOne
(
map
);
}
void
View
::
updateTextInfo
()
{
m_textInfo
=
...
...
SCHNApps/src/viewButtonArea.cpp
View file @
5d64b236
#include "viewButtonArea.h"
#include "camera.h"
#include "scene.h"
//#include "context.h"
#include <iostream>
...
...
SCHNApps/src/window.cpp
View file @
5d64b236
...
...
@@ -26,7 +26,7 @@ Window::Window(QWidget *parent) :
m_initialization
=
true
;
m_pluginDialog
=
new
PluginDialog
(
this
);
m_camera
View
Dialog
=
new
CameraDialog
(
this
);
m_cameraDialog
=
new
CameraDialog
(
this
);
glewInit
();
...
...
@@ -414,8 +414,6 @@ View* Window::addView(const QString& name)
view
=
new
View
(
name
,
this
,
this
,
m_firstView
);
h_views
.
insert
(
name
,
view
);
m_cameraViewDialog
->
addViewToList
(
view
->
getName
());
return
view
;
}
...
...
@@ -465,7 +463,7 @@ Camera* Window::addCamera(const QString& name)
Camera
*
camera
=
new
Camera
(
name
,
this
);
h_cameras
.
insert
(
name
,
camera
);
m_camera
View
Dialog
->
addCameraToList
(
camera
->
getName
());
m_cameraDialog
->
addCameraToList
(
camera
->
getName
());
return
camera
;
}
...
...
@@ -655,5 +653,5 @@ void Window::cb_manageViews()
void
Window
::
cb_manageCameras
()
{
m_camera
View
Dialog
->
show
();
m_cameraDialog
->
show
();
}
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