glwidget.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
00004 ** All rights reserved.
00005 ** Contact: Nokia Corporation (qt-info@nokia.com)
00006 **
00007 ** This file is part of the examples of the Qt Toolkit.
00008 **
00009 ** $QT_BEGIN_LICENSE:BSD$
00010 ** You may use this file under the terms of the BSD license as follows:
00011 **
00012 ** "Redistribution and use in source and binary forms, with or without
00013 ** modification, are permitted provided that the following conditions are
00014 ** met:
00015 **   * Redistributions of source code must retain the above copyright
00016 **     notice, this list of conditions and the following disclaimer.
00017 **   * Redistributions in binary form must reproduce the above copyright
00018 **     notice, this list of conditions and the following disclaimer in
00019 **     the documentation and/or other materials provided with the
00020 **     distribution.
00021 **   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
00022 **     the names of its contributors may be used to endorse or promote
00023 **     products derived from this software without specific prior written
00024 **     permission.
00025 **
00026 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00027 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00028 ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00029 ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00030 ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00031 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00032 ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00033 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00034 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00035 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00036 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
00037 ** $QT_END_LICENSE$
00038 **
00039 ****************************************************************************/
00040 
00041 #ifndef GLWIDGET_H
00042 #define GLWIDGET_H
00043 
00044 #include <GL/glew.h>
00045 #include <QGLWidget>
00046 #include <QKeyEvent>
00047 
00049 #include <vcg/complex/complex.h>
00050 #include <vcg/complex/algorithms/update/bounding.h>
00051 #include <vcg/complex/algorithms/update/normal.h>
00052 #include <vcg/complex/algorithms/create/platonic.h>
00053 
00055 #include <wrap/io_trimesh/import.h>
00056 #include <wrap/gl/trimesh.h>
00057 #include <wrap/gui/trackball.h>
00058 
00059 
00061 #include <AntTweakBar.h>
00062 using namespace vcg;
00063 class CFace;
00064 class CVertex;
00065 
00066 struct MyUsedTypes : public UsedTypes<  Use<CVertex>            ::AsVertexType,
00067                                                                                 Use<CFace>                      ::AsFaceType>{};
00068 
00070 class CVertex : public vcg::Vertex< MyUsedTypes, vcg::vertex::Coord3f, vcg::vertex::Normal3f, vcg::vertex::BitFlags>{};
00071 class CFace   : public vcg::Face<  MyUsedTypes, vcg::face::VertexRef, vcg::face::Normal3f, vcg::face::BitFlags > {};
00072 class CMesh   : public vcg::tri::TriMesh< std::vector<CVertex>, std::vector<CFace> > {};
00073 
00074 class GLWidget : public QGLWidget
00075 {
00076     Q_OBJECT
00077 
00078 public:
00079     GLWidget(QWidget *parent = 0);
00080      bool hasToPick;
00081      Point2i pointToPick;
00082     ~GLWidget() {};
00083 
00084     QSize sizeHint() const {
00085       return QSize(800, 600);
00086   };
00087 
00088 protected:
00089     void initializeGL();
00090     void paintGL();
00091     void resizeGL(int width, int height);
00092     void mousePressEvent(QMouseEvent *event);
00093     void mouseReleaseEvent(QMouseEvent *event);
00094     void mouseMoveEvent(QMouseEvent *event);
00095     void mouseDoubleClickEvent ( QMouseEvent * event );
00096     void keyPressEvent(QKeyEvent *event);
00097     void keyReleaseEvent(QKeyEvent *event);
00098     void wheelEvent(QWheelEvent *event);
00099 };
00100 
00101 #endif


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