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

SbDPRotation.h
1#ifndef COIN_SBDPROTATION_H
2#define COIN_SBDPROTATION_H
3
4/**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25\**************************************************************************/
26
27#include <stdio.h>
28#include <Inventor/SbVec4d.h>
29
30class SbDPMatrix;
31class SbVec3d;
32
33class COIN_DLL_API SbDPRotation {
34public:
35 SbDPRotation(void);
36 SbDPRotation(const SbVec3d & axis, const double radians);
37 SbDPRotation(const double q[4]);
38 SbDPRotation(const double q0, const double q1, const double q2, const double q3);
39 SbDPRotation(const SbDPMatrix & m);
40 SbDPRotation(const SbVec3d & rotateFrom, const SbVec3d & rotateTo);
41 const double * getValue(void) const;
42 void getValue(double & q0, double & q1, double & q2, double & q3) const;
43 SbDPRotation & setValue(const double q0, const double q1,
44 const double q2, const double q3);
45 void getValue(SbVec3d & axis, double & radians) const;
46 void getValue(SbDPMatrix & matrix) const;
47 SbDPRotation & invert(void);
48 SbDPRotation inverse(void) const;
49 SbDPRotation & setValue(const double q[4]);
50 SbDPRotation & setValue(const SbDPMatrix & m);
51 SbDPRotation & setValue(const SbVec3d & axis, const double radians);
52 SbDPRotation & setValue(const SbVec3d & rotateFrom, const SbVec3d & rotateTo);
53 SbDPRotation & operator*=(const SbDPRotation & q);
54 SbDPRotation & operator*=(const double s);
55 friend COIN_DLL_API int operator==(const SbDPRotation & q1, const SbDPRotation & q2);
56 friend COIN_DLL_API int operator!=(const SbDPRotation & q1, const SbDPRotation & q2);
57 SbBool equals(const SbDPRotation & r, const double tolerance) const;
58 friend COIN_DLL_API SbDPRotation operator *(const SbDPRotation & q1, const SbDPRotation & q2);
59 void multVec(const SbVec3d & src, SbVec3d & dst) const;
60
61 void scaleAngle(const double scaleFactor);
62 static SbDPRotation slerp(const SbDPRotation & rot0, const SbDPRotation & rot1,
63 double t);
64 static SbDPRotation identity(void);
65
66 void print(FILE * fp) const;
67
68private:
69 SbVec4d quat;
70};
71
72COIN_DLL_API int operator ==(const SbDPRotation & q1, const SbDPRotation & q2);
73COIN_DLL_API int operator !=(const SbDPRotation & q1, const SbDPRotation & q2);
74COIN_DLL_API SbDPRotation operator *(const SbDPRotation & q1, const SbDPRotation & q2);
75
76#endif // !COIN_SBDPROTATION_H
The SbDPMatrix class is a 4x4 dimensional representation of a double-precision matrix.
Definition SbDPMatrix.h:38
The SbDPRotation class represents a rotation in 3D space.
Definition SbDPRotation.h:33
The SbVec3d class is a 3 dimensional vector with double precision floating point coordinates.
Definition SbVec3d.h:39
The SbVec4d class is a 4 dimensional vector with double precision floating point coordinates.
Definition SbVec4d.h:40

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

Generated on Wed Jul 17 2024 for Coin by Doxygen 1.12.0.