OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Member Functions | Protected Attributes | List of all members
Vector3D Class Reference

A 3-dimension vector. More...

#include <Vector3D.h>

Public Member Functions

 Vector3D ()
 Default constructor. More...
 
 Vector3D (double x, double y, double z)
 Constructor. More...
 
bool operator== (const Vector3D &) const
 
bool operator!= (const Vector3D &) const
 
Vector3Doperator+= (const Vector3D &vector)
 Add and assign. More...
 
Vector3Doperator-= (const Vector3D &vector)
 Subtract and assign. More...
 
Vector3Doperator*= (double factor)
 Scale and assign. More...
 
Vector3D operator- () const
 Negative vector. More...
 
double & operator() (int i)
 Get component. More...
 
double operator() (int i) const
 Get component. More...
 
void getComponents (double &x, double &y, double &z) const
 Get components. More...
 
double getX () const
 Get component. More...
 
double getY () const
 Get component. More...
 
double getZ () const
 Get component. More...
 
void clear ()
 Set to zero. More...
 
bool isZero () const
 Test for zero. More...
 
void setX (double)
 Set component. More...
 
void setY (double)
 Set component. More...
 
void setZ (double)
 Set component. More...
 

Protected Attributes

double v [3]
 

Detailed Description

A 3-dimension vector.

Definition at line 31 of file Vector3D.h.

Constructor & Destructor Documentation

◆ Vector3D() [1/2]

Vector3D::Vector3D ( )
inline

Default constructor.

Definition at line 132 of file Vector3D.h.

References v.

Referenced by operator-().

◆ Vector3D() [2/2]

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

Constructor.

Definition at line 27 of file Vector3D.cpp.

References v.

Member Function Documentation

◆ clear()

void Vector3D::clear ( )

Set to zero.

Definition at line 93 of file Vector3D.cpp.

References v.

◆ getComponents()

void Vector3D::getComponents ( double &  x,
double &  y,
double &  z 
) const

Get components.

Definition at line 98 of file Vector3D.cpp.

References v.

Referenced by Euclid3D::getAll().

◆ getX()

double Vector3D::getX ( ) const
inline

Get component.

Definition at line 144 of file Vector3D.h.

References v.

Referenced by Euclid3D::getX().

◆ getY()

double Vector3D::getY ( ) const
inline

Get component.

Definition at line 148 of file Vector3D.h.

References v.

Referenced by Euclid3D::getY().

◆ getZ()

double Vector3D::getZ ( ) const
inline

Get component.

Definition at line 152 of file Vector3D.h.

References v.

Referenced by Euclid3D::getZ().

◆ isZero()

bool Vector3D::isZero ( ) const

Test for zero.

Definition at line 106 of file Vector3D.cpp.

References v.

Referenced by Euclid3D::isPureXRotation(), Euclid3D::isPureYRotation(), Euclid3D::isPureZRotation(), and Euclid3D::setDisplacement().

◆ operator!=()

bool Vector3D::operator!= ( const Vector3D rhs) const

Definition at line 63 of file Vector3D.cpp.

References v.

◆ operator()() [1/2]

double & Vector3D::operator() ( int  i)
inline

Get component.

Definition at line 136 of file Vector3D.h.

References v.

◆ operator()() [2/2]

double Vector3D::operator() ( int  i) const
inline

Get component.

Definition at line 140 of file Vector3D.h.

References v.

◆ operator*=()

Vector3D & Vector3D::operator*= ( double  factor)

Scale and assign.

Definition at line 50 of file Vector3D.cpp.

References v.

◆ operator+=()

Vector3D & Vector3D::operator+= ( const Vector3D vector)

Add and assign.

Definition at line 34 of file Vector3D.cpp.

References v.

◆ operator-()

Vector3D Vector3D::operator- ( ) const

Negative vector.

Definition at line 68 of file Vector3D.cpp.

References v, and Vector3D().

Here is the call graph for this function:

◆ operator-=()

Vector3D & Vector3D::operator-= ( const Vector3D vector)

Subtract and assign.

Definition at line 42 of file Vector3D.cpp.

References v.

◆ operator==()

bool Vector3D::operator== ( const Vector3D rhs) const

Definition at line 58 of file Vector3D.cpp.

References v.

◆ setX()

void Vector3D::setX ( double  x)
inline

Set component.

Definition at line 156 of file Vector3D.h.

References v.

Referenced by Euclid3D::setX().

◆ setY()

void Vector3D::setY ( double  y)
inline

Set component.

Definition at line 160 of file Vector3D.h.

References v.

Referenced by Euclid3D::setY().

◆ setZ()

void Vector3D::setZ ( double  z)
inline

Set component.

Definition at line 164 of file Vector3D.h.

References v.

Referenced by Euclid3D::setZ().

Member Data Documentation

◆ v

double Vector3D::v[3]
protected

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