Coin Logo http://www.sim.no/
http://www.coin3d.org/

SbDPRotation.h
00001 #ifndef COIN_SBDPROTATION_H
00002 #define COIN_SBDPROTATION_H
00003 
00004 /**************************************************************************\
00005  *
00006  *  This file is part of the Coin 3D visualization library.
00007  *  Copyright (C) by Kongsberg Oil & Gas Technologies.
00008  *
00009  *  This library is free software; you can redistribute it and/or
00010  *  modify it under the terms of the GNU General Public License
00011  *  ("GPL") version 2 as published by the Free Software Foundation.
00012  *  See the file LICENSE.GPL at the root directory of this source
00013  *  distribution for additional information about the GNU GPL.
00014  *
00015  *  For using Coin with software that can not be combined with the GNU
00016  *  GPL, and for taking advantage of the additional benefits of our
00017  *  support services, please contact Kongsberg Oil & Gas Technologies
00018  *  about acquiring a Coin Professional Edition License.
00019  *
00020  *  See http://www.coin3d.org/ for more information.
00021  *
00022  *  Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
00023  *  http://www.sim.no/  sales@sim.no  coin-support@coin3d.org
00024  *
00025 \**************************************************************************/
00026 
00027 #include <stdio.h>
00028 #include <Inventor/SbVec4d.h>
00029 
00030 class SbDPMatrix;
00031 class SbVec3d;
00032 
00033 class COIN_DLL_API SbDPRotation {
00034 public:
00035   SbDPRotation(void);
00036   SbDPRotation(const SbVec3d & axis, const double radians);
00037   SbDPRotation(const double q[4]);
00038   SbDPRotation(const double q0, const double q1, const double q2, const double q3);
00039   SbDPRotation(const SbDPMatrix & m);
00040   SbDPRotation(const SbVec3d & rotateFrom, const SbVec3d & rotateTo);
00041   const double * getValue(void) const;
00042   void getValue(double & q0, double & q1, double & q2, double & q3) const;
00043   SbDPRotation & setValue(const double q0, const double q1,
00044                         const double q2, const double q3);
00045   void getValue(SbVec3d & axis, double & radians) const;
00046   void getValue(SbDPMatrix & matrix) const;
00047   SbDPRotation & invert(void);
00048   SbDPRotation inverse(void) const;
00049   SbDPRotation & setValue(const double q[4]);
00050   SbDPRotation & setValue(const SbDPMatrix & m);
00051   SbDPRotation & setValue(const SbVec3d & axis, const double radians);
00052   SbDPRotation & setValue(const SbVec3d & rotateFrom, const SbVec3d & rotateTo);
00053   SbDPRotation & operator*=(const SbDPRotation & q);
00054   SbDPRotation & operator*=(const double s);
00055   friend COIN_DLL_API int operator==(const SbDPRotation & q1, const SbDPRotation & q2);
00056   friend COIN_DLL_API int operator!=(const SbDPRotation & q1, const SbDPRotation & q2);
00057   SbBool equals(const SbDPRotation & r, const double tolerance) const;
00058   friend COIN_DLL_API SbDPRotation operator *(const SbDPRotation & q1, const SbDPRotation & q2);
00059   void multVec(const SbVec3d & src, SbVec3d & dst) const;
00060 
00061   void scaleAngle(const double scaleFactor);
00062   static SbDPRotation slerp(const SbDPRotation & rot0, const SbDPRotation & rot1,
00063                           double t);
00064   static SbDPRotation identity(void);
00065 
00066   void print(FILE * fp) const;
00067 
00068 private:
00069   SbVec4d quat;
00070 };
00071 
00072 COIN_DLL_API int operator ==(const SbDPRotation & q1, const SbDPRotation & q2);
00073 COIN_DLL_API int operator !=(const SbDPRotation & q1, const SbDPRotation & q2);
00074 COIN_DLL_API SbDPRotation operator *(const SbDPRotation & q1, const SbDPRotation & q2);
00075 
00076 #endif // !COIN_SBDPROTATION_H

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated on Thu Apr 28 2011 03:43:03 for Coin by Doxygen 1.7.4.