Commit 16ece449 authored by Pierre Kraemer's avatar Pierre Kraemer

SCHNApps : reorganize compilation and inclusion / no plugin available yet

parent 89373f2c
......@@ -3,9 +3,9 @@ cmake_minimum_required(VERSION 2.8)
project(SCHNApps)
SET( QT_USE_QTXML TRUE )
SET (QT_USE_QTDESIGNER TRUE)
SET (QT_USE_QTGUI TRUE)
SET(QT_USE_QTPLUGIN TRUE)
SET( QT_USE_QTDESIGNER TRUE )
SET( QT_USE_QTGUI TRUE )
SET( QT_USE_QTPLUGIN TRUE )
#========CGoGN========#
SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/.. CACHE STRING "CGoGN root dir")
......@@ -16,14 +16,8 @@ INCLUDE(${CGoGN_ROOT_DIR}/apps_cmake.txt)
find_package(QGLViewer REQUIRED)
#======Directories=======#
SET(INC_DIR ${CMAKE_SOURCE_DIR}/include)
SET(SRC_DIR ${CMAKE_SOURCE_DIR}/src)
SET(FORMS_DIR ${CMAKE_SOURCE_DIR}/forms)
SET(RESOURCES_DIR ${CMAKE_SOURCE_DIR}/resources)
SET(PLUGIN_DIR ${CMAKE_SOURCE_DIR}/Plugins)
SET(PLUGIN_COMPILE_DIR ${EXECUTABLE_OUTPUT_PATH}/plugins)
#======SCHNApps=======#
SET(SCHNApps_ROOT_DIR ${CGoGN_ROOT_DIR}/SCHNApps)
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/Release Release)
IF (NOT WIN32)
......@@ -33,6 +27,10 @@ ENDIF (NOT WIN32)
configure_file(${CMAKE_SOURCE_DIR}/settings/state_save.xml ${EXECUTABLE_OUTPUT_PATH}/state_save.xml @ONLY)
#======Plugins=======#
#ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/Plugins)
#======Documentation=======#
find_package(Doxygen)
if(DOXYGEN_FOUND)
......
......@@ -14,95 +14,61 @@ INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${QGLVIEWER_INCLUDE_DIR}
${SCHNApps_ROOT_DIR}/include
)
SET(SRC_FILES
${SRC_DIR}/main.cpp
${SRC_DIR}/interface/window.cpp
${SRC_DIR}/interface/system.cpp
${SRC_DIR}/interface/stateHandler.cpp
${SRC_DIR}/visualization/view.cpp
${SRC_DIR}/visualization/scene.cpp
${SRC_DIR}/visualization/camera.cpp
${SRC_DIR}/interface/splitArea.cpp
${SRC_DIR}/dialogs/newSceneDialog.cpp
${SRC_DIR}/dialogs/sceneSelector.cpp
${SRC_DIR}/interface/viewButtonArea.cpp
${SRC_DIR}/dialogs/cameraViewDialog.cpp
${SRC_DIR}/dialogs/cameraOptionDialog.cpp
${SRC_DIR}/dialogs/cameraSceneDialog.cpp
${SRC_DIR}/dialogs/globalCameraDialog.cpp
${SRC_DIR}/dialogs/pluginDialog.cpp
${SRC_DIR}/dialogs/linkViewDialog.cpp
${SRC_DIR}/visualization/vboHandler.cpp
${SRC_DIR}/visualization/mapHandler.cpp
${SRC_DIR}/visualization/context.cpp
${SRC_DIR}/dialogs/mapPluginDialog.cpp
file(
GLOB
SCHNApps_SRC_FILES
${SCHNApps_ROOT_DIR}/src/main.cpp
${SCHNApps_ROOT_DIR}/src/interface/*.cpp
${SCHNApps_ROOT_DIR}/src/visualization/*.cpp
${SCHNApps_ROOT_DIR}/src/dialogs/*.cpp
)
SET(H_OBJECT_FILES
${INC_DIR}/interface/window.h
${INC_DIR}/interface/system.h
${INC_DIR}/visualization/view.h
${INC_DIR}/visualization/scene.h
${INC_DIR}/interface/splitArea.h
${INC_DIR}/dialogs/newSceneDialog.h
${INC_DIR}/dialogs/sceneSelector.h
${INC_DIR}/interface/viewButtonArea.h
${INC_DIR}/dialogs/cameraViewDialog.h
${INC_DIR}/dialogs/cameraOptionDialog.h
${INC_DIR}/dialogs/cameraSceneDialog.h
${INC_DIR}/dialogs/globalCameraDialog.h
${INC_DIR}/dialogs/pluginDialog.h
${INC_DIR}/dialogs/linkViewDialog.h
${INC_DIR}/dialogs/mapPluginDialog.h
SET(SCHNApps_H_OBJECT_FILES
${SCHNApps_ROOT_DIR}/include/interface/window.h
${SCHNApps_ROOT_DIR}/include/interface/system.h
${SCHNApps_ROOT_DIR}/include/interface/viewButtonArea.h
${SCHNApps_ROOT_DIR}/include/interface/splitArea.h
${SCHNApps_ROOT_DIR}/include/visualization/view.h
${SCHNApps_ROOT_DIR}/include/visualization/scene.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
${SCHNApps_ROOT_DIR}/include/dialogs/pluginDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/linkViewDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/mapPluginDialog.h
)
SET(FORMS_FILES
${FORMS_DIR}/window.ui
${FORMS_DIR}/questionSessionDialog.ui
${FORMS_DIR}/infoDialog.ui
${FORMS_DIR}/newSceneDialog.ui
${FORMS_DIR}/cameraViewDialog.ui
${FORMS_DIR}/cameraOptionDialog.ui
${FORMS_DIR}/cameraSceneDialog.ui
${FORMS_DIR}/globalCameraDialog.ui
${FORMS_DIR}/pluginDialog.ui
${FORMS_DIR}/linkViewDialog.ui
${FORMS_DIR}/mapPluginDialog.ui
file(
GLOB
SCHNApps_FORM_FILES
${SCHNApps_ROOT_DIR}/forms/*.ui
)
QT4_WRAP_UI(UI_H_FILES
${FORMS_FILES}
QT4_WRAP_UI( UI_H_FILES
${SCHNApps_FORM_FILES}
)
QT4_WRAP_CPP(MOC_FILES
${H_OBJECT_FILES}
QT4_WRAP_CPP( MOC_FILES
${SCHNApps_H_OBJECT_FILES}
)
QT4_ADD_RESOURCES(RCC_FILES
${RESOURCES_DIR}/resources.qrc
QT4_ADD_RESOURCES( RCC_FILES
${SCHNApps_ROOT_DIR}/resources/resources.qrc
)
INCLUDE_DIRECTORIES(
${FORMS}
${INC_DIR}
${INC_DIR}/interface
${INC_DIR}/visualization
${INC_DIR}/dialogs
${INC_DIR}/plugins
)
ADD_EXECUTABLE(CGoGN_plugD
${SRC_FILES}
ADD_EXECUTABLE( SCHNappsD
${SCHNApps_SRC_FILES}
${UI_H_FILES}
${MOC_FILES}
${RCC_FILES}
)
TARGET_LINK_LIBRARIES(CGoGN_plugD
TARGET_LINK_LIBRARIES( SCHNappsD
${CGoGN_LIBS_D}
${COMMON_LIBS}
${QGLVIEWER_LIBRARIES}
)
#ADD_SUBDIRECTORY(${PLUGIN_DIR} plugins)
......@@ -16,95 +16,61 @@ INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${QGLVIEWER_INCLUDE_DIR}
${SCHNApps_ROOT_DIR}/include
)
SET(SRC_FILES
${SRC_DIR}/main.cpp
${SRC_DIR}/interface/window.cpp
${SRC_DIR}/interface/system.cpp
${SRC_DIR}/interface/stateHandler.cpp
${SRC_DIR}/visualization/view.cpp
${SRC_DIR}/visualization/scene.cpp
${SRC_DIR}/visualization/camera.cpp
${SRC_DIR}/interface/splitArea.cpp
${SRC_DIR}/dialogs/newSceneDialog.cpp
${SRC_DIR}/dialogs/sceneSelector.cpp
${SRC_DIR}/interface/viewButtonArea.cpp
${SRC_DIR}/dialogs/cameraViewDialog.cpp
${SRC_DIR}/dialogs/cameraOptionDialog.cpp
${SRC_DIR}/dialogs/cameraSceneDialog.cpp
${SRC_DIR}/dialogs/globalCameraDialog.cpp
${SRC_DIR}/dialogs/pluginDialog.cpp
${SRC_DIR}/dialogs/linkViewDialog.cpp
${SRC_DIR}/visualization/vboHandler.cpp
${SRC_DIR}/visualization/mapHandler.cpp
${SRC_DIR}/visualization/context.cpp
${SRC_DIR}/dialogs/mapPluginDialog.cpp
file(
GLOB
SCHNApps_SRC_FILES
${SCHNApps_ROOT_DIR}/src/main.cpp
${SCHNApps_ROOT_DIR}/src/interface/*.cpp
${SCHNApps_ROOT_DIR}/src/visualization/*.cpp
${SCHNApps_ROOT_DIR}/src/dialogs/*.cpp
)
SET(H_OBJECT_FILES
${INC_DIR}/interface/window.h
${INC_DIR}/interface/system.h
${INC_DIR}/visualization/view.h
${INC_DIR}/visualization/scene.h
${INC_DIR}/interface/splitArea.h
${INC_DIR}/dialogs/newSceneDialog.h
${INC_DIR}/dialogs/sceneSelector.h
${INC_DIR}/interface/viewButtonArea.h
${INC_DIR}/dialogs/cameraViewDialog.h
${INC_DIR}/dialogs/cameraOptionDialog.h
${INC_DIR}/dialogs/cameraSceneDialog.h
${INC_DIR}/dialogs/globalCameraDialog.h
${INC_DIR}/dialogs/pluginDialog.h
${INC_DIR}/dialogs/linkViewDialog.h
${INC_DIR}/dialogs/mapPluginDialog.h
SET(SCHNApps_H_OBJECT_FILES
${SCHNApps_ROOT_DIR}/include/interface/window.h
${SCHNApps_ROOT_DIR}/include/interface/system.h
${SCHNApps_ROOT_DIR}/include/interface/viewButtonArea.h
${SCHNApps_ROOT_DIR}/include/interface/splitArea.h
${SCHNApps_ROOT_DIR}/include/visualization/view.h
${SCHNApps_ROOT_DIR}/include/visualization/scene.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
${SCHNApps_ROOT_DIR}/include/dialogs/pluginDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/linkViewDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/mapPluginDialog.h
)
SET(FORMS_FILES
${FORMS_DIR}/window.ui
${FORMS_DIR}/questionSessionDialog.ui
${FORMS_DIR}/infoDialog.ui
${FORMS_DIR}/newSceneDialog.ui
${FORMS_DIR}/cameraViewDialog.ui
${FORMS_DIR}/cameraOptionDialog.ui
${FORMS_DIR}/cameraSceneDialog.ui
${FORMS_DIR}/globalCameraDialog.ui
${FORMS_DIR}/pluginDialog.ui
${FORMS_DIR}/linkViewDialog.ui
${FORMS_DIR}/mapPluginDialog.ui
file(
GLOB
SCHNApps_FORM_FILES
${SCHNApps_ROOT_DIR}/forms/*.ui
)
QT4_WRAP_UI(UI_H_FILES
${FORMS_FILES}
QT4_WRAP_UI( UI_H_FILES
${SCHNApps_FORM_FILES}
)
QT4_WRAP_CPP(MOC_FILES
${H_OBJECT_FILES}
QT4_WRAP_CPP( MOC_FILES
${SCHNApps_H_OBJECT_FILES}
)
QT4_ADD_RESOURCES(RCC_FILES
${RESOURCES_DIR}/resources.qrc
QT4_ADD_RESOURCES( RCC_FILES
${SCHNApps_ROOT_DIR}/resources/resources.qrc
)
INCLUDE_DIRECTORIES(
${FORMS}
${INC_DIR}
${INC_DIR}/interface
${INC_DIR}/visualization
${INC_DIR}/dialogs
${INC_DIR}/plugins
)
ADD_EXECUTABLE(CGoGN_plug
${SRC_FILES}
ADD_EXECUTABLE( SCHNapps
${SCHNApps_SRC_FILES}
${UI_H_FILES}
${MOC_FILES}
${RCC_FILES}
)
TARGET_LINK_LIBRARIES(CGoGN_plug
TARGET_LINK_LIBRARIES( SCHNapps
${CGoGN_LIBS_R}
${COMMON_LIBS}
${QGLVIEWER_LIBRARIES}
)
#ADD_SUBDIRECTORY(${PLUGIN_DIR} plugins)
#ifndef _GLOBALCAMERADIALOG_H_
#define _GLOBALCAMERADIALOG_H_
#include "ui_globalCameraDialog.h"
#include <QListWidget>
#include <QTreeWidget>
#include <QVariant>
#include <QMenu>
#include "camera.h"
#include "view.h"
#include "visualization/camera.h"
#include "visualization/view.h"
class Window;
......
#ifndef _NEWSCENEDIALOG_H_
#define _NEWSCENEDIALOG_H_
#include "ui_newSceneDialog.h"
#include <QListWidget>
namespace myListCameraTypes{
enum type {view, camera,scene};
}
class Window;
class NewSceneDialog : public QDialog, Ui::NSDialog{
......
......@@ -11,7 +11,6 @@
#include "types.h"
class Plugin;
class Window;
......
#ifndef _SCENESELECTOR_H_
#define _SCENESELECTOR_H_
#include "view.h"
#include "visualization/view.h"
#include <QDialog>
#include <QRect>
class SplitArea;
struct PixElem{
struct PixElem
{
View* view;
QRect rect;
QColor color;
......@@ -30,12 +28,12 @@ struct PixElem{
};
class ViewPixMaps : public QList<QList<PixElem> >{
class ViewPixMaps : public QList<QList<PixElem> >
{
public:
typedef ViewPixMaps::iterator y_iterator;
typedef QList<PixElem>::iterator x_iterator;
ViewPixMaps();
~ViewPixMaps();
......@@ -53,7 +51,6 @@ public:
x_iterator x_begin(y_iterator y_it){return y_it->begin();}
x_iterator x_end(y_iterator y_it){return y_it->end();}
void beginMove(int x, int y);
void moveTmp(int x, int y);
void confirmMove();
......@@ -80,7 +77,8 @@ protected:
void computeSize();
};
class ViewSelector : public QDialog {
class ViewSelector : public QDialog
{
Q_OBJECT
public:
enum SelectorDialogType {MOVE,SELECT};
......@@ -98,7 +96,6 @@ public:
bool keys[3];
protected:
ViewPixMaps viewPixMap;
......@@ -124,6 +121,4 @@ private:
QPoint mouseToIndice();
};
#endif
......@@ -4,7 +4,6 @@
#include <QWidget>
#include <QSplashScreen>
#include <unistd.h>
#include <stdarg.h>
#include <iostream>
......@@ -14,7 +13,6 @@
#include "ui_questionSessionDialog.h"
#include "ui_infoDialog.h"
class Window;
class SplitArea;
......@@ -53,8 +51,6 @@ namespace System{
static ERROR_CODE code;
static ERROR_CODE BAD_PLUGIN_PATH_IN_FILE_f(QString file);
static ERROR_CODE NO_PLUGIN_IN_DIR_f(QString dir);
static ERROR_CODE PLUGIN_EXISTS_f(QString plugin);
......@@ -73,7 +69,6 @@ namespace System{
static ERROR_CODE OPEN_FILE_ERROR_f(QString filepath);
static ERROR_CODE BAD_XML_FILE_f(QString filepath);
static void showError(QWidget* parent=0);
};
......@@ -102,14 +97,11 @@ namespace System{
static bool savePluginsInfo(Window* window, PluginHash* pluginHash, QStringList paths);
};
typedef enum{GLVIEWER_IN_DOCK, SIMPLE_GLVIEWER} QGLV_CREATE_SETTINGS;
extern QString app_path;
extern QSplashScreen* splash;
}
#endif
#ifndef _WINDOW_H_
#define _WINDOW_H_
#include "ui_window.h"
#include <QVBoxLayout>
#include "mapHandler.h"
#include "Topology/generic/genericmap.h"
#include "types.h"
#include "splitArea.h"
#include "system.h"
#include "visualization/mapHandler.h"
#include "interface/splitArea.h"
#include "interface/system.h"
class Scene;
class View;
......@@ -24,7 +18,6 @@ class Plugin;
class Context;
class MapHandler;
class Window : public QMainWindow, Ui::Window{
Q_OBJECT
public:
......
......@@ -7,15 +7,16 @@
#include <iostream>
#include <list>
#include "window.h"
#include "view.h"
#include "camera.h"
#include "system.h"
#include "mapHandler.h"
#include "vboHandler.h"
#include "scene.h"
class Plugin{
#include "interface/window.h"
#include "interface/system.h"
#include "visualization/view.h"
#include "visualization/camera.h"
#include "visualization/mapHandler.h"
#include "visualization/vboHandler.h"
#include "visualization/scene.h"
class Plugin
{
public:
enum {UNLIMITED_MAP_NUMBER=-1};
......
#ifndef _SIMPLEPLUGIN_H_
#define _SIMPLEPLUGIN_H_
#include "plugin.h"
#include "plugins/plugin.h"
class SimplePlugin : public QObject, public Plugin{
class SimplePlugin : public QObject, public Plugin
{
Q_OBJECT
public:
SimplePlugin();
......
#ifndef _VISUALPLUGIN_H_
#define _VISUALPLUGIN_H_
#include "plugin.h"
#include "plugins/plugin.h"
class VisualPlugin : public QObject, public Plugin{
class VisualPlugin : public QObject, public Plugin
{
Q_OBJECT
public:
VisualPlugin();
......
#ifndef _TYPES_H_
#define _TYPES_H_
#include <GL/glew.h>
#include <QGLViewer/qglviewer.h>
......@@ -45,5 +44,4 @@ namespace Qt{
extern int UserRoleType;
}
#endif
#ifndef _CAMERA_H_
#define _CAMERA_H_
#include "view.h"
#include "visualization/view.h"
//forward declaration
class Camera : public qglviewer::Camera{
class Camera : public qglviewer::Camera
{
public:
Camera(View* v);
Camera(View* v, Camera c);
......@@ -62,5 +62,4 @@ protected:
int m_snapCount;
};
#endif
#ifndef _CONTEXT_H_
#define _CONTEXT_H_
#include "types.h"
#include <QGLContext>
class Context : public QGLContext{
class Context : public QGLContext
{
public:
Context(QWidget* w, const QGLFormat & format);
void setDevice(QWidget* w);
};
#endif
#ifndef _VIZUHANDLER_H_
#define _VIZUHANDLER_H_
#include <QHash>
namespace CGoGN {
class GenericMap;
namespace Utils{
......@@ -15,7 +12,8 @@ namespace CGoGN {
class VBOHandler;
class MapHandler{
class MapHandler
{
public:
MapHandler(CGoGN::GenericMap* map);
~MapHandler();
......@@ -38,5 +36,4 @@ protected:
QList<VBOHandler*> l_vbo;
};
#endif
#ifndef _RENDERCONTAINER_H_
#define _RENDERCONTAINER_H_
#include "Utils/GLSLShader.h"
#include "Algo/Render/GL2/topo3Render.h"
#include "Utils/vbo.h"
#include "types.h"
#include "system.h"
#include "interface/system.h"
#include <QList>
#include <QHash>
//forward declaration
class Scene;
......
......@@ -11,9 +11,6 @@
#include "types.h"
//forward declarations
class View;
class Window;
......
#ifndef _VIEW_H_
#define _VIEW_H_
#include <iostream>
#include "types.h"
//#include <GL/glew.h>
//#include <QGLViewer/qglviewer.h>
# include <QKeyEvent>
#include <iostream>
#include "interface/viewButtonArea.h"
# include <QKeyEvent>
#include <QList>
#include <QWidget>
#include "Utils/gl_matrices.h"
#include "viewButtonArea.h"
//forward declaration
class Scene;
class Camera;
......
......@@ -3,8 +3,8 @@
<file>cgogn/splash.png</file>
</qresource>
<qresource prefix="icons">
<file>icons/map_plugin.png</file>
<file>cgogn/cgogn2.png</file>
<file>icons/map_plugin.png</file>
<file>icons/check.png</file>
<file>icons/close.png</file>
<file>icons/share.png</file>
......
#include "cameraOptionDialog.h"
#include "dialogs/cameraOptionDialog.h"
#include "visualization/camera.h"
#include "camera.h"
CameraOptionDialog::CameraOptionDialog(Camera* camera, QWidget* parent=0) : QDialog(parent),
m_camera(camera)
CameraOptionDialog::CameraOptionDialog(Camera* camera, QWidget* parent=0) :
QDialog(parent), m_camera(camera)
{
this->setupUi(this);
......@@ -32,24 +31,30 @@ CameraOptionDialog::CameraOptionDialog(Camera* camera, QWidget* parent=0) : QDia
connect(drawPath_Check, SIGNAL(toggled(bool)), this, SLOT(drawPathChecked(bool)));
}
void CameraOptionDialog::drawChecked(bool b){
void CameraOptionDialog::drawChecked(bool b)
{
farPlane_Check->setEnabled(b);
scale_Spin->setEnabled(b);
}
void CameraOptionDialog::drawPathChecked(bool b){
void CameraOptionDialog::drawPathChecked(bool b)
{
groupBox_2->setEnabled(b);
}
void CameraOptionDialog::accept(){