1 /**************************************************************************** 2 * MeshLab o o * 3 * A versatile mesh processing toolbox o o * 4 * _ O _ * 5 * Copyright(C) 2005 \/)\/ * 6 * Visual Computing Lab /\/| * 7 * ISTI - Italian National Research Council | * 8 * \ * 9 * All rights reserved. * 10 * * 11 * This program is free software; you can redistribute it and/or modify * 12 * it under the terms of the GNU General Public License as published by * 13 * the Free Software Foundation; either version 2 of the License, or * 14 * (at your option) any later version. * 15 * * 16 * This program is distributed in the hope that it will be useful, * 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 19 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * 20 * for more details. * 21 * * 22 ****************************************************************************/ 23 24 #ifndef SHADERRENDERPLUGIN_H 25 #define SHADERRENDERPLUGIN_H 26 27 #include <GL/glew.h> 28 #include <common/interfaces.h> 29 #include "textfile.h" 30 #include "shaderStructs.h" 31 #include "shaderDialog.h" 32 33 34 class MeshShaderRenderPlugin : public QObject, public MeshRenderInterface 35 { 36 Q_OBJECT 37 MESHLAB_PLUGIN_IID_EXPORTER(MESH_RENDER_INTERFACE_IID) 38 Q_INTERFACES(MeshRenderInterface) 39 40 GLhandleARB v; 41 GLhandleARB f; 42 43 std::map<QString, ShaderInfo> shaders; 44 45 bool supported; 46 QList <QAction *> actionList; 47 48 ShaderDialog *sDialog; 49 50 public: 51 MeshShaderRenderPlugin()52 MeshShaderRenderPlugin() 53 { 54 55 supported = false; 56 sDialog = 0; 57 } 58 actions()59 QList<QAction *> actions() 60 { 61 if (actionList.isEmpty()) initActionList(); 62 return actionList; 63 } 64 65 void initActionList(); 66 isSupported()67 bool isSupported() { return supported; } 68 69 void Init(QAction *, MeshDocument &, MLSceneGLSharedDataContext::PerMeshRenderingDataMap& , GLArea *); 70 void Render(QAction *, MeshDocument &, MLSceneGLSharedDataContext::PerMeshRenderingDataMap&, GLArea *); 71 void Finalize(QAction*, MeshDocument*, GLArea*); 72 73 }; 74 75 #endif 76 77