glwidget.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) 2004                                                \/)\/    *
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.4  2007/05/17 09:06:44  ganovelli
00028 gestione double click
00029 
00030 Revision 1.3  2006/12/10 23:29:57  ganovelli
00031 added VFIterator (Pos is disabled in this version)
00032 
00033 Revision 1.2  2006/12/10 22:17:18  ganovelli
00034 cvs problem during frist committ. repeated
00035 
00036 */
00037 #ifndef GLWIDGET_H_POS_DEMO
00038 #define GLWIDGET_H_POS_DEMO
00039 
00040 #include <GL/glew.h>
00041 #include <QGLWidget>
00042 #include "mesh_type.h"
00043 #include <wrap/gui/trackball.h>
00044 #include <wrap/gl/trimesh.h>
00045 #include <vcg/simplex/face/pos.h>
00046 #include <vcg/simplex/face/topology.h>
00047 
00048 class GLWidget : public QGLWidget
00049 {
00050     Q_OBJECT
00051 
00052 public:
00053     GLWidget(QWidget *parent = 0);
00054     ~GLWidget();
00055 
00056     QSize minimumSizeHint() const;
00057     QSize sizeHint() const;
00058     int xRotation() const { return xRot; }
00059                 MyStraightMesh mesh;
00060                 vcg::GlTrimesh<MyStraightMesh> glWrap;
00061                 vcg::Trackball track;
00062                 int ScreenH,ScreenW,pic_x,pic_y,keypress;
00063                 bool doPickPos,doPickVfIte;
00064                 vcg::face::Pos< MyStraightMesh::FaceType> pos;
00065                 vcg::face::VFIterator< MyStraightMesh::FaceType> vfite;
00066 
00067 public slots:
00068     void flipV( );
00069     void flipE( );
00070     void flipF( );
00071     void nextE( );
00072     void nextB( );
00073     void nextVfite( );
00074 
00075                 void LoadTriMesh(QString& namefile);
00076                 void OpenFile();
00077 
00078 protected:
00079                 void initializeGL();
00080     void paintGL();
00081     void resizeGL(int width, int height);
00082     void mouseDoubleClickEvent(QMouseEvent *event);
00083     void mousePressEvent(QMouseEvent *event);
00084     void mouseMoveEvent(QMouseEvent *event);
00085     void mouseReleaseEvent(QMouseEvent *event);
00086                 void wheelEvent ( QWheelEvent * e );
00087                 void keyPressEvent ( QKeyEvent * e );
00088 
00089 private:
00090     GLuint makeObject();
00091     void quad(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2,
00092               GLdouble x3, GLdouble y3, GLdouble x4, GLdouble y4);
00093     void extrude(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
00094     void normalizeAngle(int *angle);
00095 
00096     GLuint object;
00097     int xRot;
00098     QPoint lastPos;
00099     QColor trolltechGreen;
00100     QColor trolltechPurple;
00101 };
00102 
00103 #endif


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