diff --git a/Facade.cpp b/Facade.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Facade.h b/Facade.h new file mode 100644 index 0000000..3772cc9 --- /dev/null +++ b/Facade.h @@ -0,0 +1,60 @@ +/* + * Common.cpp + * + * (c) 2013 Sofian Audry -- info(@)sofianaudry(.)com + * (c) 2013 Alexandre Quessy -- alexandre(@)quessy(.)net + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "MappingManager.h" + +/** + * Facade to control the application. + */ +class Facade +{ + public: + Facade(MappingManager *manager); + /** + * Clears all mappings and paints. + */ + bool clearProject(); + /** + * Create an image paint. + */ + bool createImagePaint(const char *paint_id, const char *uri); + /** + * Sets the image file to use in an image paint. + */ + bool updateImagePaintUri(const char *paint_id, const char *uri); + /** + * Creates a textured mesh. + */ + bool createMeshTextureMapping(const char *mapping_id, const char *paint_id, + int n_rows, int n_cols, + const QList &src, const QList &dst); + /** + * Creates a textured triangle. + */ + bool createTriangleTextureMapping(const char *mapping_id, const char *paint_id, + const QList &src, const QList &dst); + + // TODO: + // bool loadProject(const char *project_file); + // bool saveProject(const char *project_file); + // bool quit(); + private: + MappingManager *_manager; +}; diff --git a/libremapping.pro b/libremapping.pro index 7ea5912..1c84cab 100644 --- a/libremapping.pro +++ b/libremapping.pro @@ -1,7 +1,36 @@ CONFIG += qt debug TEMPLATE = app -HEADERS = MainWindow.h Util.h MapperGLCanvas.h SourceGLCanvas.h DestinationGLCanvas.h Mapper.h Mapping.h Shape.h Paint.h MappingManager.h ProjectWriter.h NameAllocator.h ProjectReader.h -SOURCES = main.cpp MainWindow.cpp Util.cpp Mapper.cpp MapperGLCanvas.cpp SourceGLCanvas.cpp DestinationGLCanvas.cpp MappingManager.cpp ProjectWriter.cpp NameAllocator.cpp ProjectReader.cpp Controller.cpp +HEADERS = \ + DestinationGLCanvas.h \ + Facade.h \ + MainWindow.h \ + Mapper.h \ + MapperGLCanvas.h \ + Mapping.h \ + MappingManager.h \ + NameAllocator.h \ + Paint.h \ + ProjectReader.h \ + ProjectWriter.h \ + Shape.h \ + SourceGLCanvas.h \ + Util.h + +SOURCES = \ + Controller.cpp \ + DestinationGLCanvas.cpp \ + Facade.cpp \ + MainWindow.cpp \ + Mapper.cpp \ + MapperGLCanvas.cpp \ + MappingManager.cpp \ + NameAllocator.cpp \ + ProjectReader.cpp \ + ProjectWriter.cpp \ + SourceGLCanvas.cpp \ + Util.cpp \ + main.cpp + QT += gui opengl xml RESOURCES = libremapping.qrc @@ -22,6 +51,11 @@ system(pkg-config --exists liblo) { CONFIG += link_pkgconfig PKGCONFIG += liblo DEFINES += HAVE_OSC - SOURCES += OscInterface.cpp OscReceiver.cpp - HEADERS += OscInterface.h OscReceiver.h concurrentqueue.h + SOURCES += \ + OscInterface.cpp \ + OscReceiver.cpp + HEADERS += \ + OscInterface.h \ + OscReceiver.h \ + concurrentqueue.h }