coordinateframe.h
Go to the documentation of this file.
00001 /****************************************************************************
00002  * MeshLab                                                           o o     *
00003  * A versatile mesh processing toolbox                             o     o   *
00004  *                                                                _   O  _   *
00005  * Copyright(C) 2008                                                \/)\/    *
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 $Log: not supported by cvs2svn $
00026 Revision 1.7  2008/03/14 16:54:34  benedetti
00027 Added doxygen documentation
00028 
00029 Revision 1.6  2008/03/02 16:44:18  benedetti
00030 moved ActiveCoordinateFrame to its own files
00031 
00032 Revision 1.5  2008/02/22 20:04:02  benedetti
00033 many user interface improvements, cleaned up a little
00034 
00035 Revision 1.4  2008/02/17 20:52:53  benedetti
00036 some generalization made
00037 
00038 Revision 1.3  2008/02/16 14:12:30  benedetti
00039 first version
00040 
00041 
00042 ****************************************************************************/
00043 #ifndef COORDINATEFRAME_H
00044 #define COORDINATEFRAME_H
00045 
00046 
00047 #include <vcg/math/similarity.h>
00048 #include <vcg/space/color4.h>
00049 
00050 #include <QGLWidget>
00051 
00052 namespace vcg {
00053 
00059 class CoordinateFrame
00060 {
00061 public:
00062   // functions:
00069   CoordinateFrame(float size);
00070 
00076   virtual ~CoordinateFrame() {}
00077 
00083   virtual void Render(QGLWidget* glw,QPainter* p = NULL);
00084   // data
00085 
00087   Color4b basecolor;
00088 
00090   Color4b xcolor;
00091 
00093   Color4b ycolor;
00094 
00096   Color4b zcolor;
00097 
00099   float size;
00100 
00102   float linewidth;
00103 
00105   QFont font;
00106 
00108   bool drawaxis;
00109 
00111   bool drawlabels;
00112 
00114   bool drawvalues;
00115 
00116   // useful functions:
00117   static void drawTickedLine(const Point3d &, const Point3d &, float, float,float);
00118   static float calcSlope(const Point3d &, const Point3d &, float, int , double *, double *, GLint *);
00119   static float niceRound(float);
00120 };
00121 
00127 class MovableCoordinateFrame: public CoordinateFrame
00128 {
00129 
00130 public:
00137   MovableCoordinateFrame(float);
00138 
00144   virtual ~MovableCoordinateFrame(){}
00145 
00151   virtual void Render(QGLWidget* glw,QPainter* p = NULL);
00152 
00159   virtual void Reset(bool reset_position,bool reset_alignment);
00160 
00166   virtual void SetPosition(const Point3f new_position);
00167 
00173   virtual void SetRotation(const Quaternionf rotation);
00174 
00180   virtual Point3f GetPosition();
00181 
00187   virtual Quaternionf GetRotation();
00188 
00194   virtual void GetTransform(Matrix44f &m);
00195 
00202   virtual void Rot(float angle,const Point3f axis);
00203 
00218   virtual void AlignWith(const Point3f primary, const Point3f secondary, const char axis_1, const char axis_2);
00219 
00220 protected:
00221   // data:
00222   Point3f position;
00223   Quaternionf rotation;
00224 
00225   // functions:
00226   virtual void Move(const Similarityf);
00227   void RotateToAlign(const Point3f, const Point3f);
00228 
00229 };
00230 
00231 }//namespace
00232 #endif /*COORDINATEFRAME_H*/


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