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.
Definition: SbVec3d.h:50
SbVec3d(const SbVec3b &v)
Definition: SbVec3d.h:56
const double * getValue(void) const
Definition: SbVec3d.h:72
void getValue(double &x, double &y, double &z) const
Definition: SbVec3d.h:73
The SbDPPlane class represents a plane in 3D space.
Definition: SbDPPlane.h:43
SbVec3d & setValue(double x, double y, double z)
Definition: SbVec3d.h:62
int operator==(const SbBox2s &b1, const SbBox2s &b2)
Definition: SbBox2s.h:102
double sqrLength(void) const
Definition: SbVec3d.h:83
SbVec3d(double x, double y, double z)
Definition: SbVec3d.h:54
SbVec3d(const SbVec3f &v)
Definition: SbVec3d.h:55
SbVec2s operator-(const SbVec2s &v1, const SbVec2s &v2)
The SbVec3s class is a 3 dimensional vector with short integer coordinates.
Definition: SbVec3s.h:51
int operator!=(const SbBox2s &b1, const SbBox2s &b2)
Definition: SbBox2s.h:106
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.
Definition: SbVec3f.h:51
SbVec3d(const SbVec3i32 &v)
Definition: SbVec3d.h:58
Definition: SbVec3i32.h:48
double dot(const SbVec3d &v) const
Definition: SbVec3d.h:79
SbVec2s operator/(const SbVec2s &v, int d)
SbVec2s operator*(const SbVec2s &v, int d)
The SbString class is a string class with convenience functions for string operations.
Definition: SbString.h:52
void negate(void)
Definition: SbVec3d.h:84
SbVec2s operator+(const SbVec2s &v1, const SbVec2s &v2)