deprecated_math.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 
00025 #ifndef VCG_GL_MATH_H
00026 #define VCG_GL_MATH_H
00027 
00028 // Please note that this file assume that you have already included your 
00029 // gl-extension wrapping utility, and that therefore all the extension symbol are already defined.
00030 
00031 #include <vcg/math/matrix44.h>
00032 #include <vcg/math/similarity.h>
00033 //#include <GL/glew.h> // please do not include it!
00034 
00035 
00036 namespace vcg {
00037 
00038 inline void glMultMatrixE(const Matrix44f &matrix) {
00039 
00040     glMultMatrixf((const GLfloat *)(matrix.transpose().V()));
00041   
00042 }
00043 
00044 inline void glMultMatrix(const Matrix44f &matrix) {
00045     glMultMatrixf((const GLfloat *)(matrix.transpose().V()));
00046 }
00047 
00048 inline void glMultMatrixE(const Matrix44d &matrix) {
00049  
00050     glMultMatrixd((const GLdouble *)(matrix.transpose().V()));
00051 
00052 }
00053 inline void glMultMatrix(const Matrix44d &matrix) {
00054     glMultMatrixd((const GLdouble *)(matrix.transpose().V()));
00055 }
00056 
00057 inline void glLoadMatrix(const Matrix44d &matrix) {
00058     glLoadMatrixd((const GLdouble *)(matrix.transpose().V()));
00059 }
00060 inline void glLoadMatrix(const Matrix44f &matrix) {
00061     glLoadMatrixf((const GLfloat *)(matrix.transpose().V()));
00062 }
00063 
00064 
00065 inline void glMultMatrixDirect(const Matrix44f &matrix) {
00066    glMultMatrixf((const GLfloat *)(matrix.V()));
00067 }
00068 
00069 inline void glMultMatrixDirect(const Matrix44d &matrix) {
00070    glMultMatrixd((const GLdouble *)(matrix.V()));
00071 }
00072 
00073 inline void glMultMatrix(const Similarityf &s) {
00074   glTranslatef(s.tra[0], s.tra[1], s.tra[2]);
00075   glScalef(s.sca, s.sca, s.sca);
00076   float alpha;
00077   Point3f axis;
00078   s.rot.ToAxis(alpha, axis);    
00079   glRotatef(math::ToDeg(alpha), axis[0], axis[1], axis[2]);    
00080   
00081 }
00082 
00083 inline void glMultMatrix(const Similarityd &s) {
00084   glTranslated(s.tra[0], s.tra[1], s.tra[2]);
00085   double alpha;
00086   Point3d axis;
00087   s.rot.ToAxis(alpha, axis);
00088   glRotated(math::ToDeg(alpha), axis[0], axis[1], axis[2]);
00089   glScaled(s.sca, s.sca, s.sca);
00090 }
00091 
00092 inline void glGetv(const GLenum  pname, Matrix44f  & m){
00093         Matrix44f tmp;
00094         glGetFloatv(pname,tmp.V());
00095   m = tmp.transpose();
00096 }
00097 
00098 inline void glGetv(const GLenum  pname, Matrix44d  & m){
00099   Matrix44d tmp;
00100         glGetDoublev(pname,tmp.V());
00101   m = tmp.transpose();
00102 }
00103 
00104 inline void glGetDirectv(const GLenum  pname, Matrix44f  & m){
00105         glGetFloatv(pname,m.V());
00106 }
00107 
00108 inline void glGetDirecv(const GLenum  pname, Matrix44d  & m){
00109         glGetDoublev(pname,m.V());
00110 }
00111 
00112 
00113 }//namespace
00114 #endif


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