Commit 0c4a8f15 authored by Pierre Kraemer's avatar Pierre Kraemer

debut remise a plat de SCHNApps

parent 6ad82bac
#ifndef _CAMERAOPTIONDIALOG_H_
#define _CAMERAOPTIONDIALOG_H_
#include "ui_cameraOptionDialog.h"
class Camera;
class CameraOptionDialog: public QDialog, Ui::CODialog{
Q_OBJECT
public:
CameraOptionDialog(Camera* camera, QWidget* parent);
~CameraOptionDialog(){}
public slots:
void drawChecked(bool b);
void drawPathChecked(bool b);
void accept();
protected:
Camera* m_camera;
};
#endif
#ifndef _SEPARATECAMERADIALOG_H_
#define _SEPARATECAMERADIALOG_H_
#include "ui_cameraSceneDialog.h"
#include <QTreeWidget>
#include <QVariant>
class Scene;
class View;
namespace Qt{
extern int UserRoleType;
}
namespace myTreeWidget{
enum type {view, camera};
}
class MyTreeWidget : public QTreeWidget{
Q_OBJECT
public:
MyTreeWidget(Scene* originalScene, QWidget* parent=0);
protected:
virtual bool dropMimeData(QTreeWidgetItem *parent, int index, const QMimeData *data, Qt::DropAction action);
QStringList mimeTypes() const;
Qt::DropActions supportedDropActions () const;
QMimeData* mimeData(const QList<QTreeWidgetItem *> items) const;
Scene* m_scene;
};
class CameraSceneDialog : public QDialog, Ui::CSDialog{
Q_OBJECT
public:
CameraSceneDialog(Scene* scene, QWidget* parent=0);
~CameraSceneDialog(){}
MyTreeWidget* treeWidget;
Scene* m_scene;
protected slots:
void newDuplicatedView();
void removeView();
void currentItemChanged(QTreeWidgetItem* cur, QTreeWidgetItem* prev);
};
#endif
#ifndef _CAMERAVIEWDIALOG_H_
#define _CAMERAVIEWDIALOG_H_
#include "ui_cameraViewDialog.h"
class View;
class Camera;
class CameraViewDialog : public QDialog, Ui::CVDialog{
Q_OBJECT
public:
CameraViewDialog(View* view, QWidget* parent=0);
~CameraViewDialog();
protected:
View* view;
protected slots:
void addCamera();
void removeCamera();
void changeCurrentCamera(QListWidgetItem * current, QListWidgetItem * previous);
void cameraNameChange(QListWidgetItem * item);
void settingsCamera();
private:
bool autoText;
};
#endif
#ifndef _GLOBALCAMERADIALOG_H_
#define _GLOBALCAMERADIALOG_H_
#include "ui_globalCameraDialog.h"
#include <QListWidget>
#include <QTreeWidget>
#include <QVariant>
#include <QMenu>
#include "visualization/camera.h"
#include "visualization/view.h"
class Window;
struct CarryCamera{
Camera* camera;
View* view;
CarryCamera(Camera* camera=NULL, View* view=NULL) : camera(camera), view(view){}
};
namespace Qt{
extern int UserRole2;
}
namespace myDragDropWidgets{
enum type {view, camera,scene};
}
class MyCameraMenu : public QMenu{
Q_OBJECT
public:
enum ResultType{none,move,share};
enum Mode{moving=1, sharing=2};
MyCameraMenu(const QString & title, QWidget * parent = 0, int mode=(moving | sharing));
ResultType result(){return m_result;}
protected:
QAction* m_moveAction;
QAction* m_shareAction;
ResultType m_result;
protected slots:
void moveCamera(){m_result=move;}
void shareCamera(){m_result=share;}
};
class MyDragListWidget : public QListWidget{
Q_OBJECT
public:
MyDragListWidget(QWidget* parent=0);
~MyDragListWidget(){}
protected:
QMimeData* mimeData(const QList<QListWidgetItem *> items) const;
};
class MyDropTreeWidget : public QTreeWidget{
Q_OBJECT
public:
MyDropTreeWidget(QWidget* parent=0);
~MyDropTreeWidget(){}
protected:
virtual bool dropMimeData(QTreeWidgetItem *parent, int index, const QMimeData *data, Qt::DropAction action);
QStringList mimeTypes() const;
Qt::DropActions supportedDropActions () const;
};
class GlobalCameraDialog : public QDialog, Ui::GCDialog{
Q_OBJECT
public:
GlobalCameraDialog(Window* window);
~GlobalCameraDialog(){}
MyDropTreeWidget* treeWidget;
MyDragListWidget* listWidget;
public slots:
void treeCurrentItemChanged(QTreeWidgetItem* cur,QTreeWidgetItem* prev);
};
#endif
#ifndef _LINKVIEWDIALOG_H_
#define _LINKVIEWDIALOG_H_
#include "ui_linkViewDialog.h"
#include "types.h"
class Window;
class Scene;
class LinkViewDialog : public QDialog, Ui::LVDialog{
Q_OBJECT
public:
LinkViewDialog(Window* parent, PluginHash* activePlugins, Scene* scene);
LinkViewDialog(Window* parent, QList<Plugin*> dependingPlugin, Scene* scene);
~LinkViewDialog(){}
protected:
enum Mode{LINK, UNLINK};
QList<Plugin*> l_waitingPlugins;
Scene* m_scene;
Mode m_mode;
public slots:
void button_OK();
void customContextMenu(const QPoint & pos);
void showPluginInfo();
};
#endif
#ifndef _MAPPLUGINDIALOG_H_
#define _MAPPLUGINDIALOG_H_
#include "ui_mapPluginDialog.h"
#include "types.h"
class Window;
class Plugin;
class MapHandler;
namespace CGoGN { class GenericMap; }
class MapPluginDialog : public QDialog, Ui::MPDialog{
Q_OBJECT
public:
MapPluginDialog(Window* w, MapHash* maps);
protected:
QList<Plugin*> l_plugin;
public slots:
void pluginSelection();
void actionMap(QListWidgetItem* item);
void customPluginContextMenu(const QPoint & pos);
void showPluginInfo();
};
#endif
#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{
Q_OBJECT
public:
NewSceneDialog(Window* parent);
~NewSceneDialog();
protected:
Window* m_window;
QListWidget* m_listWidget;
QListWidget* m_listWidget2;
public slots:
void button_OK();
void new_camera();
void share_camera();
void cameraListSelectionChange(QListWidgetItem* cur, QListWidgetItem* prev);
void linkPlugin(bool b);
void customContextMenu(const QPoint & pos);
void showPluginInfo();
};
#endif
#ifndef _PLUGINDIALOG_H_
#define _PLUGINDIALOG_H_
#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{
Q_OBJECT
public:
PluginDialog(Window* parent=0, PluginHash* activePlugins=NULL);
~PluginDialog();
protected:
// QDomDocument doc;
// QFile xmlFile;
// QTextStream out;
PluginHash* activePlugins;
Window* parentWindow;
bool loadInfoPlugins();
// void showPlugins();
private:
bool init;
enum EntryType{DIR=1,FILE, FILE_DIR};
void showPluginsDir(QDir directory);
protected slots:
void cb_addPlugins();
void cb_removePlugins();
void cb_addPluginDirectory();
void cb_activePlugin(QTreeWidgetItem* item, int column);
void cb_acceptDialog();
void customContextMenu(const QPoint & pos);
void showPluginInfo();
};
#endif
#ifndef _SCENESELECTOR_H_
#define _SCENESELECTOR_H_
#include "visualization/view.h"
#include <QDialog>
#include <QRect>
class SplitArea;
struct PixElem
{
View* view;
QRect rect;
QColor color;
PixElem() : view(NULL),color(Qt::gray){}
PixElem(View* view) : view(view),color(Qt::gray){}
PixElem(const PixElem& pixElem) : view(pixElem.view),rect(pixElem.rect),color(pixElem.color){}
bool operator== ( const PixElem & other ) const{
return view==other.view;
}
PixElem & operator= ( const PixElem & other ){
view= other.view; rect= other.rect, color= other.color; return *this;
}
};
class ViewPixMaps : public QList<QList<PixElem> >
{
public:
typedef ViewPixMaps::iterator y_iterator;
typedef QList<PixElem>::iterator x_iterator;
ViewPixMaps();
~ViewPixMaps();
void fromSplitArea(SplitArea* splitArea);
int getMaxX();
int getMinX();
int getY();
int getYMinX();
PixElem& getAt(int x, int y);
y_iterator y_begin(){return this->begin();}
y_iterator y_end(){return this->end();}
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();
void cancelMove();
void insertion(int x, int y);
bool isModified(){return this->modif;}
private:
int maxX;
int minX;
int Y;
int YminX;
int originX, originY;
PixElem origin;
int tmpX, tmpY;
PixElem tmp;
bool modif;
protected:
void computeSize();
};
class ViewSelector : public QDialog
{
Q_OBJECT
public:
enum SelectorDialogType {MOVE,SELECT};
ViewSelector(QWidget* parent=0, SelectorDialogType type=MOVE);
ViewSelector(ViewPixMaps viewPixMap, QWidget* parent=0, SelectorDialogType type=MOVE);
~ViewSelector();
void setGLVMap(ViewPixMaps viewPixMap);
ViewPixMaps getGLVMap(){return viewPixMap;}
QPoint getInsertPoint();
void setInsertionName(QString insertionName){this->insertionName= insertionName;}
bool keys[3];
protected:
ViewPixMaps viewPixMap;
int mouseX, mouseY;
bool pixmapGrabbed;
QRect grabbed;
SelectorDialogType type;
QPoint insertPoint;
QString insertionName;
protected:
void paintEvent(QPaintEvent *event);
void mouseMoveEvent ( QMouseEvent * event );
void mousePressEvent ( QMouseEvent * event );
void mouseReleaseEvent( QMouseEvent * event );
void keyPressEvent( QKeyEvent * event );
void keyReleaseEvent( QKeyEvent * event );
private:
QPoint mouseToIndice();
};
#endif
#ifndef _SPLITAREA_H_
#define _SPLITAREA_H_
#include <QSplitter>
class SplitArea : public QSplitter{
Q_OBJECT
public:
SplitArea(QWidget* parent=0);
void addFitElement(QWidget* element);
void addElementAt(QWidget* element, int x, int y);
void addElementRightTo(QWidget* element, QWidget* left);
bool isEmpty();
int getNbRow(){return nbRow;}
void updateSize();
protected:
int nbRow, nbMaxColumn;
int rowMin;
int nbElement;
protected slots:
void elementRemoved();
private:
bool sizeUpdated;
void determineRowMin();
};
#endif
#ifndef _STATEHANDLER_H_
#define _STATEHANDLER_H_
class StateHandler{
};
#endif
#ifndef _SYSTEM_H_
#define _SYSTEM_H_
#include <QWidget>
#include <QSplashScreen>
#include <unistd.h>
#include <stdarg.h>
#include <iostream>
#include "types.h"
#include "ui_questionSessionDialog.h"
#include "ui_infoDialog.h"
class Window;
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);
};
}
class Error
{
public:
virtual ~Error() = 0;
typedef enum
{
SUCCESS, NO_SCENE, SCENE_UNREFERENCED, SCENE_EXISTS, NO_DOCK, NO_PLUGIN_PATH_FILE,
ERROR_OPEN_PLUGIN_FILE , BAD_PLUGIN_PATH_FILE, BAD_PLUGIN_PATH_IN_FILE, NO_PLUGIN_IN_DIR,
PLUGIN_EXISTS, ERROR_PLUGIN_LOAD, BAD_LINK_PLUGIN_WINDOW, UNSATSIFIED_PLUGIN_DEPENDENCIE,
BAD_ACTION_MENU_PATH, MAP_UNREFERENCED, MAP_EXISTS, SHADER_EXISTS, SHADER_NOT_FOUND,
VBO_EXISTS, VBO_NOT_FOUND, TOPO3RENDER_EXISTS, TOPO3RENDER_NOT_FOUND, OPEN_FILE_ERROR,
BAD_XML_FILE
} ERROR_CODE;
static QString parameter;
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);
static ERROR_CODE ERROR_PLUGIN_LOAD_f(QString plugin);
static ERROR_CODE BAD_LINK_PLUGIN_WINDOW_f(QString plugin);
static ERROR_CODE UNSATSIFIED_PLUGIN_DEPENDENCIE_f(QString dependencie, QString from = QString());
static ERROR_CODE BAD_ACTION_MENU_PATH_f(QString actionPath);
static ERROR_CODE MAP_UNREFERENCED_f(QString map_name);
static ERROR_CODE MAP_EXISTS_f(QString map_name);
static ERROR_CODE SHADER_EXISTS_f(QString shader_name, QString glv_name = QString());
static ERROR_CODE SHADER_NOT_FOUND_f(QString shader_name, QString glv_name = QString());
static ERROR_CODE VBO_EXISTS_f(QString vbo_name, QString glv_name = QString());
static ERROR_CODE VBO_NOT_FOUND_f(QString vbo_name, QString glv_name = QString());
static ERROR_CODE TOPO3RENDER_EXISTS_f(QString name, QString glv_name = QString());
static ERROR_CODE TOPO3RENDER_NOT_FOUND_f(QString name, QString glv_name = QString());
static ERROR_CODE OPEN_FILE_ERROR_f(QString filepath);
static ERROR_CODE BAD_XML_FILE_f(QString filepath);
static void showError(QWidget *parent = 0);
};
class Events
{
public:
virtual ~Events() = 0;
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);
};
typedef enum
{
GLVIEWER_IN_DOCK, SIMPLE_GLVIEWER
} QGLV_CREATE_SETTINGS;
extern QString app_path;
extern QSplashScreen *splash;