37 #include <Inventor/SbBasic.h>
38 #include <Inventor/SbString.h>
41 #include <Inventor/errors/SoDebugError.h>
53 SbVec3d(
const double v[3]) { vec[0] = v[0]; vec[1] = v[1]; vec[2] = v[2]; }
54 SbVec3d(
double x,
double y,
double z) { vec[0] = x; vec[1] = y; vec[2] = z; }
61 SbVec3d &
setValue(
const double v[3]) { vec[0] = v[0]; vec[1] = v[1]; vec[2] = v[2];
return *
this; }
62 SbVec3d &
setValue(
double x,
double y,
double z) { vec[0] = x; vec[1] = y; vec[2] = z;
return *
this; }
72 const double *
getValue(
void)
const {
return vec; }
73 void getValue(
double & x,
double & y,
double & z)
const { x = vec[0]; y = vec[1]; z = vec[2]; }
75 double & operator [] (
const int i) {
return vec[i]; }
76 const double & operator [] (
const int i)
const {
return vec[i]; }
79 double dot(
const SbVec3d & v)
const {
return vec[0] * v.vec[0] + vec[1] * v.vec[1] + vec[2] * v.vec[2]; }
80 SbBool equals(
const SbVec3d & v,
double tolerance)
const;
81 SbVec3d getClosestAxis(
void)
const;
82 double length(
void)
const;
83 double sqrLength(
void)
const {
return vec[0] * vec[0] + vec[1] * vec[1] + vec[2] * vec[2]; }
84 void negate(
void) { vec[0] = -vec[0]; vec[1] = -vec[1]; vec[2] = -vec[2]; }
85 double normalize(
void);
87 SbVec3d & operator *= (
double d) { vec[0] *= d; vec[1] *= d; vec[2] *= d;
return *
this; }
88 SbVec3d & operator /= (
double d) { SbDividerChk(
"SbVec3d::operator/=(double)", d);
return operator *= (1.0 / d); }
89 SbVec3d & operator += (
const SbVec3d & v) { vec[0] += v[0]; vec[1] += v[1]; vec[2] += v[2];
return *
this; }
90 SbVec3d & operator -= (
const SbVec3d & v) { vec[0] -= v[0]; vec[1] -= v[1]; vec[2] -= v[2];
return *
this; }
91 SbVec3d operator - (
void)
const {
return SbVec3d(-vec[0], -vec[1], -vec[2]); }
94 SbBool fromString(
const SbString & str);
96 void print(FILE * fp)
const;
104 SbVec3d val(v); val *= d;
return val;
108 SbVec3d val(v); val *= d;
return val;
112 SbDividerChk(
"operator/(SbVec3d,double)", d);
113 SbVec3d val(v); val /= d;
return val;
117 SbVec3d v(v1); v += v2;
return v;
121 SbVec3d v(v1); v -= v2;
return v;
125 return ((v1[0] == v2[0]) && (v1[1] == v2[1]) && (v1[2] == v2[2]));
132 #endif // !COIN_SBVEC3D_H
SbVec3d(const SbVec3s &v)
Definition: SbVec3d.h:57
SbVec3d & setValue(const double v[3])
Definition: SbVec3d.h:61
The SbVec3d class is a 3 dimensional vector with double precision floating point coordinates.This vector class provides storage for a 3 dimensional double precision floating point vector aswell as simple floating point arithmetic operations.
Definition: SbVec3d.h:50
SbVec3d(const SbVec3b &v)
Definition: SbVec3d.h:56
The SbDPPlane class represents a plane in 3D space.SbDPPlane is used by many other classes in Coin...
Definition: SbDPPlane.h:43
int operator!=(const SbBox2d &b1, const SbBox2d &b2)
Definition: SbBox2d.h:106
void getValue(double &x, double &y, double &z) const
Definition: SbVec3d.h:73
SbVec3d & setValue(double x, double y, double z)
Definition: SbVec3d.h:62
int operator==(const SbBox2d &b1, const SbBox2d &b2)
Definition: SbBox2d.h:102
SbVec3d(double x, double y, double z)
Definition: SbVec3d.h:54
SbVec3d(const SbVec3f &v)
Definition: SbVec3d.h:55
The SbVec3s class is a 3 dimensional vector with short integer coordinates.This vector class provides...
Definition: SbVec3s.h:51
SbVec3d(const double v[3])
Definition: SbVec3d.h:53
SbVec3d(void)
Definition: SbVec3d.h:52
The SbVec3f class is a 3 dimensional vector with floating point coordinates.This vector class is used...
Definition: SbVec3f.h:51
SbVec3d(const SbVec3i32 &v)
Definition: SbVec3d.h:58
SbVec2d operator*(const SbVec2d &v, double d)
Definition: SbVec2d.h:91
SbVec2d operator-(const SbVec2d &v1, const SbVec2d &v2)
Definition: SbVec2d.h:108
Definition: SbVec3i32.h:48
SbVec2d operator/(const SbVec2d &v, double d)
Definition: SbVec2d.h:99
double dot(const SbVec3d &v) const
Definition: SbVec3d.h:79
SbVec2d operator+(const SbVec2d &v1, const SbVec2d &v2)
Definition: SbVec2d.h:104
The SbString class is a string class with convenience functions for string operations.This is the class used for storing and working with character strings. It automatically takes care of supporting all the "bookkeeping" tasks usually associated with working with character strings, like memory allocation and deallocation etc.
Definition: SbString.h:52
const double * getValue(void) const
Definition: SbVec3d.h:72
void negate(void)
Definition: SbVec3d.h:84
double sqrLength(void) const
Definition: SbVec3d.h:83