SOFA API  b3f2f2a4
Open source framework for multi-physics simuation
vrender::Vector3 Class Reference

#include <Vector3.h>

Static Public Attributes

Constant
static const Vector3 inf
 

Public Member Functions

Constructor(s) and destructor
 Vector3 ()
 
 ~Vector3 ()
 Default destructor. More...
 
 Vector3 (const Vector3 &)
 Copy constructor. More...
 
 Vector3 (const NVector3 &)
 Copy constructor from a normalized vector. More...
 
 Vector3 (double, double, double)
 Create a vector from real values. More...
 
Access methods
double x () const
 
double y () const
 
double z () const
 
void setX (double r)
 
void setY (double r)
 
void setZ (double r)
 
void setXYZ (double x, double y, double z)
 
Assignment
Vector3operator= (const Vector3 &u)
 
Vector3operator= (const NVector3 &u)
 Assignment with a normalized vector. More...
 
Metrics
double norm () const
 Norm. More...
 
double squareNorm () const
 Square norm (self dot product) More...
 
double infNorm () const
 Infinite norm. More...
 

Friends

Comparisons
bool operator== (const Vector3 &, const Vector3 &)
 
bool operator!= (const Vector3 &, const Vector3 &)
 

Stream overrides

Should be used for most comparisons, for efficiency reasons.

double operator[] (int i) const
 
double & operator[] (int i)
 
std::ostream & operator<< (std::ostream &, const Vector3 &)
 

Algebraic operations

Vector3operator+= (const Vector3 &v)
 
Vector3operator-= (const Vector3 &v)
 
Vector3operator*= (double f)
 
Vector3operator/= (double f)
 
Vector3operator-= (const NVector3 &)
 Self substraction with a normalized vector. More...
 
Vector3operator+= (const NVector3 &)
 Self addition with a normalized vector. More...
 
Vector3 operator+ (const Vector3 &u) const
 
Vector3 operator- (const Vector3 &u) const
 
double operator* (const Vector3 &u) const
 
Vector3 operator^ (const Vector3 &v) const
 
Vector3 operator/ (double v)
 
Vector3 operator* (double v)
 
Vector3 operator- (const Vector3 &u)
 
Vector3 operator* (double, const Vector3 &)
 
static Vector3 mini (const Vector3 &, const Vector3 &)
 
static Vector3 maxi (const Vector3 &, const Vector3 &)
 

Attribute details

◆ inf

const Vector3 Vector3::inf
static

Constructor details

◆ Vector3() [1/4]

Vector3::Vector3 ( )

◆ ~Vector3()

Vector3::~Vector3 ( )

Default destructor.

◆ Vector3() [2/4]

Vector3::Vector3 ( const Vector3 u)

Copy constructor.

◆ Vector3() [3/4]

Vector3::Vector3 ( const NVector3 u)

Copy constructor from a normalized vector.

◆ Vector3() [4/4]

Vector3::Vector3 ( double  x,
double  y,
double  z 
)

Create a vector from real values.

Function details

◆ infNorm()

double Vector3::infNorm ( ) const

Infinite norm.

◆ maxi()

Vector3 Vector3::maxi ( const Vector3 v1,
const Vector3 v2 
)
static

◆ mini()

Vector3 Vector3::mini ( const Vector3 v1,
const Vector3 v2 
)
static

◆ norm()

double Vector3::norm ( ) const

Norm.

◆ operator*() [1/2]

double vrender::Vector3::operator* ( const Vector3 u) const
inline

◆ operator*() [2/2]

Vector3 vrender::Vector3::operator* ( double  v)
inline

◆ operator*=()

Vector3& vrender::Vector3::operator*= ( double  f)
inline

◆ operator+()

Vector3 vrender::Vector3::operator+ ( const Vector3 u) const
inline

◆ operator+=() [1/2]

Vector3 & Vector3::operator+= ( const NVector3 u)

Self addition with a normalized vector.

◆ operator+=() [2/2]

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

◆ operator-()

Vector3 vrender::Vector3::operator- ( const Vector3 u) const
inline

◆ operator-=() [1/2]

Vector3 & Vector3::operator-= ( const NVector3 u)

Self substraction with a normalized vector.

◆ operator-=() [2/2]

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

◆ operator/()

Vector3 vrender::Vector3::operator/ ( double  v)
inline

◆ operator/=()

Vector3& vrender::Vector3::operator/= ( double  f)
inline

◆ operator=() [1/2]

Vector3 & Vector3::operator= ( const NVector3 u)

Assignment with a normalized vector.

◆ operator=() [2/2]

Vector3& vrender::Vector3::operator= ( const Vector3 u)
inline

◆ operator[]() [1/2]

double& vrender::Vector3::operator[] ( int  i)
inline

◆ operator[]() [2/2]

double vrender::Vector3::operator[] ( int  i) const
inline

◆ operator^()

Vector3 vrender::Vector3::operator^ ( const Vector3 v) const
inline

◆ setX()

void vrender::Vector3::setX ( double  r)
inline

◆ setXYZ()

void vrender::Vector3::setXYZ ( double  x,
double  y,
double  z 
)
inline

◆ setY()

void vrender::Vector3::setY ( double  r)
inline

◆ setZ()

void vrender::Vector3::setZ ( double  r)
inline

◆ squareNorm()

double Vector3::squareNorm ( ) const

Square norm (self dot product)

◆ x()

double vrender::Vector3::x ( ) const
inline

◆ y()

double vrender::Vector3::y ( ) const
inline

◆ z()

double vrender::Vector3::z ( ) const
inline

Related details

◆ operator!=

bool operator!= ( const Vector3 ,
const Vector3  
)
friend

◆ operator*

Vector3 operator* ( double  ,
const Vector3  
)
friend

◆ operator-

Vector3 operator- ( const Vector3 u)
friend

◆ operator<<

std::ostream& operator<< ( std::ostream &  ,
const Vector3  
)
friend

◆ operator==

bool operator== ( const Vector3 ,
const Vector3  
)
friend