00001 /*===========================================================================*\ 00002 * * 00003 * OpenFlipper * 00004 * Copyright (C) 2001-2009 by Computer Graphics Group, RWTH Aachen * 00005 * www.openflipper.org * 00006 * * 00007 *---------------------------------------------------------------------------* 00008 * This file is part of OpenFlipper. * 00009 * * 00010 * OpenFlipper is free software: you can redistribute it and/or modify * 00011 * it under the terms of the GNU Lesser General Public License as * 00012 * published by the Free Software Foundation, either version 3 of * 00013 * the License, or (at your option) any later version with the * 00014 * following exceptions: * 00015 * * 00016 * If other files instantiate templates or use macros * 00017 * or inline functions from this file, or you compile this file and * 00018 * link it with other files to produce an executable, this file does * 00019 * not by itself cause the resulting executable to be covered by the * 00020 * GNU Lesser General Public License. This exception does not however * 00021 * invalidate any other reasons why the executable file might be * 00022 * covered by the GNU Lesser General Public License. * 00023 * * 00024 * OpenFlipper is distributed in the hope that it will be useful, * 00025 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00026 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00027 * GNU Lesser General Public License for more details. * 00028 * * 00029 * You should have received a copy of the GNU LesserGeneral Public * 00030 * License along with OpenFlipper. If not, * 00031 * see <http://www.gnu.org/licenses/>. * 00032 * * 00033 \*===========================================================================*/ 00034 00035 /*===========================================================================*\ 00036 * * 00037 * $Revision: 8520 $ * 00038 * $Author: moebius $ * 00039 * $Date: 2010-02-10 15:56:59 +0100 (Mi, 10. Feb 2010) $ * 00040 * * 00041 \*===========================================================================*/ 00042 00043 00044 #ifndef SIMPLEVIEWER_HH 00045 #define SIMPLEVIEWER_HH 00046 00047 //============================================================================= 00048 // 00049 // CLASS simpleViewer - IMPLEMENTATION 00050 // 00051 //============================================================================= 00052 00053 //== INCLUDES ================================================================= 00054 00055 #include <OpenFlipper/common/ViewerProperties.hh> 00056 #include <OpenFlipper/common/GlobalDefines.hh> 00057 #include <QGraphicsView> 00058 #include <QGLFormat> 00059 00060 00061 00062 //== NAMESPACES =============================================================== 00063 00064 //== FORWARDDECLARATIONS ====================================================== 00065 class SimpleGLGraphicsScene; 00066 class glViewer; 00067 00068 00069 //== CLASS DEFINITION ========================================================= 00070 00071 00078 class DLLEXPORT SimpleViewer : public QGraphicsView 00079 { 00080 Q_OBJECT 00081 00082 public: 00084 SimpleViewer(QWidget* _parent = NULL); 00085 00087 ~SimpleViewer(); 00088 00090 Viewer::ViewerProperties& properties (); 00091 00093 glViewer * viewer (); 00094 00095 protected: 00096 // handle resizes 00097 virtual void resizeEvent(QResizeEvent *_event); 00098 00099 private: 00100 // initalisation 00101 void initialize (const QGLFormat &_format, QGLWidget *_shareWidget = NULL); 00102 00103 private slots: 00104 00105 // action mode handling for ViewerProperties 00106 void setActionMode(const Viewer::ActionMode _am); 00107 void getActionMode(Viewer::ActionMode& _am); 00108 00109 // pick mode name handling for ViewerProperties 00110 void getPickMode(std::string& _name); 00111 00112 private: 00113 QGLWidget *glWidget_; 00114 00115 Viewer::ViewerProperties props_; 00116 00117 SimpleGLGraphicsScene *scene_; 00118 glViewer *mainWidget_; 00119 00120 Viewer::ActionMode actionMode_; 00121 }; 00122 00123 //============================================================================= 00124 00125 //============================================================================= 00126 #endif