Commit 78546092 authored by Pierre Kraemer's avatar Pierre Kraemer

SCHNApps : bientôt une première version..

parent 90c61bbf
...@@ -8,12 +8,14 @@ SET( QT_USE_QTDESIGNER TRUE ) ...@@ -8,12 +8,14 @@ SET( QT_USE_QTDESIGNER TRUE )
SET( QT_USE_QTGUI TRUE ) SET( QT_USE_QTGUI TRUE )
SET( QT_USE_QTPLUGIN TRUE ) SET( QT_USE_QTPLUGIN TRUE )
#========CGoGN========# #========CGoGN========#
SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/.. CACHE STRING "CGoGN root dir") SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/.. CACHE STRING "CGoGN root dir")
INCLUDE(${CGoGN_ROOT_DIR}/apps_cmake.txt) INCLUDE(${CGoGN_ROOT_DIR}/apps_cmake.txt)
find_package(Qt4 REQUIRED) find_package(Qt4 REQUIRED)
#=======QGLViewer=========# #=======QGLViewer=========#
find_package(QGLViewer REQUIRED) find_package(QGLViewer REQUIRED)
......
...@@ -20,28 +20,35 @@ INCLUDE_DIRECTORIES( ...@@ -20,28 +20,35 @@ INCLUDE_DIRECTORIES(
file( file(
GLOB GLOB
SCHNApps_SRC_FILES SCHNApps_SRC_FILES
${SCHNApps_ROOT_DIR}/src/camera.cpp
${SCHNApps_ROOT_DIR}/src/context.cpp
${SCHNApps_ROOT_DIR}/src/main.cpp ${SCHNApps_ROOT_DIR}/src/main.cpp
${SCHNApps_ROOT_DIR}/src/interface/*.cpp ${SCHNApps_ROOT_DIR}/src/mapHandler.cpp
${SCHNApps_ROOT_DIR}/src/visualization/*.cpp ${SCHNApps_ROOT_DIR}/src/plugin.cpp
${SCHNApps_ROOT_DIR}/src/dialogs/*.cpp ${SCHNApps_ROOT_DIR}/src/scene.cpp
${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
) )
SET(SCHNApps_H_OBJECT_FILES SET(SCHNApps_H_OBJECT_FILES
${SCHNApps_ROOT_DIR}/include/interface/window.h ${SCHNApps_ROOT_DIR}/include/window.h
${SCHNApps_ROOT_DIR}/include/interface/system.h ${SCHNApps_ROOT_DIR}/include/scene.h
${SCHNApps_ROOT_DIR}/include/interface/viewButtonArea.h ${SCHNApps_ROOT_DIR}/include/view.h
${SCHNApps_ROOT_DIR}/include/interface/splitArea.h ${SCHNApps_ROOT_DIR}/include/viewButtonArea.h
${SCHNApps_ROOT_DIR}/include/visualization/view.h ${SCHNApps_ROOT_DIR}/include/system.h
${SCHNApps_ROOT_DIR}/include/visualization/scene.h ${SCHNApps_ROOT_DIR}/include/splitArea.h
${SCHNApps_ROOT_DIR}/include/dialogs/newSceneDialog.h # ${SCHNApps_ROOT_DIR}/include/dialogs/newSceneDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/sceneSelector.h # ${SCHNApps_ROOT_DIR}/include/dialogs/sceneSelector.h
${SCHNApps_ROOT_DIR}/include/dialogs/cameraViewDialog.h # ${SCHNApps_ROOT_DIR}/include/dialogs/cameraViewDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/cameraOptionDialog.h # ${SCHNApps_ROOT_DIR}/include/dialogs/cameraOptionDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/cameraSceneDialog.h # ${SCHNApps_ROOT_DIR}/include/dialogs/cameraSceneDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/globalCameraDialog.h # ${SCHNApps_ROOT_DIR}/include/dialogs/globalCameraDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/pluginDialog.h # ${SCHNApps_ROOT_DIR}/include/dialogs/pluginDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/linkViewDialog.h # ${SCHNApps_ROOT_DIR}/include/dialogs/linkViewDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/mapPluginDialog.h # ${SCHNApps_ROOT_DIR}/include/dialogs/mapPluginDialog.h
) )
file( file(
...@@ -74,4 +81,4 @@ TARGET_LINK_LIBRARIES( SCHNAppsD ...@@ -74,4 +81,4 @@ TARGET_LINK_LIBRARIES( SCHNAppsD
) )
ADD_SUBDIRECTORY(${SCHNApps_ROOT_DIR}/Plugins PluginsD) #ADD_SUBDIRECTORY(${SCHNApps_ROOT_DIR}/Plugins PluginsD)
...@@ -22,28 +22,35 @@ INCLUDE_DIRECTORIES( ...@@ -22,28 +22,35 @@ INCLUDE_DIRECTORIES(
file( file(
GLOB GLOB
SCHNApps_SRC_FILES SCHNApps_SRC_FILES
${SCHNApps_ROOT_DIR}/src/camera.cpp
${SCHNApps_ROOT_DIR}/src/context.cpp
${SCHNApps_ROOT_DIR}/src/main.cpp ${SCHNApps_ROOT_DIR}/src/main.cpp
${SCHNApps_ROOT_DIR}/src/interface/*.cpp ${SCHNApps_ROOT_DIR}/src/mapHandler.cpp
${SCHNApps_ROOT_DIR}/src/visualization/*.cpp ${SCHNApps_ROOT_DIR}/src/plugin.cpp
${SCHNApps_ROOT_DIR}/src/dialogs/*.cpp ${SCHNApps_ROOT_DIR}/src/scene.cpp
${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
) )
SET(SCHNApps_H_OBJECT_FILES SET(SCHNApps_H_OBJECT_FILES
${SCHNApps_ROOT_DIR}/include/interface/window.h ${SCHNApps_ROOT_DIR}/include/window.h
${SCHNApps_ROOT_DIR}/include/interface/system.h ${SCHNApps_ROOT_DIR}/include/scene.h
${SCHNApps_ROOT_DIR}/include/interface/viewButtonArea.h ${SCHNApps_ROOT_DIR}/include/view.h
${SCHNApps_ROOT_DIR}/include/interface/splitArea.h ${SCHNApps_ROOT_DIR}/include/viewButtonArea.h
${SCHNApps_ROOT_DIR}/include/visualization/view.h ${SCHNApps_ROOT_DIR}/include/system.h
${SCHNApps_ROOT_DIR}/include/visualization/scene.h ${SCHNApps_ROOT_DIR}/include/splitArea.h
${SCHNApps_ROOT_DIR}/include/dialogs/newSceneDialog.h # ${SCHNApps_ROOT_DIR}/include/dialogs/newSceneDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/sceneSelector.h # ${SCHNApps_ROOT_DIR}/include/dialogs/sceneSelector.h
${SCHNApps_ROOT_DIR}/include/dialogs/cameraViewDialog.h # ${SCHNApps_ROOT_DIR}/include/dialogs/cameraViewDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/cameraOptionDialog.h # ${SCHNApps_ROOT_DIR}/include/dialogs/cameraOptionDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/cameraSceneDialog.h # ${SCHNApps_ROOT_DIR}/include/dialogs/cameraSceneDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/globalCameraDialog.h # ${SCHNApps_ROOT_DIR}/include/dialogs/globalCameraDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/pluginDialog.h # ${SCHNApps_ROOT_DIR}/include/dialogs/pluginDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/linkViewDialog.h # ${SCHNApps_ROOT_DIR}/include/dialogs/linkViewDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/mapPluginDialog.h # ${SCHNApps_ROOT_DIR}/include/dialogs/mapPluginDialog.h
) )
file( file(
...@@ -76,4 +83,4 @@ TARGET_LINK_LIBRARIES( SCHNApps ...@@ -76,4 +83,4 @@ TARGET_LINK_LIBRARIES( SCHNApps
) )
ADD_SUBDIRECTORY(${SCHNApps_ROOT_DIR}/Plugins Plugins) #ADD_SUBDIRECTORY(${SCHNApps_ROOT_DIR}/Plugins Plugins)
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>CGoGN Plug</string> <string>SCHNApps</string>
</property> </property>
<property name="windowIcon"> <property name="windowIcon">
<iconset resource="../resources/resources.qrc"> <iconset resource="../resources/resources.qrc">
...@@ -24,39 +24,23 @@ ...@@ -24,39 +24,23 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>785</width> <width>785</width>
<height>29</height> <height>23</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuFichier"> <widget class="QMenu" name="menuFile">
<property name="title"> <property name="title">
<string>Fichier</string> <string>File</string>
</property> </property>
<addaction name="actionQuitter"/> <addaction name="actionQuit"/>
</widget> </widget>
<widget class="QMenu" name="menuHelp"> <widget class="QMenu" name="menuHelp">
<property name="title"> <property name="title">
<string>Help</string> <string>Help</string>
</property> </property>
<addaction name="actionAbout_CGoGN"/> <addaction name="actionAboutSCHNApps"/>
<addaction name="actionAbout"/> <addaction name="actionAboutCGoGN"/>
</widget> </widget>
<widget class="QMenu" name="menuPlugins"> <addaction name="menuFile"/>
<property name="title">
<string>Plugins</string>
</property>
<addaction name="actionPlugins"/>
</widget>
<widget class="QMenu" name="menuViews">
<property name="title">
<string>Visu</string>
</property>
<addaction name="actionNew_Scene"/>
<addaction name="actionGlobalCamera"/>
<addaction name="actionLinkPluginMap"/>
</widget>
<addaction name="menuFichier"/>
<addaction name="menuViews"/>
<addaction name="menuPlugins"/>
<addaction name="menuHelp"/> <addaction name="menuHelp"/>
</widget> </widget>
<widget class="QStatusBar" name="statusbar"/> <widget class="QStatusBar" name="statusbar"/>
...@@ -65,71 +49,65 @@ ...@@ -65,71 +49,65 @@
<string>toolBar</string> <string>toolBar</string>
</property> </property>
<attribute name="toolBarArea"> <attribute name="toolBarArea">
<enum>TopToolBarArea</enum> <enum>LeftToolBarArea</enum>
</attribute> </attribute>
<attribute name="toolBarBreak"> <attribute name="toolBarBreak">
<bool>false</bool> <bool>false</bool>
</attribute> </attribute>
<addaction name="actionNew_Scene"/> <addaction name="actionManagePlugins"/>
<addaction name="actionPlugins"/> <addaction name="actionManageView"/>
<addaction name="actionGlobalCamera"/> <addaction name="actionManageCameras"/>
<addaction name="actionLinkPluginMap"/> <addaction name="actionManageMaps"/>
</widget> </widget>
<action name="actionAbout_CGoGN"> <action name="actionAboutCGoGN">
<property name="text"> <property name="text">
<string>About CGoGN ...</string> <string>About CGoGN</string>
</property> </property>
</action> </action>
<action name="actionAbout"> <action name="actionAboutSCHNApps">
<property name="text"> <property name="text">
<string>About ...</string> <string>About SCHNApps</string>
</property> </property>
</action> </action>
<action name="actionQuitter"> <action name="actionQuit">
<property name="text"> <property name="text">
<string>Quitter</string> <string>Quit</string>
</property> </property>
</action> </action>
<action name="actionPlugins"> <action name="actionManagePlugins">
<property name="icon"> <property name="icon">
<iconset resource="../resources/resources.qrc"> <iconset resource="../resources/resources.qrc">
<normaloff>:/icons/icons/plugins.png</normaloff>:/icons/icons/plugins.png</iconset> <normaloff>:/icons/icons/plugins.png</normaloff>:/icons/icons/plugins.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Plugins ...</string> <string>Manage plugins</string>
</property> </property>
</action> </action>
<action name="actionNew_Scene"> <action name="actionManageView">
<property name="icon"> <property name="icon">
<iconset resource="../resources/resources.qrc"> <iconset resource="../resources/resources.qrc">
<normaloff>:/icons/icons/add_view.png</normaloff>:/icons/icons/add_view.png</iconset> <normaloff>:/icons/icons/add_view.png</normaloff>:/icons/icons/add_view.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Ajouter nouvelle scène ...</string> <string>Add view</string>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Adds a new empty view.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
</action> </action>
<action name="actionGlobalCamera"> <action name="actionManageCameras">
<property name="icon"> <property name="icon">
<iconset resource="../resources/resources.qrc"> <iconset resource="../resources/resources.qrc">
<normaloff>:/icons/icons/camera_b.png</normaloff>:/icons/icons/camera_b.png</iconset> <normaloff>:/icons/icons/camera_b.png</normaloff>:/icons/icons/camera_b.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Gestion des caméras ...</string> <string>Manage cameras</string>
</property>
<property name="toolTip">
<string>Gestion des caméras</string>
</property> </property>
</action> </action>
<action name="actionLinkPluginMap"> <action name="actionManageMaps">
<property name="icon"> <property name="icon">
<iconset resource="../resources/resources.qrc"> <iconset resource="../resources/resources.qrc">
<normaloff>:/icons/icons/map_plugin.png</normaloff>:/icons/icons/map_plugin.png</iconset> <normaloff>:/icons/icons/map_plugin.png</normaloff>:/icons/icons/map_plugin.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Lier plugins et maps</string> <string>Manage CGoGN maps</string>
</property> </property>
</action> </action>
</widget> </widget>
...@@ -138,7 +116,7 @@ ...@@ -138,7 +116,7 @@
</resources> </resources>
<connections> <connections>
<connection> <connection>
<sender>actionQuitter</sender> <sender>actionQuit</sender>
<signal>triggered()</signal> <signal>triggered()</signal>
<receiver>Window</receiver> <receiver>Window</receiver>
<slot>close()</slot> <slot>close()</slot>
......
#ifndef _CAMERA_H_ #ifndef _CAMERA_H_
#define _CAMERA_H_ #define _CAMERA_H_
#include "view.h" #include "types.h"
#include "QGLViewer/camera.h"
//forward declaration class Window;
class View;
class Camera : public qglviewer::Camera class Camera : public qglviewer::Camera
{ {
public: public:
Camera(Window* window, View* v); Camera(const QString& name, Window* window);
Camera(Window* window, View* v, const qglviewer::Camera& c); Camera(const QString& name, Window* window, const qglviewer::Camera& c);
~Camera(); ~Camera();
void setName(QString name) { m_name = name; } void setName(QString name) { m_name = name; }
...@@ -51,13 +53,14 @@ public: ...@@ -51,13 +53,14 @@ public:
void updateGL(); void updateGL();
void viewShowButton(bool b); // void viewShowButton(bool b);
protected: protected:
static unsigned int cameraCount; static unsigned int cameraCount;
QString m_name; QString m_name;
Window* m_window; Window* m_window;
QList<View*> l_views; QList<View*> l_views;
bool m_draw; bool m_draw;
......
#ifndef _VIZUHANDLER_H_ #ifndef _MAPHANDLER_H_
#define _VIZUHANDLER_H_ #define _MAPHANDLER_H_
#include <QHash> #include <QString>
#include "types.h"
namespace CGoGN namespace CGoGN
{ {
...@@ -12,36 +13,30 @@ namespace CGoGN ...@@ -12,36 +13,30 @@ namespace CGoGN
} }
} }
class VBOHandler;
class MapHandler class MapHandler
{ {
public: public:
MapHandler(CGoGN::GenericMap *map); MapHandler(const QString& name, CGoGN::GenericMap* map);
~MapHandler(); ~MapHandler();
CGoGN::GenericMap *map() const QString& getName() { return m_name; }
{ void setName(const QString& name) { m_name = name; }
return m_map;
}
VBOHandler* findVBO(QString name); CGoGN::GenericMap* getMap() { return m_map; }
VBOHandler* findFirstVBOMatching(QRegExp regexp);
QList<VBOHandler*> findVBOsMatching(QRegExp regexp);
bool addVBO(VBOHandler* vboH); CGoGN::Utils::VBO* addVBO(const QString& name);
VBOHandler* addNewVBO(QString vboName); void removeVBO(const QString& name);
CGoGN::Utils::VBO* getVBO(const QString& name);
CGoGN::Utils::VBO* findFirstVBOMatching(const QRegExp& regexp);
QList<CGoGN::Utils::VBO*> findVBOsMatching(const QRegExp& regexp);
VBOHandler* takeVBO(VBOHandler* vbo); int getNbVBO() { return h_vbo.count(); }
int countVBO()
{
return l_vbo.count();
}
protected: protected:
QString m_name;
CGoGN::GenericMap* m_map; CGoGN::GenericMap* m_map;
QList<VBOHandler*> l_vbo;
VBOHash h_vbo;
}; };
#endif #endif
...@@ -11,13 +11,11 @@ ...@@ -11,13 +11,11 @@
#include "types.h" #include "types.h"
//forward declarations
class View;
class Window; class Window;
class Camera;
class Plugin; class Plugin;
class VBOHandler; class View;
class Context; class Camera;
//class Context;
class ViewButton; class ViewButton;
class Scene : public QObject class Scene : public QObject
...@@ -34,8 +32,8 @@ public: ...@@ -34,8 +32,8 @@ public:
Window* getWindow() { return m_window; } Window* getWindow() { return m_window; }
void setWindow(Window* w) { m_window = w; } void setWindow(Window* w) { m_window = w; }
Context* getContext() { return m_context; } QGLContext* getContext() { return m_context; }
void setContext(Context* c) { m_context = c; } void setContext(QGLContext* c) { m_context = c; }
void initGL(); void initGL();
void updateGL(); void updateGL();
...@@ -53,7 +51,7 @@ public: ...@@ -53,7 +51,7 @@ public:
*********************************************************/ *********************************************************/
void linkView(View* view); void linkView(View* view);
void unlinkView(View* view); void unlinkView(View* view);
View* getLinkedView(unsigned int num); View* getLinkedView(int num);
QList<View*> getLinkedViews() { return l_views; } QList<View*> getLinkedViews() { return l_views; }
int getNbLinkedViews() { return l_views.size(); } int getNbLinkedViews() { return l_views.size(); }
...@@ -78,9 +76,11 @@ public: ...@@ -78,9 +76,11 @@ public:
void firstViewFitSphere(float x, float y, float z, float radius); void firstViewFitSphere(float x, float y, float z, float radius);
protected: protected:
static unsigned int sceneCount;
QString m_name; QString m_name;
Window* m_window; Window* m_window;
Context* m_context; QGLContext* m_context;
QList<View*> l_views; QList<View*> l_views;
QList<Plugin*> l_plugins; QList<Plugin*> l_plugins;
......
...@@ -3,10 +3,14 @@ ...@@ -3,10 +3,14 @@
#include <QSplitter> #include <QSplitter>
class SplitArea : public QSplitter{ class SplitArea : public QSplitter
{
Q_OBJECT Q_OBJECT
public: public:
SplitArea(QWidget* parent=0); SplitArea(QWidget* parent = NULL);
int getNbRows() { return nbRows; }
void addFitElement(QWidget* element); void addFitElement(QWidget* element);
void addElementAt(QWidget* element, int x, int y); void addElementAt(QWidget* element, int x, int y);
...@@ -14,24 +18,21 @@ public: ...@@ -14,24 +18,21 @@ public:
void addElementRightTo(QWidget* element, QWidget* left); void addElementRightTo(QWidget* element, QWidget* left);
bool isEmpty(); bool isEmpty();
int getNbRow(){return nbRow;}
void updateSize(); void updateSize();
protected: protected:
int nbRow, nbMaxColumn; int nbRows;
int maxNbColumns;
int rowMin; int rowMin;
int nbElement; int nbElements;
protected slots: protected slots:
void elementRemoved(); void elementRemoved();
private: private:
bool sizeUpdated; bool sizeUpdated;
void determineRowMin(); void determineRowMin();
}; };
#endif #endif
...@@ -56,11 +56,37 @@ public: ...@@ -56,11 +56,37 @@ public:
typedef enum typedef enum
{ {
SUCCESS, NO_SCENE, SCENE_UNREFERENCED, SCENE_EXISTS, NO_DOCK, NO_PLUGIN_PATH_FILE, SUCCESS,
ERROR_OPEN_PLUGIN_FILE , BAD_PLUGIN_PATH_FILE, BAD_PLUGIN_PATH_IN_FILE, NO_PLUGIN_IN_DIR, NO_SCENE,
PLUGIN_EXISTS, ERROR_PLUGIN_LOAD, BAD_LINK_PLUGIN_WINDOW, UNSATSIFIED_PLUGIN_DEPENDENCIE, SCENE_EXISTS,
BAD_ACTION_MENU_PATH, MAP_UNREFERENCED, MAP_EXISTS, SHADER_EXISTS, SHADER_NOT_FOUND,