glarea.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 * VCGLib                                                            o o     *
00003 * Visual and Computer Graphics Library                            o     o   *
00004 *                                                                _   O  _   *
00005 * Copyright(C) 2007                                                \/)\/    *
00006 * Visual Computing Lab                                            /\/|      *
00007 * ISTI - Italian National Research Council                           |      *
00008 *                                                                    \      *
00009 * All rights reserved.                                                      *
00010 *                                                                           *
00011 * This program is free software; you can redistribute it and/or modify      *   
00012 * it under the terms of the GNU General Public License as published by      *
00013 * the Free Software Foundation; either version 2 of the License, or         *
00014 * (at your option) any later version.                                       *
00015 *                                                                           *
00016 * This program is distributed in the hope that it will be useful,           *
00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             *
00019 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)          *
00020 * for more details.                                                         *
00021 *                                                                           *
00022 ****************************************************************************/
00023 /****************************************************************************
00024 History
00025 
00026 $Log: not supported by cvs2svn $
00027 Revision 1.1  2007/10/18 08:52:06  benedetti
00028 Initial release.
00029 
00030 
00031 ****************************************************************************/
00032 
00033 #ifndef GLAREA_H_
00034 #define GLAREA_H_
00035 
00037 #include <GL/glew.h>
00038 #include <QGLWidget>
00039 
00041 #include <wrap/gui/trackball.h>
00042 
00043 
00044 #include "mesh.h"
00045 #include "ml_scene_renderer.h"
00047 
00048 
00049 enum MyDrawMode{MDM_SMOOTH=0,MDM_POINTS,MDM_WIRE,MDM_FLATWIRE,MDM_FLAT};
00050 
00051 class SharedDataOpenGLContext : public QGLWidget
00052 {
00053         Q_OBJECT
00054 public:
00055         SharedDataOpenGLContext(CMeshO& mesh,MLThreadSafeMemoryInfo& mi,QWidget* parent = 0);
00056         ~SharedDataOpenGLContext();
00057 
00058     void myInitGL();
00059         void deAllocateBO();
00060 
00061         MLThreadSafeGLMeshAttributesFeeder feeder;
00062 
00063 public slots:
00065         void passInfoToOpenGL(int mode);
00066 
00067 signals:
00068         void dataReadyToBeRead(MyDrawMode,vcg::GLFeederInfo::ReqAtts&);
00069 };
00070 
00071 class GLArea:public QGLWidget
00072 {
00073         Q_OBJECT 
00074 public:
00075     GLArea (CMeshO& m,MLThreadSafeGLMeshAttributesFeeder& feed,QWidget* parent = NULL,QGLWidget* sharedcont = NULL);
00076         ~GLArea();
00077         void resetTrackBall();
00079 
00080 signals:
00082         void setStatusBar(QString message);
00083 protected:
00085         void initializeGL ();
00086         void resizeGL (int w, int h);
00087         void paintGL ();
00089         void keyReleaseEvent(QKeyEvent * e);
00090         void keyPressEvent(QKeyEvent * e);
00091         void mousePressEvent(QMouseEvent*e);
00092         void mouseMoveEvent(QMouseEvent*e);
00093         void mouseReleaseEvent(QMouseEvent*e);
00094         void wheelEvent(QWheelEvent*e); 
00095 public slots:
00096         void updateRequested(MyDrawMode,vcg::GLFeederInfo::ReqAtts&);
00097 private:
00099         CMeshO& mesh;
00101         vcg::Trackball track;
00103         void initMesh(QString message);
00104         MyDrawMode drawmode;
00105         MLThreadSafeGLMeshAttributesFeeder& feeder;
00106         vcg::GLFeederInfo::ReqAtts rq;
00107 };
00108 
00109 #endif /*GLAREA_H_ */


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:31:26