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

SbVec4d.h
1 #ifndef COIN_SBVEC4D_H
2 #define COIN_SBVEC4D_H
3 
4 /**************************************************************************\
5  *
6  * This file is part of the Coin 3D visualization library.
7  * Copyright (C) 1998-2007 by Systems in Motion. All rights reserved.
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 Systems in Motion about acquiring
18  * a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
23  * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24  *
25 \**************************************************************************/
26 
27 #include <stdio.h>
28 
29 #include <Inventor/SbBasic.h>
30 
31 class SbVec4f;
32 class SbVec3d;
33 
34 class COIN_DLL_API SbVec4d {
35 public:
36  SbVec4d(void);
37  SbVec4d(const double v[4]);
38  SbVec4d(const double x, const double y, const double z, const double w);
39  explicit SbVec4d(const SbVec4f & v) { setValue(v); }
40 
41  double dot(const SbVec4d& v) const;
42  SbBool equals(const SbVec4d& v, const double tolerance) const;
43  void getReal(SbVec3d& v) const;
44  const double * getValue(void) const;
45  void getValue(double& x, double& y, double& z, double& w) const;
46  double length(void) const;
47  double sqrLength(void) const;
48  void negate(void);
49  double normalize(void);
50  SbVec4d& setValue(const double v[4]);
51  SbVec4d& setValue(const double x, const double y, const double z,
52  const double w);
53  SbVec4d & setValue(const SbVec4f & v);
54  double& operator [](const int i);
55  const double& operator [](const int i) const;
56  SbVec4d& operator *=(const double d);
57  SbVec4d& operator /=(const double d);
58  SbVec4d& operator +=(const SbVec4d& u);
59  SbVec4d& operator -=(const SbVec4d& u);
60  SbVec4d operator -(void) const;
61  friend COIN_DLL_API SbVec4d operator *(const SbVec4d& v, const double d);
62  friend COIN_DLL_API SbVec4d operator *(const double d, const SbVec4d& v);
63  friend COIN_DLL_API SbVec4d operator /(const SbVec4d& v, const double d);
64  friend COIN_DLL_API SbVec4d operator +(const SbVec4d& v1, const SbVec4d& v2);
65  friend COIN_DLL_API SbVec4d operator -(const SbVec4d& v1, const SbVec4d& v2);
66  friend COIN_DLL_API int operator ==(const SbVec4d& v1, const SbVec4d& v2);
67  friend COIN_DLL_API int operator !=(const SbVec4d& v1, const SbVec4d& v2);
68 
69  void print(FILE * fp) const;
70 
71 private:
72  double vec[4];
73 };
74 
75 COIN_DLL_API SbVec4d operator *(const SbVec4d& v, const double d);
76 COIN_DLL_API SbVec4d operator *(const double d, const SbVec4d& v);
77 COIN_DLL_API SbVec4d operator /(const SbVec4d& v, const double d);
78 COIN_DLL_API SbVec4d operator +(const SbVec4d& v1, const SbVec4d& v2);
79 COIN_DLL_API SbVec4d operator -(const SbVec4d& v1, const SbVec4d& v2);
80 COIN_DLL_API int operator ==(const SbVec4d& v1, const SbVec4d& v2);
81 COIN_DLL_API int operator !=(const SbVec4d& v1, const SbVec4d& v2);
82 
83 #endif // !COIN_SBVEC4D_H
The SbVec4f class is a 4 dimensional vector with floating point coordinates.
Definition: SbVec4f.h:34
The SbVec3d class is a 3 dimensional vector with double precision floating point coordinates.
Definition: SbVec3d.h:35
int operator!=(const SbBox2i32 &b1, const SbBox2i32 &b2)
Definition: SbBox2i32.h:91
The SbVec4d class is a 4 dimensional vector with double precision floating point coordinates.
Definition: SbVec4d.h:34
SbVec4d(const SbVec4f &v)
Definition: SbVec4d.h:39
int operator==(const SbBox2i32 &b1, const SbBox2i32 &b2)
Definition: SbBox2i32.h:87

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Fri Jul 20 2018 for Coin by Doxygen. 1.8.14