• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdeedu
  • Sitemap
  • Contact Us
 

kalzium

camera.h

Go to the documentation of this file.
00001 /**********************************************************************
00002   Camera - Class for representing the view.
00003 
00004   Copyright (C) 2007 Benoit Jacob <jacob@math.jussieu.fr>
00005 
00006   This file is part of the Avogadro molecular editor project.
00007   For more information, see <http://avogadro.sourceforge.net/>
00008 
00009   Avogadro is free software; you can redistribute it and/or modify 
00010   it under the terms of the GNU General Public License as published by 
00011   the Free Software Foundation; either version 2 of the License, or 
00012   (at your option) any later version.
00013 
00014   Avogadro is distributed in the hope that it will be useful,
00015   but WITHOUT ANY WARRANTY; without even the implied warranty of
00016   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017   GNU General Public License for more details.
00018 
00019   You should have received a copy of the GNU General Public License
00020   along with this program; if not, write to the Free Software
00021   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00022   02110-1301, USA.
00023  **********************************************************************/
00024 
00025 #ifndef __CAMERA_H
00026 #define __CAMERA_H
00027 
00028 #include <avogadro/global.h>
00029 
00030 #include <eigen/projective.h>
00031 #include <eigen/matrix.h>
00032 #include <eigen/vector.h>
00033 
00034 namespace Avogadro {
00035 
00036   class GLWidget;
00037 
00065   class CameraPrivate;
00066   class A_EXPORT Camera
00067   {
00068     protected:
00069       friend class GLWidget;
00072       void setParent(const GLWidget *glwidget);
00073 
00084       void normalize();
00085 
00086     public:
00089       explicit Camera(const GLWidget *parent = 0, double angleOfViewY = 40.0);
00091       virtual ~Camera();
00094       const GLWidget *parent() const;
00098       void setAngleOfViewY(double angleOfViewY);
00101       double angleOfViewY() const;
00105       void setModelview(const Eigen::MatrixP3d &matrix);
00109       const Eigen::MatrixP3d & modelview() const;
00113       Eigen::MatrixP3d & modelview();
00120       void applyPerspective() const;
00126       void applyModelview() const;
00131       void initializeViewPoint();
00138       const double distance(const Eigen::Vector3d & point) const;
00145       void translate(const Eigen::Vector3d &vector);
00154       void pretranslate(const Eigen::Vector3d &vector);
00169       void rotate(const double &angle, const Eigen::Vector3d &axis);
00184       void prerotate(const double &angle, const Eigen::Vector3d &axis);
00185 
00196       Eigen::Vector3d unProject(const Eigen::Vector3d& v) const;
00197 
00213       Eigen::Vector3d unProject(const QPoint& p, const Eigen::Vector3d& ref) const;
00214 
00228       Eigen::Vector3d unProject(const QPoint& p) const;
00229 
00238       Eigen::Vector3d project(const Eigen::Vector3d& v) const;
00239 
00245       Eigen::Vector3d backtransformedXAxis() const;
00246       
00252       Eigen::Vector3d backtransformedYAxis() const;
00253       
00259       Eigen::Vector3d backtransformedZAxis() const;
00260 
00261     private:
00262       CameraPrivate * const d;
00263 
00264   };
00265 
00266 } // end namespace Avogadro
00267 
00268 #endif // __CAMERA_H

kalzium

Skip menu "kalzium"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeedu

Skip menu "kdeedu"
  • kalzium
  • kanagram
  • kig
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  •   docs
  •   src
  • parley
Generated for kdeedu by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal