Coin  4.0.3
Coin3D core library
Loading...
Searching...
No Matches
SbDPRotation.h
1#ifndef COIN_SBDPROTATION_H
2#define COIN_SBDPROTATION_H
3
4/**************************************************************************\
5 * Copyright (c) Kongsberg Oil & Gas Technologies AS
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are
10 * met:
11 *
12 * Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * Neither the name of the copyright holder nor the names of its
20 * contributors may be used to endorse or promote products derived from
21 * this software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34\**************************************************************************/
35
36#include <cstdio>
37#include <Inventor/SbVec4d.h>
38
39class SbDPMatrix;
40class SbVec3d;
41
43public:
44 SbDPRotation(void);
45 SbDPRotation(const SbVec3d & axis, const double radians);
46 SbDPRotation(const double q[4]);
47 SbDPRotation(const double q0, const double q1, const double q2, const double q3);
48 SbDPRotation(const SbDPMatrix & m);
50 const double * getValue(void) const;
51 void getValue(double & q0, double & q1, double & q2, double & q3) const;
52 SbDPRotation & setValue(const double q0, const double q1,
53 const double q2, const double q3);
54 void getValue(SbVec3d & axis, double & radians) const;
55 void getValue(SbDPMatrix & matrix) const;
56 SbDPRotation & invert(void);
57 SbDPRotation inverse(void) const;
58 SbDPRotation & setValue(const double q[4]);
59 SbDPRotation & setValue(const SbDPMatrix & m);
60 SbDPRotation & setValue(const SbVec3d & axis, const double radians);
61 SbDPRotation & setValue(const SbVec3d & rotateFrom, const SbVec3d & rotateTo);
62 SbBool equals(const SbDPRotation & r, double tolerance) const;
63 void multVec(const SbVec3d & src, SbVec3d & dst) const;
64
65 void scaleAngle(const double scaleFactor);
66 static SbDPRotation slerp(const SbDPRotation & rot0, const SbDPRotation & rot1,
67 double t);
68 static SbDPRotation identity(void);
69
70 void print(FILE * fp) const;
71
72 SbDPRotation & operator*=(const SbDPRotation & q);
73 SbDPRotation & operator*=(const double s);
74 friend COIN_DLL_API int operator==(const SbDPRotation & q1, const SbDPRotation & q2);
75 friend COIN_DLL_API int operator!=(const SbDPRotation & q1, const SbDPRotation & q2);
77private:
78 SbVec4d quat;
79};
80
82
83
87
88#endif // !COIN_SBDPROTATION_H
The SbDPMatrix class is a 4x4 dimensional representation of a double-precision matrix.
Definition SbDPMatrix.h:47
The SbDPRotation class represents a rotation in 3D space using double precision data.
Definition SbDPRotation.h:42
The SbList class is a template container class for lists.
Definition SbList.h:70
int operator!=(const SbList< Type > &l) const
Definition SbList.h:217
int operator==(const SbList< Type > &l) const
Definition SbList.h:209
The SbVec3d class is a 3 dimensional vector with double precision floating point coordinates.
Definition SbVec3d.h:50
The SbVec4d class is a 4 dimensional vector with double precision floating point coordinates.
Definition SbVec4d.h:49