Hugin trunk 0.1
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Friends | List of all members
Vector3 Class Reference

general : Vector3 is a class for handling 3D Vectors manipulation. More...

#include <Vector3.h>

Public Member Functions

 Vector3 ()
 default constructor
 
 Vector3 (double a, double b, double c)
 constructor with initialisation
 
 Vector3 (const Vector3 &v)
 copy contructor
 
Vector3operator= (const Vector3 &v)
 copy operator
 
void Set (double a, double b, double c)
 set
 
bool operator== (const Vector3 &v) const
 comparison : equality
 
bool operator!= (const Vector3 &v) const
 comparison : not equal
 
bool IsZero () const
 comparison : zero
 
bool IsNearlyZero () const
 comparison : nearly zero
 
bool IsNearlyEqual (const Vector3 &v) const
 comparison : nearly equal
 
Vector3 operator+ (const Vector3 &v) const
 operator +
 
Vector3 operator- (const Vector3 &v) const
 operator -
 
Vector3 operator* (double Scale) const
 operator *(double)
 
Vector3 operator/ (double Scale) const
 operator /(double)
 
Vector3 operator- () const
 Unary minus.
 
Vector3 operator+= (const Vector3 &v)
 operator +=
 
Vector3 operator-= (const Vector3 &v)
 operator -=
 
Vector3 operator*= (double Scale)
 double multiply
 
Vector3 operator/= (double Scale)
 double divide
 
double Norm () const
 euclidien norm
 
double NormSquared () const
 squared norm
 
Vector3 Cross (const Vector3 &v) const
 cross product
 
double Dot (const Vector3 &v) const
 dot product
 
bool Normalize ()
 Normalize.
 
Vector3 GetNormalized () const
 return a normalized vector
 

Public Attributes

double x
 x,y,z coordinates, 0 at the initialisation
 
double y
 
double z
 

Friends

Vector3 operator* (double Scale, const Vector3 &v)
 operator *
 

Detailed Description

general : Vector3 is a class for handling 3D Vectors manipulation.

We made a choose to store only a 3 dimensions vectors to speed up system when we change of view point. A general 3D transformation could be placed in a 4x4 matrix, but some of the coefficients are always null. So that's waste of time.

Definition at line 43 of file Vector3.h.

Constructor & Destructor Documentation

◆ Vector3() [1/3]

Vector3::Vector3 ( )
inline

default constructor

Definition at line 52 of file Vector3.h.

Referenced by operator/().

◆ Vector3() [2/3]

Vector3::Vector3 ( double  a,
double  b,
double  c 
)
inline

constructor with initialisation

Definition at line 55 of file Vector3.h.

◆ Vector3() [3/3]

Vector3::Vector3 ( const Vector3 v)
inline

copy contructor

Definition at line 58 of file Vector3.h.

References threshold().

Member Function Documentation

◆ Cross()

Vector3 Vector3::Cross ( const Vector3 v) const
inline

◆ Dot()

double Vector3::Dot ( const Vector3 v) const
inline

dot product

Definition at line 169 of file Vector3.h.

References threshold().

◆ GetNormalized()

Vector3 Vector3::GetNormalized ( ) const

return a normalized vector

Definition at line 95 of file Vector3.cpp.

References EPSILON, threshold(), x, y, and z.

Referenced by GetRotationAroundU(), and PanosphereOverviewToolHelper::MouseMoved().

◆ IsNearlyEqual()

bool Vector3::IsNearlyEqual ( const Vector3 v) const

comparison : nearly equal

Definition at line 45 of file Vector3.cpp.

References EPSILON, threshold(), x, y, and z.

◆ IsNearlyZero()

bool Vector3::IsNearlyZero ( ) const

comparison : nearly zero

Definition at line 39 of file Vector3.cpp.

References EPSILON, threshold(), x, y, and z.

◆ IsZero()

bool Vector3::IsZero ( ) const

comparison : zero

Definition at line 33 of file Vector3.cpp.

References x, y, and z.

◆ Norm()

double Vector3::Norm ( ) const

euclidien norm

Definition at line 68 of file Vector3.cpp.

References threshold(), x, y, and z.

◆ Normalize()

bool Vector3::Normalize ( )

Normalize.

Definition at line 80 of file Vector3.cpp.

References EPSILON, threshold(), x, y, and z.

◆ NormSquared()

double Vector3::NormSquared ( ) const

squared norm

Definition at line 74 of file Vector3.cpp.

References x, y, and z.

◆ operator!=()

bool Vector3::operator!= ( const Vector3 v) const
inline

comparison : not equal

Definition at line 79 of file Vector3.h.

References threshold().

◆ operator*()

Vector3 Vector3::operator* ( double  Scale) const
inline

operator *(double)

Definition at line 112 of file Vector3.h.

References threshold().

◆ operator*=()

Vector3 Vector3::operator*= ( double  Scale)
inline

double multiply

Definition at line 145 of file Vector3.h.

References threshold().

◆ operator+()

Vector3 Vector3::operator+ ( const Vector3 v) const
inline

operator +

Definition at line 100 of file Vector3.h.

References threshold().

◆ operator+=()

Vector3 Vector3::operator+= ( const Vector3 v)
inline

operator +=

Definition at line 127 of file Vector3.h.

References threshold(), and x.

◆ operator-() [1/2]

Vector3 Vector3::operator- ( ) const
inline

Unary minus.

Definition at line 121 of file Vector3.h.

◆ operator-() [2/2]

Vector3 Vector3::operator- ( const Vector3 v) const
inline

operator -

Definition at line 106 of file Vector3.h.

References threshold().

◆ operator-=()

Vector3 Vector3::operator-= ( const Vector3 v)
inline

operator -=

Definition at line 136 of file Vector3.h.

References threshold(), and x.

◆ operator/()

Vector3 Vector3::operator/ ( double  Scale) const

operator /(double)

Definition at line 51 of file Vector3.cpp.

References threshold(), Vector3(), x, y, and z.

◆ operator/=()

Vector3 Vector3::operator/= ( double  Scale)

double divide

Definition at line 58 of file Vector3.cpp.

References threshold(), x, y, and z.

◆ operator=()

Vector3 & Vector3::operator= ( const Vector3 v)
inline

copy operator

Definition at line 61 of file Vector3.h.

References threshold(), and x.

◆ operator==()

bool Vector3::operator== ( const Vector3 v) const
inline

comparison : equality

Definition at line 73 of file Vector3.h.

References threshold().

◆ Set()

void Vector3::Set ( double  a,
double  b,
double  c 
)

set

Definition at line 30 of file Vector3.cpp.

References x, y, and z.

Friends And Related Symbol Documentation

◆ operator*

Vector3 operator* ( double  Scale,
const Vector3 v 
)
friend

operator *

Definition at line 94 of file Vector3.h.

Member Data Documentation

◆ x

double Vector3::x

◆ y

double Vector3::y

◆ z

double Vector3::z

The documentation for this class was generated from the following files: