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
90c61bbf
Commit
90c61bbf
authored
Nov 26, 2012
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCHNApps : suite du ménage
parent
b78c9abb
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
565 additions
and
833 deletions
+565
-833
SCHNApps/include/camera.h
SCHNApps/include/camera.h
+26
-17
SCHNApps/include/context.h
SCHNApps/include/context.h
+1
-1
SCHNApps/include/plugin.h
SCHNApps/include/plugin.h
+19
-20
SCHNApps/include/scene.h
SCHNApps/include/scene.h
+17
-28
SCHNApps/include/types.h
SCHNApps/include/types.h
+7
-0
SCHNApps/include/view.h
SCHNApps/include/view.h
+52
-57
SCHNApps/include/viewButtonArea.h
SCHNApps/include/viewButtonArea.h
+12
-23
SCHNApps/include/window.h
SCHNApps/include/window.h
+6
-0
SCHNApps/src/camera.cpp
SCHNApps/src/camera.cpp
+23
-21
SCHNApps/src/context.cpp
SCHNApps/src/context.cpp
+1
-1
SCHNApps/src/plugin.cpp
SCHNApps/src/plugin.cpp
+18
-17
SCHNApps/src/scene.cpp
SCHNApps/src/scene.cpp
+101
-230
SCHNApps/src/view.cpp
SCHNApps/src/view.cpp
+244
-379
SCHNApps/src/viewButtonArea.cpp
SCHNApps/src/viewButtonArea.cpp
+38
-39
No files found.
SCHNApps/include/camera.h
View file @
90c61bbf
...
...
@@ -8,34 +8,43 @@
class
Camera
:
public
qglviewer
::
Camera
{
public:
Camera
(
View
*
v
);
Camera
(
View
*
v
,
Camera
c
);
Camera
(
Window
*
window
,
View
*
v
);
Camera
(
Window
*
window
,
View
*
v
,
const
qglviewer
::
Camera
&
c
);
~
Camera
();
bool
isShared
()
{
return
l_views
.
size
()
>
1
;
}
QString
getName
()
{
return
m_name
;
}
void
setName
(
QString
name
)
{
m_name
=
name
;
}
QString
getName
()
{
return
m_name
;
}
Window
*
getWindow
()
{
return
m_window
;
}
void
setWindow
(
Window
*
w
)
{
m_window
=
w
;
}
bool
isShared
()
{
return
l_views
.
size
()
>
1
;
}
void
draw
();
bool
getDraw
()
{
return
m_draw
;
}
bool
getDrawFarPlane
()
{
return
m_drawFarPlane
;
}
double
getDrawScale
()
{
return
m_drawScale
;
}
bool
getDrawPath
()
{
return
m_drawPath
;
}
bool
getDrawPathAxis
()
{
return
m_drawPathAxis
;
}
double
getDrawPathScale
()
{
return
m_drawPathScale
;
}
void
setDraw
(
bool
b
=
true
)
{
m_draw
=
b
;
}
bool
getDrawFarPlane
()
{
return
m_drawFarPlane
;
}
void
setDrawFarPlane
(
bool
b
=
true
)
{
m_drawFarPlane
=
b
;
}
double
getDrawScale
()
{
return
m_drawScale
;
}
void
setDrawScale
(
double
s
)
{
m_drawScale
=
s
;
}
bool
getDrawPath
()
{
return
m_drawPath
;
}
void
setDrawPath
(
bool
b
=
true
)
{
m_drawPath
=
b
;
}
bool
getDrawPathAxis
()
{
return
m_drawPathAxis
;
}
void
setDrawPathAxis
(
bool
b
=
true
)
{
m_drawPathAxis
=
b
;
}
double
getDrawPathScale
()
{
return
m_drawPathScale
;
}
void
setDrawPathScale
(
double
s
)
{
m_drawPathScale
=
s
;}
void
takenFrom
(
View
*
v
);
void
sharedWith
(
View
*
v
);
void
fitParamWith
(
View
*
v
);
void
linkView
(
View
*
view
);
void
unlinkView
(
View
*
view
);
bool
isLinkedWithView
(
View
*
view
);
void
fitParamWith
(
View
*
view
);
void
resetSnapCount
()
{
m_snapCount
=
0
;
}
void
saveSnapshot
(
QString
snapPathName
);
...
...
@@ -45,9 +54,11 @@ public:
void
viewShowButton
(
bool
b
);
protected:
QList
<
View
*>
l_views
;
static
unsigned
int
cameraCount
;
QString
m_name
;
Window
*
m_window
;
QList
<
View
*>
l_views
;
bool
m_draw
;
bool
m_drawFarPlane
;
...
...
@@ -57,8 +68,6 @@ protected:
bool
m_drawPathAxis
;
double
m_drawPathScale
;
View
*
m_lastWorkingView
;
int
m_snapCount
;
};
...
...
SCHNApps/include/context.h
View file @
90c61bbf
...
...
@@ -8,7 +8,7 @@
class
Context
:
public
QGLContext
{
public:
Context
(
QWidget
*
w
,
const
QGLFormat
&
format
);
Context
(
const
QGLFormat
&
format
,
QWidget
*
w
);
void
setDevice
(
QWidget
*
w
);
};
...
...
SCHNApps/include/plugin.h
View file @
90c61bbf
...
...
@@ -20,8 +20,7 @@ public:
enum
{
UNLIMITED_NUMBER_OF_MAPS
=
-
1
};
enum
{
UNLIMITED_NUMBER_OF_SCENES
=
-
1
};
Plugin
(
const
QString
&
name
,
const
QString
&
filePath
);
Plugin
(
const
QString
&
name
,
const
QString
&
filePath
,
Window
*
window
);
virtual
~
Plugin
();
virtual
bool
enable
()
=
0
;
...
...
@@ -43,13 +42,13 @@ public:
virtual
void
cb_updateMatrix
(
View
*
view
)
=
0
;
virtual
void
cb_redraw
(
Scene
*
scene
)
=
0
;
virtual
bool
cb_keyPress
(
Scene
*
scene
,
int
event
)
=
0
;
virtual
bool
cb_keyRelease
(
Scene
*
scene
,
int
event
)
=
0
;
virtual
bool
cb_mousePress
(
Scene
*
scene
,
int
button
,
int
x
,
int
y
)
=
0
;
virtual
bool
cb_mouseRelease
(
Scene
*
scene
,
int
button
,
int
x
,
int
y
)
=
0
;
virtual
bool
cb_mouseClick
(
Scene
*
scene
,
int
button
,
int
x
,
int
y
)
=
0
;
virtual
bool
cb_mouseMove
(
Scene
*
scene
,
int
buttons
,
int
x
,
int
y
)
=
0
;
virtual
bool
cb_wheelEvent
(
Scene
*
scene
,
int
delta
,
int
x
,
int
y
)
=
0
;
virtual
void
cb_keyPress
(
Scene
*
scene
,
int
key
)
=
0
;
virtual
void
cb_keyRelease
(
Scene
*
scene
,
int
key
)
=
0
;
virtual
void
cb_mousePress
(
Scene
*
scene
,
int
button
,
int
x
,
int
y
)
=
0
;
virtual
void
cb_mouseRelease
(
Scene
*
scene
,
int
button
,
int
x
,
int
y
)
=
0
;
virtual
void
cb_mouseClick
(
Scene
*
scene
,
int
button
,
int
x
,
int
y
)
=
0
;
virtual
void
cb_mouseMove
(
Scene
*
scene
,
int
buttons
,
int
x
,
int
y
)
=
0
;
virtual
void
cb_wheelEvent
(
Scene
*
scene
,
int
delta
,
int
x
,
int
y
)
=
0
;
virtual
void
cb_mapAdded
(
MapHandler
*
map
)
=
0
;
virtual
void
cb_mapRemoved
(
MapHandler
*
map
)
=
0
;
...
...
@@ -60,21 +59,21 @@ public:
/*********************************************************
* MANAGE MAPS
*********************************************************/
bool
add
Map
(
MapHandler
*
map
);
void
remove
Map
(
MapHandler
*
map
);
bool
has
Map
(
MapHandler
*
map
);
QList
<
MapHandler
*>
getMaps
();
void
setMaxNumberOfMaps
(
int
n
);
int
getCurrentNumberOfMaps
();
int
getRemainingNumberOfMaps
();
bool
link
Map
(
MapHandler
*
map
);
void
unlink
Map
(
MapHandler
*
map
);
bool
isLinkedTo
Map
(
MapHandler
*
map
);
QList
<
MapHandler
*>
get
Linked
Maps
();
void
setMaxNumberOf
Linked
Maps
(
int
n
);
int
getCurrentNumberOf
Linked
Maps
();
int
getRemainingNumberOf
Linked
Maps
();
/*********************************************************
* MANAGE SCENES
*********************************************************/
bool
add
Scene
(
Scene
*
scene
);
void
remove
Scene
(
Scene
*
scene
);
bool
has
Scene
(
Scene
*
scene
);
QList
<
Scene
*>
getScenes
();
bool
link
Scene
(
Scene
*
scene
);
void
unlink
Scene
(
Scene
*
scene
);
bool
isLinkedTo
Scene
(
Scene
*
scene
);
QList
<
Scene
*>
get
Linked
Scenes
();
/*********************************************************
* MANAGE DOCK TABS
...
...
SCHNApps/include/scene.h
View file @
90c61bbf
...
...
@@ -41,41 +41,33 @@ public:
void
updateGL
();
void
draw
(
View
*
v
);
bool
keyPressEvent
(
QKeyEvent
*
event
);
bool
keyReleaseEvent
(
QKeyEvent
*
e
);
bool
mousePressEvent
(
QMouseEvent
*
event
);
bool
mouseReleaseEvent
(
QMouseEvent
*
event
);
bool
mouseMoveEvent
(
QMouseEvent
*
event
);
bool
wheelEvent
(
QWheelEvent
*
event
);
void
keyPressEvent
(
QKeyEvent
*
event
);
void
keyReleaseEvent
(
QKeyEvent
*
e
);
void
mousePressEvent
(
QMouseEvent
*
event
);
void
mouseReleaseEvent
(
QMouseEvent
*
event
);
void
mouseMoveEvent
(
QMouseEvent
*
event
);
void
wheelEvent
(
QWheelEvent
*
event
);
/*********************************************************
* MANAGE VIEWS
*********************************************************/
View
*
addView
(
Camera
*
c
=
NULL
);
void
removeView
(
View
*
view
);
View
*
getView
(
int
num
);
QList
<
View
*>
getViews
()
{
return
l_views
;
}
int
getNbViews
()
{
return
l_views
.
size
();
}
void
viewClickedButton
(
View
*
view
,
ViewButton
*
viewButton
);
void
linkView
(
View
*
view
);
void
unlinkView
(
View
*
view
);
View
*
getLinkedView
(
unsigned
int
num
);
QList
<
View
*>
getLinkedViews
()
{
return
l_views
;
}
int
getNbLinkedViews
()
{
return
l_views
.
size
();
}
/*********************************************************
* MANAGE PLUGINS
*********************************************************/
void
addPlugin
(
Plugin
*
plugin
,
bool
callBack
InitGL
=
true
);
void
remove
Plugin
(
Plugin
*
plugin
);
QList
<
Plugin
*>
getPlugins
()
{
return
l_plugins
;
}
bool
has
Plugins
()
{
return
!
l_plugins
.
isEmpty
();
}
bool
has
Plugin
(
Plugin
*
plugin
)
{
return
l_plugins
.
contains
(
plugin
);
}
void
linkPlugin
(
Plugin
*
plugin
,
bool
call
InitGL
=
true
);
void
unlink
Plugin
(
Plugin
*
plugin
);
QList
<
Plugin
*>
get
Linked
Plugins
()
{
return
l_plugins
;
}
bool
isLinkedTo
Plugins
()
{
return
!
l_plugins
.
isEmpty
();
}
bool
isLinkedTo
Plugin
(
Plugin
*
plugin
)
{
return
l_plugins
.
contains
(
plugin
);
}
// void linkWithPlugin();
// void unlinkPlugin();
/*********************************************************
* MANAGE VIEW BUTTONS
*********************************************************/
bool
addViewButton
(
ViewButton
*
viewButton
);
ViewButton
*
removeViewButton
(
ViewButton
*
viewButton
);
// VBOHandler* addNewVBO(QString name);
// void addVBO(VBOHandler* vbo);
// VBOHandler* findVBO(QString name);
...
...
@@ -93,10 +85,7 @@ protected:
QList
<
View
*>
l_views
;
QList
<
Plugin
*>
l_plugins
;
// QList<VBOHandler*> l_vbo;
QList
<
ViewButton
*>
l_viewButtons
;
signals:
void
viewButtonClicked
(
View
*
,
ViewButton
*
);
// QList<ViewButton*> l_viewButtons;
};
#endif
SCHNApps/include/types.h
View file @
90c61bbf
...
...
@@ -9,7 +9,11 @@
class
Plugin
;
class
Scene
;
class
View
;
class
Camera
;
class
MapHandler
;
namespace
CGoGN
{
namespace
Utils
...
...
@@ -21,6 +25,9 @@ namespace CGoGN
typedef
QHash
<
QString
,
Plugin
*>
PluginHash
;
typedef
QHash
<
QString
,
Scene
*>
SceneHash
;
typedef
QHash
<
QString
,
View
*>
ViewHash
;
typedef
QHash
<
QString
,
Camera
*>
CameraHash
;
typedef
QHash
<
QString
,
MapHandler
*>
MapHash
;
typedef
QHash
<
QString
,
CGoGN
::
Utils
::
VBO
*>
VBOHash
;
typedef
QHash
<
QString
,
CGoGN
::
Utils
::
GLSLShader
*>
ShaderHash
;
...
...
SCHNApps/include/view.h
View file @
90c61bbf
...
...
@@ -9,10 +9,10 @@
# include <QKeyEvent>
#include <QList>
#include <QWidget>
#include <QGLContext>
#include "Utils/gl_matrices.h"
//forward declaration
class
Scene
;
class
Camera
;
class
Context
;
...
...
@@ -22,14 +22,32 @@ class View : public QGLViewer
Q_OBJECT
public:
View
(
Scene
*
s
,
const
QString
&
name
,
Camera
*
c
,
QGLWidget
*
shareWidget
=
NULL
,
Context
*
context
=
NULL
,
QWidget
*
paren
t
=
NULL
);
View
(
const
QString
&
name
,
Window
*
w
,
Scene
*
s
,
Camera
*
c
,
QWidget
*
parent
,
const
QGLWidget
*
shareWidge
t
=
NULL
);
~
View
();
const
QString
&
getName
()
{
return
m_name
;
}
void
setName
(
const
QString
&
name
)
{
m_name
=
name
;
}
Window
*
getWindow
()
{
return
m_window
;
}
void
setWindow
(
Window
*
w
)
{
m_window
=
w
;
}
Scene
*
getScene
()
{
return
m_scene
;
}
void
setScene
(
Scene
*
s
)
{
m_scene
=
s
;
}
Camera
*
getCurrentCamera
()
{
return
m_currentCamera
;
}
void
setCurrentCamera
(
Camera
*
c
)
{
m_currentCamera
=
c
;
updateTextInfo
();
updateGL
();
}
QGLContext
*
getContext
()
{
return
m_context
;
}
void
setContext
(
QGLContext
*
c
)
{
m_context
=
c
;
}
virtual
void
initGL
();
virtual
void
updateGL
();
virtual
void
draw
();
virtual
void
init
();
void
drawCameras
(
View
*
view
);
void
drawText
();
void
drawButtons
();
...
...
@@ -47,28 +65,12 @@ public:
// virtual void paintGL() { update(); }
// virtual void paintEvent(QPaintEvent *event);
Scene
*
getScene
()
{
return
m_scene
;
}
void
setName
(
const
QString
&
name
)
{
m_name
=
name
;
}
const
QString
&
getName
()
{
return
m_name
;
}
void
enableLinking
(
bool
b
=
true
);
void
enableUnlinking
(
bool
b
=
true
);
void
enableCameraGesture
(
bool
b
=
true
);
void
enableSceneCameraGesture
(
bool
b
=
true
);
void
enableViewClose
(
bool
b
=
true
);
Camera
*
currentCamera
()
{
return
m_currentCamera
;
}
void
setCurrentCamera
(
Camera
*
c
);
QList
<
Camera
*>
cameras
()
{
return
l_camera
;
}
int
countCameras
()
{
return
l_camera
.
size
();
}
void
removeCamera
(
Camera
*
c
);
Camera
*
takeCamera
(
Camera
*
c
);
Camera
*
addCamera
();
void
insertCamera
(
int
index
,
Camera
*
c
);
void
shareCamera
(
Camera
*
c
,
int
index
=
0
);
// void addUnlinkButton();
// void removeUnlinkButton();
...
...
@@ -78,55 +80,48 @@ public:
glm
::
mat4
getCurrentProjectionMatrix
();
glm
::
mat4
getCurrentModelViewProjectionMatrix
();
void
setCurrentModelViewMatrix
(
glm
::
mat4
mvm
);
void
setCurrentProjectionMatrix
(
glm
::
mat4
pm
);
void
setCurrentModelViewMatrix
(
const
glm
::
mat4
&
mvm
);
void
setCurrentProjectionMatrix
(
const
glm
::
mat4
&
pm
);
void
addCustom
ViewButton
(
ViewButton
*
viewButton
);
void
removeCustom
ViewButton
(
ViewButton
*
viewButton
);
// void add
ViewButton(ViewButton* viewButton);
// void remove
ViewButton(ViewButton* viewButton);
void
setShowButtons
(
bool
b
)
{
b_showButtons
=
b
;
}
//
void setShowButtons(bool b) { b_showButtons = b; }
protected:
QString
m_name
;
Window
*
m_window
;
Scene
*
m_scene
;
QList
<
Camera
*>
l_camera
;
QGLContext
*
m_context
;
Camera
*
m_currentCamera
;
ViewButtonArea
*
m_buttonArea
;
//
ViewButtonArea* m_buttonArea;
ViewButton
*
m_linkButton
;
bool
m_linkViewEnabled
;
ViewButton
*
m_unlinkButton
;
bool
m_unlinkViewEnabled
;
ViewButton
*
m_cameraButton
;
bool
m_cameraEnabled
;
ViewButton
*
m_cameraSceneButton
;
bool
m_cameraSceneEnabled
;
ViewButton
*
m_closeViewButton
;
bool
m_closeViewEnabled
;
//
ViewButton* m_linkButton;
//
bool m_linkViewEnabled;
//
ViewButton* m_unlinkButton;
//
bool m_unlinkViewEnabled;
//
ViewButton* m_cameraButton;
//
bool m_cameraEnabled;
//
ViewButton* m_cameraSceneButton;
//
bool m_cameraSceneEnabled;
//
ViewButton* m_closeViewButton;
//
bool m_closeViewEnabled;
QString
m_textInfo
;
Context
*
m_context
;
bool
b_showButtons
;
// bool b_showButtons;
public
slots
:
void
linkView
();
void
unlinkView
();
void
cameraGesture
();
void
cameraSceneGesture
();
void
closeView
();
void
clickButton
(
ViewButton
*
viewButton
);
QString
m_textInfo
;
bool
b_drawText
;
private:
bool
b_destroyView
;
//public slots:
// void linkView();
// void unlinkView();
// void cameraGesture();
// void cameraSceneGesture();
// void closeView();
signals:
void
currentCameraChanged
(
Camera
*
camera
);
void
viewButtonClicked
(
ViewButton
*
viewButton
);
//signals:
// void currentCameraChanged(Camera* camera);
};
#endif
SCHNApps/include/viewButtonArea.h
View file @
90c61bbf
...
...
@@ -17,26 +17,23 @@ class ViewButton : public QObject
Q_OBJECT
public:
ViewButton
(
QString
image
,
View
*
view
);
ViewButton
(
const
QString
&
image
,
View
*
view
);
~
ViewButton
();
void
click
(
View
*
view
)
{
emit
clicked
();
emit
viewClicked
(
view
);
}
void
click
();
void
drawAt
(
int
x
,
int
y
);
QSize
getSize
()
{
return
m_GLimg
.
size
();
}
protected:
View
*
m_view
;
QSize
m_size
;
QImage
m_GLimg
;
int
m_texID
;
signals:
void
clicked
();
void
viewClicked
(
View
*
view
);
};
class
ViewButtonArea
:
public
QObject
...
...
@@ -46,33 +43,25 @@ class ViewButtonArea : public QObject
public:
ViewButtonArea
(
View
*
view
)
:
m_view
(
view
)
{}
~
ViewButtonArea
();
~
ViewButtonArea
()
{}
void
addButton
(
ViewButton
*
button
);
ViewButton
*
takeButton
(
ViewButton
*
button
);
bool
isIn
(
int
x
,
int
y
);
void
removeButton
(
ViewButton
*
button
);
ViewButton
*
clickAt
(
int
x
,
int
y
);
bool
isClicked
(
int
x
,
int
y
);
ViewButton
*
clickButton
(
int
x
,
int
y
);
QRect
f
orm
()
{
return
m_form
;
}
const
QRect
&
getF
orm
()
{
return
m_form
;
}
void
setTopRightPosition
(
int
x
,
int
y
);
void
draw
();
protected:
QRect
m_form
;
QList
<
ViewButton
*>
l_button
;
View
*
m_view
;
public
slots
:
void
buttonDestroyed
(
QObject
*
button
);
signals:
void
buttonClicked
(
ViewButton
*
button
);
QRect
m_form
;
QList
<
ViewButton
*>
l_buttons
;
};
#endif
SCHNApps/include/window.h
View file @
90c61bbf
...
...
@@ -243,6 +243,11 @@ public:
* MANAGE MAPS
*********************************************************/
/*********************************************************
* MANAGE CAMERAS
*********************************************************/
QList
<
Camera
*>
getCameras
()
{
return
h_cameras
.
values
();
}
...
...
@@ -353,6 +358,7 @@ protected:
SceneHash
h_scenes
;
PluginHash
h_plugins
;
MapHash
h_maps
;
CameraHash
h_cameras
;
/**
* \var bool keys[3]
...
...
SCHNApps/src/camera.cpp
View file @
90c61bbf
#include "camera.h"
#include "scene.h"
Camera
::
Camera
(
View
*
v
)
:
m_name
(
"camera"
),
static
unsigned
int
Camera
::
cameraCount
=
0
;
Camera
::
Camera
(
Window
*
window
,
View
*
v
)
:
m_window
(
window
),
m_draw
(
false
),
m_drawFarPlane
(
false
),
m_drawScale
(
1.0
),
m_drawPath
(
false
),
m_drawPathAxis
(
false
),
m_drawPathScale
(
1.0
),
m_lastWorkingView
(
v
),
m_snapCount
(
0
)
{
m_name
=
"camera_"
+
cameraCount
;
++
cameraCount
;
if
(
v
)
l_views
.
push_back
(
v
);
this
->
setZClippingCoefficient
(
100
);
}
Camera
::
Camera
(
View
*
v
,
Camera
c
)
:
Camera
::
Camera
(
Window
*
window
,
View
*
v
,
const
qglviewer
::
Camera
&
c
)
:
qglviewer
::
Camera
(
c
),
m_
name
(
"camera"
),
m_
window
(
window
),
m_draw
(
false
),
m_drawFarPlane
(
false
),
m_drawScale
(
1.0
),
m_drawPath
(
false
),
m_drawPathAxis
(
false
),
m_drawPathScale
(
1.0
),
m_lastWorkingView
(
v
),
m_snapCount
(
0
)
{
m_name
=
"camera_"
+
cameraCount
;
++
cameraCount
;
if
(
v
)
l_views
.
push_back
(
v
);
this
->
setZClippingCoefficient
(
100
);
...
...
@@ -53,33 +57,31 @@ void Camera::draw()
}
}
void
Camera
::
takenFrom
(
View
*
v
)
void
Camera
::
linkView
(
View
*
view
)
{
l_views
.
removeOne
(
v
);
// int i = l_views.indexOf(v);
// if(i >= 0)
// l_views.takeAt(i);
if
(
view
&&
!
l_views
.
contains
(
view
))
l_views
.
push_back
(
view
);
}
void
Camera
::
sharedWith
(
View
*
v
)
void
Camera
::
unlinkView
(
View
*
view
)
{
if
(
!
l_views
.
contains
(
v
))
l_views
.
push_back
(
v
);
l_views
.
removeOne
(
view
);
}
void
Camera
::
fitParamWith
(
View
*
v
)
bool
Camera
::
isLinkedWithView
(
View
*
view
)
{
if
(
v
!=
m_lastWorkingView
)
{
setScreenWidthAndHeight
(
v
->
width
(),
v
->
height
());
m_lastWorkingView
=
v
;
}
return
l_views
.
contains
(
view
);
}
void
Camera
::
fitParamWith
(
View
*
view
)
{
setScreenWidthAndHeight
(
view
->
width
(),
view
->
height
());
}
void
Camera
::
saveSnapshot
(
QString
snapPathName
)
{
foreach
(
View
*
view
,
l_views
)
view
->
saveSnapshot
(
snapPathName
+
view
->
getName
()
+
'_'
+
QString
::
number
(
m_snapCount
)
+
".jp
e
g"
,
true
);
view
->
saveSnapshot
(
snapPathName
+
view
->
getName
()
+
'_'
+
QString
::
number
(
m_snapCount
)
+
".jpg"
,
true
);
++
m_snapCount
;
}
...
...
SCHNApps/src/context.cpp
View file @
90c61bbf
#include "context.h"
Context
::
Context
(
QWidget
*
w
,
const
QGLFormat
&
format
)
:
QGLContext
(
format
,
w
)
Context
::
Context
(
const
QGLFormat
&
format
,
QWidget
*
w
)
:
QGLContext
(
format
,
w
)
{}
void
Context
::
setDevice
(
QWidget
*
w
)
...
...
SCHNApps/src/plugin.cpp
View file @
90c61bbf
#include "plugin.h"
Plugin
::
Plugin
(
const
QString
&
name
,
const
QString
&
filePath
)
{
}
Plugin
::
Plugin
(
const
QString
&
name
,
const
QString
&
filePath
,
Window
*
window
)
:
m_name
(
name
),
m_filePath
(
filePath
),
m_window
(
window
)
{}
Plugin
::~
Plugin
()