Commit 9096488e authored by Pierre Kraemer's avatar Pierre Kraemer

SCHNApps : encore un effort..

parent 77d3c5bb
...@@ -25,41 +25,33 @@ file( ...@@ -25,41 +25,33 @@ file(
${SCHNApps_ROOT_DIR}/src/main.cpp ${SCHNApps_ROOT_DIR}/src/main.cpp
${SCHNApps_ROOT_DIR}/src/mapHandler.cpp ${SCHNApps_ROOT_DIR}/src/mapHandler.cpp
${SCHNApps_ROOT_DIR}/src/plugin.cpp ${SCHNApps_ROOT_DIR}/src/plugin.cpp
${SCHNApps_ROOT_DIR}/src/scene.cpp
${SCHNApps_ROOT_DIR}/src/splitArea.cpp ${SCHNApps_ROOT_DIR}/src/splitArea.cpp
${SCHNApps_ROOT_DIR}/src/system.cpp ${SCHNApps_ROOT_DIR}/src/system.cpp
${SCHNApps_ROOT_DIR}/src/view.cpp ${SCHNApps_ROOT_DIR}/src/view.cpp
${SCHNApps_ROOT_DIR}/src/window.cpp ${SCHNApps_ROOT_DIR}/src/window.cpp
${SCHNApps_ROOT_DIR}/src/viewSelector.cpp ${SCHNApps_ROOT_DIR}/src/viewSelector.cpp
${SCHNApps_ROOT_DIR}/src/cameraViewDialog.cpp ${SCHNApps_ROOT_DIR}/src/cameraDialog.cpp
${SCHNApps_ROOT_DIR}/src/pluginDialog.cpp ${SCHNApps_ROOT_DIR}/src/pluginDialog.cpp
${SCHNApps_ROOT_DIR}/src/cameraViewDialog.cpp
) )
SET(SCHNApps_H_OBJECT_FILES SET(SCHNApps_H_OBJECT_FILES
${SCHNApps_ROOT_DIR}/include/window.h ${SCHNApps_ROOT_DIR}/include/window.h
${SCHNApps_ROOT_DIR}/include/scene.h
${SCHNApps_ROOT_DIR}/include/view.h ${SCHNApps_ROOT_DIR}/include/view.h
${SCHNApps_ROOT_DIR}/include/splitArea.h ${SCHNApps_ROOT_DIR}/include/splitArea.h
${SCHNApps_ROOT_DIR}/include/viewSelector.h ${SCHNApps_ROOT_DIR}/include/viewSelector.h
${SCHNApps_ROOT_DIR}/include/cameraViewDialog.h ${SCHNApps_ROOT_DIR}/include/cameraDialog.h
${SCHNApps_ROOT_DIR}/include/pluginDialog.h ${SCHNApps_ROOT_DIR}/include/pluginDialog.h
${SCHNApps_ROOT_DIR}/include/cameraViewDialog.h
# ${SCHNApps_ROOT_DIR}/include/dialogs/newSceneDialog.h
# ${SCHNApps_ROOT_DIR}/include/dialogs/sceneSelector.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
) )
file( file(
GLOB GLOB
SCHNApps_FORM_FILES SCHNApps_FORM_FILES
${SCHNApps_ROOT_DIR}/forms/window.ui ${SCHNApps_ROOT_DIR}/forms/window.ui
${SCHNApps_ROOT_DIR}/forms/cameraViewDialog.ui ${SCHNApps_ROOT_DIR}/forms/cameraDialog.ui
${SCHNApps_ROOT_DIR}/forms/pluginDialog.ui ${SCHNApps_ROOT_DIR}/forms/pluginDialog.ui
${SCHNApps_ROOT_DIR}/forms/cameraViewDialog.ui
) )
QT4_WRAP_UI( UI_H_FILES QT4_WRAP_UI( UI_H_FILES
...@@ -86,4 +78,4 @@ TARGET_LINK_LIBRARIES( SCHNAppsD ...@@ -86,4 +78,4 @@ TARGET_LINK_LIBRARIES( SCHNAppsD
) )
#ADD_SUBDIRECTORY(${SCHNApps_ROOT_DIR}/Plugins PluginsD) ADD_SUBDIRECTORY(${SCHNApps_ROOT_DIR}/Plugins PluginsD)
...@@ -7,17 +7,17 @@ INCLUDE_DIRECTORIES( ...@@ -7,17 +7,17 @@ INCLUDE_DIRECTORIES(
) )
SET( FIRSTPLUGIN_PLUGIN_SRC SET( FIRSTPLUGIN_PLUGIN_SRC
${SCHNApps_ROOT_DIR}/src/plugins/visualPlugin.cpp
${SCHNApps_ROOT_DIR}/Plugins/firstPlugin/src/firstPlugin.cpp ${SCHNApps_ROOT_DIR}/Plugins/firstPlugin/src/firstPlugin.cpp
) )
SET( FIRSTPLUGIN_PLUGIN_H SET( FIRSTPLUGIN_PLUGIN_H
${SCHNApps_ROOT_DIR}/include/plugins/visualPlugin.h
${SCHNApps_ROOT_DIR}/Plugins/firstPlugin/include/firstPlugin.h ${SCHNApps_ROOT_DIR}/Plugins/firstPlugin/include/firstPlugin.h
) )
IF( ${CMAKE_BUILD_TYPE} STREQUAL Debug ) IF( ${CMAKE_BUILD_TYPE} STREQUAL Debug )
ADD_DEFINITIONS(-DDEBUG)
IF(WIN32) IF(WIN32)
link_directories( ${CGoGN_ROOT_DIR}/lib/Release ) link_directories( ${CGoGN_ROOT_DIR}/lib/Release )
ELSE (WIN32) ELSE (WIN32)
......
#ifndef _FIRSTPLUGIN_H_ #ifndef _FIRSTPLUGIN_H_
#define _FIRSTPLUGIN_H_ #define _FIRSTPLUGIN_H_
#include "plugins/visualPlugin.h" #include "plugin.h"
/**---CGoGN includes **/ /**---CGoGN includes **/
#include "Topology/generic/parameters.h" #include "Topology/generic/parameters.h"
...@@ -36,12 +36,9 @@ typedef PFP::VEC3 VEC3; ...@@ -36,12 +36,9 @@ typedef PFP::VEC3 VEC3;
*/ */
/** /**
* Our plugin must inherit from VisualPlugin, * Our plugin must inherit from Plugin
* that is a class that itself is an implementation
* of the Plugin interface (virtual class). It contains
* many useful and essantial methods.
*/ */
class FirstPlugin : public VisualPlugin class FirstPlugin : public Plugin
{ {
/** /**
* Essential Qt macros. * Essential Qt macros.
...@@ -50,26 +47,14 @@ class FirstPlugin : public VisualPlugin ...@@ -50,26 +47,14 @@ class FirstPlugin : public VisualPlugin
Q_INTERFACES(Plugin) Q_INTERFACES(Plugin)
public: public:
FirstPlugin() {} FirstPlugin()
~FirstPlugin() {} {}
/** ~FirstPlugin()
* The classical call back for the initGL method {}
* When a scene will be link to this plugin, it will call
* back this method with itself as a parameter.
*/
void cb_initGL(Scene *scene);
/**
* The drawing method that needs to be overloaded.
* Each time a scene (that is to say, at least one of the
* views that is contains) needs to be refresh, it calls back
* this method with itself as a parameter
*/
void cb_redraw(Scene *scene);
/** /**
* The plugin's activation method * The plugin's enable method
* Each time the main application loads this plugin, * Each time the main application loads this plugin,
* it call this method. Writing this method is * it call this method. Writing this method is
* the occasion to initialize the plugin and check certain * the occasion to initialize the plugin and check certain
...@@ -79,12 +64,27 @@ public: ...@@ -79,12 +64,27 @@ public:
bool enable(); bool enable();
/** /**
* The plugin's disabling method * The plugin's disable method
* Each time the main application will unload the plugin * Each time the main application will unload the plugin
* it will call this method. * it will call this method.
*/ */
void disable(); void disable();
void cb_initGL(Scene *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) {}
protected: protected:
/** Attributes that are specific to this plugin **/ /** Attributes that are specific to this plugin **/
MAP myMap; MAP myMap;
......
...@@ -67,7 +67,7 @@ void FirstPlugin::disable() ...@@ -67,7 +67,7 @@ void FirstPlugin::disable()
// essential Qt function: // essential Qt function:
// arguments are // arguments are
// - the complied name of the plugin // - the complied name of the plugin
// - the main class of our plugin (that extends VisualPlugin) // - the main class of our plugin
Q_EXPORT_PLUGIN2(FirstPlugin, FirstPlugin) Q_EXPORT_PLUGIN2(FirstPlugin, FirstPlugin)
#else #else
Q_EXPORT_PLUGIN2(FirstPluginD, FirstPlugin) Q_EXPORT_PLUGIN2(FirstPluginD, FirstPlugin)
......
...@@ -27,41 +27,33 @@ file( ...@@ -27,41 +27,33 @@ file(
${SCHNApps_ROOT_DIR}/src/main.cpp ${SCHNApps_ROOT_DIR}/src/main.cpp
${SCHNApps_ROOT_DIR}/src/mapHandler.cpp ${SCHNApps_ROOT_DIR}/src/mapHandler.cpp
${SCHNApps_ROOT_DIR}/src/plugin.cpp ${SCHNApps_ROOT_DIR}/src/plugin.cpp
${SCHNApps_ROOT_DIR}/src/scene.cpp
${SCHNApps_ROOT_DIR}/src/splitArea.cpp ${SCHNApps_ROOT_DIR}/src/splitArea.cpp
${SCHNApps_ROOT_DIR}/src/system.cpp ${SCHNApps_ROOT_DIR}/src/system.cpp
${SCHNApps_ROOT_DIR}/src/view.cpp ${SCHNApps_ROOT_DIR}/src/view.cpp
${SCHNApps_ROOT_DIR}/src/window.cpp ${SCHNApps_ROOT_DIR}/src/window.cpp
${SCHNApps_ROOT_DIR}/src/viewSelector.cpp ${SCHNApps_ROOT_DIR}/src/viewSelector.cpp
${SCHNApps_ROOT_DIR}/src/cameraViewDialog.cpp ${SCHNApps_ROOT_DIR}/src/cameraDialog.cpp
${SCHNApps_ROOT_DIR}/src/pluginDialog.cpp ${SCHNApps_ROOT_DIR}/src/pluginDialog.cpp
${SCHNApps_ROOT_DIR}/src/cameraViewDialog.cpp
) )
SET(SCHNApps_H_OBJECT_FILES SET(SCHNApps_H_OBJECT_FILES
${SCHNApps_ROOT_DIR}/include/window.h ${SCHNApps_ROOT_DIR}/include/window.h
${SCHNApps_ROOT_DIR}/include/scene.h
${SCHNApps_ROOT_DIR}/include/view.h ${SCHNApps_ROOT_DIR}/include/view.h
${SCHNApps_ROOT_DIR}/include/splitArea.h ${SCHNApps_ROOT_DIR}/include/splitArea.h
${SCHNApps_ROOT_DIR}/include/viewSelector.h ${SCHNApps_ROOT_DIR}/include/viewSelector.h
${SCHNApps_ROOT_DIR}/include/cameraViewDialog.h ${SCHNApps_ROOT_DIR}/include/cameraDialog.h
${SCHNApps_ROOT_DIR}/include/pluginDialog.h ${SCHNApps_ROOT_DIR}/include/pluginDialog.h
${SCHNApps_ROOT_DIR}/include/cameraViewDialog.h
# ${SCHNApps_ROOT_DIR}/include/dialogs/newSceneDialog.h
# ${SCHNApps_ROOT_DIR}/include/dialogs/sceneSelector.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
) )
file( file(
GLOB GLOB
SCHNApps_FORM_FILES SCHNApps_FORM_FILES
${SCHNApps_ROOT_DIR}/forms/window.ui ${SCHNApps_ROOT_DIR}/forms/window.ui
${SCHNApps_ROOT_DIR}/forms/cameraViewDialog.ui ${SCHNApps_ROOT_DIR}/forms/cameraDialog.ui
${SCHNApps_ROOT_DIR}/forms/pluginDialog.ui ${SCHNApps_ROOT_DIR}/forms/pluginDialog.ui
${SCHNApps_ROOT_DIR}/forms/cameraViewDialog.ui
) )
QT4_WRAP_UI( UI_H_FILES QT4_WRAP_UI( UI_H_FILES
...@@ -88,4 +80,4 @@ TARGET_LINK_LIBRARIES( SCHNApps ...@@ -88,4 +80,4 @@ TARGET_LINK_LIBRARIES( SCHNApps
) )
#ADD_SUBDIRECTORY(${SCHNApps_ROOT_DIR}/Plugins Plugins) ADD_SUBDIRECTORY(${SCHNApps_ROOT_DIR}/Plugins Plugins)
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CODialog</class>
<widget class="QDialog" name="CODialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>363</width>
<height>357</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Camera draw options</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="draw_Check">
<property name="text">
<string>Draw</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="farPlane_Check">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Draw far plane</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Camera scale:</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="scale_Spin">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimum">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="drawPath_Check">
<property name="text">
<string>Draw user path</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="title">
<string>Draw path option</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="drawAxis_Check">
<property name="text">
<string>draw axis</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Scale:</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="frameScale_Spin">
<property name="minimum">
<double>0.100000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</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>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>CODialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>CODialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CSDialog</class>
<widget class="QDialog" name="CSDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>325</width>
<height>414</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Gestions des caméras</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>(Glissez et déposez pour déplacer</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>les caméras entre les vues)</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QToolButton" name="addView_Button">
<property name="text">
<string>+</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="removeView_Button">
<property name="text">
<string>-</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>
</layout>
</widget>
</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>pressed()</signal>
<receiver>CSDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>297</x>
<y>390</y>
</hint>
<hint type="destinationlabel">
<x>162</x>
<y>206</y>
</hint>
</hints>
</connection>
<connection>
<sender>CSDialog</sender>
<signal>rejected()</signal>
<receiver>CSDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>162</x>
<y>206</y>
</hint>
<hint type="destinationlabel">
<x>162</x>
<y>206</y>
</hint>
</hints>
</connection>
</connections>
</ui>
...@@ -6,41 +6,23 @@ ...@@ -6,41 +6,23 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>400</width> <width>232</width>
<height>518</height> <height>430</height>
</rect> </rect>