VRender.h
Go to the documentation of this file.
00001 /*
00002  This file is part of the VRender library.
00003  Copyright (C) 2005 Cyril Soler (Cyril.Soler@imag.fr)
00004  Version 1.0.0, released on June 27, 2005.
00005 
00006  http://artis.imag.fr/Members/Cyril.Soler/VRender
00007 
00008  VRender is free software; you can redistribute it and/or modify
00009  it under the terms of the GNU General Public License as published by
00010  the Free Software Foundation; either version 2 of the License, or
00011  (at your option) any later version.
00012 
00013  VRender is distributed in the hope that it will be useful,
00014  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  GNU General Public License for more details.
00017 
00018  You should have received a copy of the GNU General Public License
00019  along with VRender; if not, write to the Free Software Foundation, Inc.,
00020  51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
00021 */
00022 
00023 /****************************************************************************
00024 
00025  Copyright (C) 2002-2013 Gilles Debunne. All rights reserved.
00026 
00027  This file is part of the QGLViewer library version 2.4.0.
00028 
00029  http://www.libqglviewer.com - contact@libqglviewer.com
00030 
00031  This file may be used under the terms of the GNU General Public License 
00032  versions 2.0 or 3.0 as published by the Free Software Foundation and
00033  appearing in the LICENSE file included in the packaging of this file.
00034  In addition, as a special exception, Gilles Debunne gives you certain 
00035  additional rights, described in the file GPL_EXCEPTION in this package.
00036 
00037  libQGLViewer uses dual licensing. Commercial/proprietary software must
00038  purchase a libQGLViewer Commercial License.
00039 
00040  This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00041  WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00042 
00043 *****************************************************************************/
00044 
00045 #ifndef _VRENDER_H_
00046 #define _VRENDER_H_
00047 
00048 #include "../config.h"
00049 #if QT_VERSION >= 0x040000
00050 # include <QTextStream>
00051 # include <QString>
00052 #else
00053 # include <qtextstream.h>
00054 # include <qstring.h>
00055 #endif
00056 
00057 #include "../qglviewer.h"
00058 
00059 namespace vrender
00060 {
00061         class VRenderParams ;
00062         typedef void (*RenderCB)(void *) ;
00063         typedef void (*ProgressFunction)(float,const QString&) ;
00064 
00065         void VectorialRender(RenderCB DrawFunc, void *callback_params, VRenderParams& render_params) ;
00066 
00067         class VRenderParams
00068         {
00069                 public:
00070                         VRenderParams() ;
00071                         ~VRenderParams() ;
00072 
00073                         enum VRenderSortMethod { NoSorting, BSPSort, TopologicalSort, AdvancedTopologicalSort };
00074                         enum VRenderFormat     { EPS, PS, XFIG, SVG };
00075 
00076                         enum VRenderOption {    CullHiddenFaces         = 0x1,
00077                                                 OptimizeBackFaceCulling = 0x4,
00078                                                 RenderBlackAndWhite     = 0x8,
00079                                                 AddBackground           = 0x10,
00080                                                 TightenBoundingBox      = 0x20 } ;
00081 
00082                         int sortMethod()    { return _sortMethod; }
00083                         void setSortMethod(VRenderParams::VRenderSortMethod s) { _sortMethod = s ; }
00084 
00085                         int format()        { return _format; }
00086                         void setFormat(VRenderFormat f) { _format = f; }
00087 
00088                         const QString filename() { return _filename ; }
00089                         void setFilename(const QString& filename) ;
00090 
00091                         void setOption(VRenderOption,bool) ;
00092                         bool isEnabled(VRenderOption) ;
00093 
00094                         void setProgressFunction(ProgressFunction pf) { _progress_function = pf ; }
00095 
00096                 private:
00097                         int _error;
00098                         VRenderSortMethod _sortMethod;
00099                         VRenderFormat     _format ;
00100 
00101                         ProgressFunction _progress_function ;
00102 
00103                         unsigned int _options; // _DrawMode; _ClearBG; _TightenBB;
00104                         QString _filename;
00105 
00106                         friend void VectorialRender(    RenderCB render_callback,
00107                                                         void *callback_params,
00108                                                         VRenderParams& vparams);
00109                         friend class ParserGL ;
00110                         friend class Exporter ;
00111                         friend class BSPSortMethod ;
00112                         friend class VisibilityOptimizer ;
00113                         friend class TopologicalSortMethod ;
00114                         friend class TopologicalSortUtils ;
00115 
00116                         int& error() { return _error ; }
00117                         int& size()  { static int size=1000000; return size ; }
00118 
00119                         void progress(float,const QString&) ;
00120         };
00121 }
00122 #endif
00123 


octovis
Author(s): Kai M. Wurm , Armin Hornung
autogenerated on Thu Aug 27 2015 14:13:26