Commit 742fcf8d authored by Pierre Kraemer's avatar Pierre Kraemer

SCHNApps : première version presque fonctionnelle..

parent 78546092
......@@ -29,20 +29,23 @@ file(
${SCHNApps_ROOT_DIR}/src/splitArea.cpp
${SCHNApps_ROOT_DIR}/src/system.cpp
${SCHNApps_ROOT_DIR}/src/view.cpp
${SCHNApps_ROOT_DIR}/src/viewSelector.cpp
${SCHNApps_ROOT_DIR}/src/window.cpp
${SCHNApps_ROOT_DIR}/src/viewSelector.cpp
${SCHNApps_ROOT_DIR}/src/cameraViewDialog.cpp
${SCHNApps_ROOT_DIR}/src/pluginDialog.cpp
)
SET(SCHNApps_H_OBJECT_FILES
${SCHNApps_ROOT_DIR}/include/window.h
${SCHNApps_ROOT_DIR}/include/scene.h
${SCHNApps_ROOT_DIR}/include/view.h
${SCHNApps_ROOT_DIR}/include/viewButtonArea.h
${SCHNApps_ROOT_DIR}/include/system.h
${SCHNApps_ROOT_DIR}/include/splitArea.h
${SCHNApps_ROOT_DIR}/include/viewSelector.h
${SCHNApps_ROOT_DIR}/include/cameraViewDialog.h
${SCHNApps_ROOT_DIR}/include/pluginDialog.h
# ${SCHNApps_ROOT_DIR}/include/dialogs/newSceneDialog.h
# ${SCHNApps_ROOT_DIR}/include/dialogs/sceneSelector.h
# ${SCHNApps_ROOT_DIR}/include/dialogs/cameraViewDialog.h
# ${SCHNApps_ROOT_DIR}/include/dialogs/cameraOptionDialog.h
# ${SCHNApps_ROOT_DIR}/include/dialogs/cameraSceneDialog.h
# ${SCHNApps_ROOT_DIR}/include/dialogs/globalCameraDialog.h
......@@ -54,7 +57,9 @@ SET(SCHNApps_H_OBJECT_FILES
file(
GLOB
SCHNApps_FORM_FILES
${SCHNApps_ROOT_DIR}/forms/*.ui
${SCHNApps_ROOT_DIR}/forms/window.ui
${SCHNApps_ROOT_DIR}/forms/cameraViewDialog.ui
${SCHNApps_ROOT_DIR}/forms/pluginDialog.ui
)
QT4_WRAP_UI( UI_H_FILES
......
......@@ -76,7 +76,7 @@ public:
* conditions.
* If this methods return 'false', the plugin load will be aborted.
*/
bool activate();
bool enable();
/**
* The plugin's disabling method
......
......@@ -26,7 +26,7 @@ void FirstPlugin::cb_redraw(Scene *scene)
m_render_topo->drawTopo();
}
bool FirstPlugin::activate()
bool FirstPlugin::enable()
{
// creation of 2 new faces: 1 triangle and 1 square
Dart d1 = myMap.newFace(3);
......
......@@ -31,20 +31,23 @@ file(
${SCHNApps_ROOT_DIR}/src/splitArea.cpp
${SCHNApps_ROOT_DIR}/src/system.cpp
${SCHNApps_ROOT_DIR}/src/view.cpp
${SCHNApps_ROOT_DIR}/src/viewSelector.cpp
${SCHNApps_ROOT_DIR}/src/window.cpp
${SCHNApps_ROOT_DIR}/src/viewSelector.cpp
${SCHNApps_ROOT_DIR}/src/cameraViewDialog.cpp
${SCHNApps_ROOT_DIR}/src/pluginDialog.cpp
)
SET(SCHNApps_H_OBJECT_FILES
${SCHNApps_ROOT_DIR}/include/window.h
${SCHNApps_ROOT_DIR}/include/scene.h
${SCHNApps_ROOT_DIR}/include/view.h
${SCHNApps_ROOT_DIR}/include/viewButtonArea.h
${SCHNApps_ROOT_DIR}/include/system.h
${SCHNApps_ROOT_DIR}/include/splitArea.h
${SCHNApps_ROOT_DIR}/include/viewSelector.h
${SCHNApps_ROOT_DIR}/include/cameraViewDialog.h
${SCHNApps_ROOT_DIR}/include/pluginDialog.h
# ${SCHNApps_ROOT_DIR}/include/dialogs/newSceneDialog.h
# ${SCHNApps_ROOT_DIR}/include/dialogs/sceneSelector.h
# ${SCHNApps_ROOT_DIR}/include/dialogs/cameraViewDialog.h
# ${SCHNApps_ROOT_DIR}/include/dialogs/cameraOptionDialog.h
# ${SCHNApps_ROOT_DIR}/include/dialogs/cameraSceneDialog.h
# ${SCHNApps_ROOT_DIR}/include/dialogs/globalCameraDialog.h
......@@ -56,7 +59,9 @@ SET(SCHNApps_H_OBJECT_FILES
file(
GLOB
SCHNApps_FORM_FILES
${SCHNApps_ROOT_DIR}/forms/*.ui
${SCHNApps_ROOT_DIR}/forms/window.ui
${SCHNApps_ROOT_DIR}/forms/cameraViewDialog.ui
${SCHNApps_ROOT_DIR}/forms/pluginDialog.ui
)
QT4_WRAP_UI( UI_H_FILES
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CVDialog</class>
<widget class="QDialog" name="CVDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>258</width>
<height>352</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Chosissez une caméra courante:</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QListWidget" name="listWidget">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Liste des caméras de la vue.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Double-cliquez sur item pour changer le nom des caméras.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QToolButton" name="add_Button">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ajouter une nouvelle caméra.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>+</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="remove_Button">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Supprimer un caméra.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>-</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="settings_Button">
<property name="text">
<string>O</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="OK_Button">
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>OK_Button</sender>
<signal>clicked()</signal>
<receiver>CVDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>230</x>
<y>328</y>
</hint>
<hint type="destinationlabel">
<x>128</x>
<y>175</y>
</hint>
</hints>
</connection>
</connections>
</ui>
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<class>PluginDialog</class>
<widget class="QDialog" name="PluginDialog">
<property name="geometry">
<rect>
<x>0</x>
......@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
<string>PluginDialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
......@@ -131,7 +131,7 @@
<connection>
<sender>OKButton</sender>
<signal>pressed()</signal>
<receiver>Dialog</receiver>
<receiver>PluginDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
......@@ -145,9 +145,9 @@
</hints>
</connection>
<connection>
<sender>Dialog</sender>
<sender>PluginDialog</sender>
<signal>rejected()</signal>
<receiver>Dialog</receiver>
<receiver>PluginDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
......
......@@ -55,7 +55,7 @@
<bool>false</bool>
</attribute>
<addaction name="actionManagePlugins"/>
<addaction name="actionManageView"/>
<addaction name="actionManageViews"/>
<addaction name="actionManageCameras"/>
<addaction name="actionManageMaps"/>
</widget>
......@@ -83,7 +83,7 @@
<string>Manage plugins</string>
</property>
</action>
<action name="actionManageView">
<action name="actionManageViews">
<property name="icon">
<iconset resource="../resources/resources.qrc">
<normaloff>:/icons/icons/add_view.png</normaloff>:/icons/icons/add_view.png</iconset>
......
#ifndef _CAMERA_H_
#define _CAMERA_H_
#include "types.h"
#include "view.h"
#include "QGLViewer/camera.h"
class Window;
class View;
class Camera : public qglviewer::Camera
{
public:
static unsigned int cameraCount;
Camera(const QString& name, Window* window);
Camera(const QString& name, Window* window, const qglviewer::Camera& c);
~Camera();
void setName(QString name) { m_name = name; }
QString getName() { return m_name; }
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; }
bool isUsed() { return l_views.size() > 0; }
bool isShared() { return l_views.size() > 1; }
void draw();
......@@ -56,8 +57,6 @@ public:
// void viewShowButton(bool b);
protected:
static unsigned int cameraCount;
QString m_name;
Window* m_window;
......
#ifndef _CAMERAVIEWDIALOG_H_
#define _CAMERAVIEWDIALOG_H_
#include "ui_cameraViewDialog.h"
class View;
class Camera;
class Window;
class CameraViewDialog : public QDialog, Ui::CVDialog{
class CameraViewDialog : public QDialog, Ui::CameraViewDialog
{
Q_OBJECT
public:
CameraViewDialog(View* view, QWidget* parent=0);
CameraViewDialog(Window* window);
~CameraViewDialog();
protected:
View* view;
private:
void updateCameraList();
void updateViewList();
protected slots:
void addCamera();
void removeCamera();
void changeCurrentCamera(QListWidgetItem * current, QListWidgetItem * previous);
void cameraNameChange(QListWidgetItem * item);
void settingsCamera();
Window* m_window;
private:
bool autoText;
public slots:
void cb_addCamera();
void cb_removeCamera();
void cb_selectedViewChanged(QListWidgetItem* current, QListWidgetItem* previous);
void cb_selectedCameraChanged(QListWidgetItem* current, QListWidgetItem* previous);
};
#endif
#ifndef _CONTEXT_H_
#define _CONTEXT_H_
#include "types.h"
#include <QGLContext>
class Context : public QGLContext
{
public:
Context(const QGLFormat& format, QWidget* w);
Context(const QGLFormat& format);
void setDevice(QWidget* w);
};
......
......@@ -3,28 +3,18 @@
#include "ui_pluginDialog.h"
#include <QDir>
#include <QDomDocument>
#include <QDomElement>
#include <QDomNode>
#include <QTextStream>
#include "types.h"
class Plugin;
class Window;
class PluginDialog : public QDialog, public Ui::Dialog
class PluginDialog : public QDialog, public Ui::PluginDialog
{
Q_OBJECT
public:
PluginDialog(Window* parent = 0, PluginHash* activePlugins = NULL);
PluginDialog(Window* window);
~PluginDialog();
protected:
Window* parentWindow;
PluginHash* activePlugins;
Window* m_window;
bool restoreState();
......@@ -49,7 +39,7 @@ protected slots:
void cb_acceptDialog();
void showPluginInfo();
// void showPluginInfo();
};
#endif
#ifndef _SCENE_H_
#define _SCENE_H_
#include <QList>
#include <QString>
#include <QHash>
#include <QKeyEvent>
#include <QMouseEvent>
#include <QWheelEvent>
#include "types.h"
class Window;
class Plugin;
class View;
class Camera;
//class Context;
class ViewButton;
class QKeyEvent;
class QMouseEvent;
class QWheelEvent;
class Scene : public QObject
{
Q_OBJECT
public:
static unsigned int sceneCount;
Scene(const QString& name, Window* window);
~Scene();
......@@ -32,8 +23,8 @@ public:
Window* getWindow() { return m_window; }
void setWindow(Window* w) { m_window = w; }
QGLContext* getContext() { return m_context; }
void setContext(QGLContext* c) { m_context = c; }
Context* getContext() { return m_context; }
void setContext(Context* c) { m_context = c; }
void initGL();
void updateGL();
......@@ -76,11 +67,9 @@ public:
void firstViewFitSphere(float x, float y, float z, float radius);
protected:
static unsigned int sceneCount;
QString m_name;
Window* m_window;
QGLContext* m_context;
Context* m_context;
QList<View*> l_views;
QList<Plugin*> l_plugins;
......
......@@ -10,8 +10,8 @@
#include "types.h"
#include "ui_questionSessionDialog.h"
#include "ui_infoDialog.h"
//#include "ui_questionSessionDialog.h"
//#include "ui_infoDialog.h"
class Window;
class SplitArea;
......@@ -19,35 +19,35 @@ class SplitArea;
namespace System
{
namespace Dialog
{
class QuestionSessionDialog : public QDialog, public Ui::QSDialog
{
Q_OBJECT
public:
QuestionSessionDialog(QWidget *parent = 0) : QDialog(parent)
{
this->setupUi(this);
}
};
class InfoDialog : public QDialog, public Ui::InfoDialog
{
Q_OBJECT
public:
InfoDialog(QWidget *parent = 0) : QDialog(parent)
{
this->setupUi(this);
}
bool setContent(QUrl urlHTMLFile);
};
} // namespace Dialog
//namespace Dialog
//{
//
//class QuestionSessionDialog : public QDialog, public Ui::QSDialog
//{
// Q_OBJECT
//
//public:
// QuestionSessionDialog(QWidget *parent = 0) : QDialog(parent)
// {
// this->setupUi(this);
// }
//};
//class InfoDialog : public QDialog, public Ui::InfoDialog
//{
// Q_OBJECT
//
//public:
// InfoDialog(QWidget *parent = 0) : QDialog(parent)
// {
// this->setupUi(this);
// }
//
// bool setContent(QUrl urlHTMLFile);
//};
//
//} // namespace Dialog
class Error
{
......@@ -123,25 +123,25 @@ public:
static bool movieDialogOpened;
};
class Info
{
public:
virtual ~Info() = 0;
static void showPluginInfo(QString pluginAbsolutePath, QWidget *parent = 0);
static void showPluginInfo(QString locationPath, QString pluginName, QWidget *parent = 0);
};
class StateHandler
{
public:
virtual ~StateHandler() = 0;
static bool saveState(Window *window, PluginHash *pluginHash, SceneHash *sceneHash, SplitArea *splitArea);
static bool loadState(Window *window, PluginHash *pluginHash, SceneHash *sceneHash, SplitArea *splitArea);
static void unsaveState();
static bool savePluginsInfo(Window *window, PluginHash *pluginHash, QStringList paths);
};
//class Info
//{
//public:
// virtual ~Info() = 0;
//
// static void showPluginInfo(QString pluginAbsolutePath, QWidget *parent = 0);
// static void showPluginInfo(QString locationPath, QString pluginName, QWidget *parent = 0);
//};
//class StateHandler
//{
//public:
// virtual ~StateHandler() = 0;
//
// static bool saveState(Window *window, PluginHash *pluginHash, SceneHash *sceneHash, SplitArea *splitArea);
// static bool loadState(Window *window, PluginHash *pluginHash, SceneHash *sceneHash, SplitArea *splitArea);
// static void unsaveState();
// static bool savePluginsInfo(Window *window, PluginHash *pluginHash, QStringList paths);
//};
typedef enum
{
......
#ifndef _TYPES_H_
#define _TYPES_H_
#include <GL/glew.h>
#include <QGLViewer/qglviewer.h>
#include <QHash>
#include <QString>
class Window;
class Plugin;
class Scene;
class View;
class Camera;
class Context;
class MapHandler;
......
#ifndef _VIEW_H_
#define _VIEW_H_
#include <iostream>
#include <GL/glew.h>
#include <QGLViewer/qglviewer.h>
#include "types.h"
#include "viewButtonArea.h"
#include <QKeyEvent>
#include <QList>
#include <QWidget>
#include <QGLContext>