All Classes Namespaces Files Functions Variables Typedefs Friends Macros Groups Pages
Public Member Functions | Public Attributes | Friends | List of all members
sdf::Vector3 Class Reference

The Vector3 class represents the generic vector containing 3 elements. More...

#include <Types.hh>

Public Member Functions

 Vector3 (const Vector3 &_v)
 Copy constructor. More...
 
 Vector3 (double _x=0.0, double _y=0.0, double _z=0.0)
 Constructor. More...
 
Vector3 Cross (const Vector3 &_pt) const
 Return the cross product of this vector and pt. More...
 
Vector3 operator* (double _v) const
 Multiplication operator. More...
 
const Vector3operator*= (double _v)
 Multiplication by a double. More...
 
Vector3 operator+ (const Vector3 &_v) const
 Addition operator. More...
 
bool operator== (const sdf::Vector3 &_pt) const
 Equal to operator. More...
 

Public Attributes

double x
 x Data More...
 
double y
 y Data More...
 
double z
 z Data More...
 

Friends

std::ostream & operator<< (std::ostream &_out, const Vector3 &_pt)
 Stream insertion operator. More...
 
std::istream & operator>> (std::istream &_in, Vector3 &_pt)
 Stream extraction operator. More...
 

Detailed Description

The Vector3 class represents the generic vector containing 3 elements.

Since it's commonly used to keep coordinate system related information, its elements are labeled by x, y, z.

Constructor & Destructor Documentation

sdf::Vector3::Vector3 ( const Vector3 _v)
inline

Copy constructor.

Parameters
[in]_va vector

Referenced by operator*(), and operator+().

sdf::Vector3::Vector3 ( double  _x = 0.0,
double  _y = 0.0,
double  _z = 0.0 
)
inline

Constructor.

Parameters
[in]_xvalue along x
[in]_yvalue along y
[in]_zvalue along z

Member Function Documentation

Vector3 sdf::Vector3::Cross ( const Vector3 _pt) const
inline

Return the cross product of this vector and pt.

Returns
the product

References x, y, and z.

Referenced by sdf::Quaternion::operator*().

Vector3 sdf::Vector3::operator* ( double  _v) const
inline

Multiplication operator.

Remarks
this is an element wise multiplication, not a cross product
Parameters
[in]_v

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

const Vector3& sdf::Vector3::operator*= ( double  _v)
inline

Multiplication by a double.

Parameters
[in]_vA double
Returns
this

References x, y, and z.

Vector3 sdf::Vector3::operator+ ( const Vector3 _v) const
inline

Addition operator.

Parameters
[in]_vvector to add
Returns
the sum vector

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

bool sdf::Vector3::operator== ( const sdf::Vector3 _pt) const
inline

Equal to operator.

Parameters
[in]_ptThe vector to compare against
Returns
true if each component is equal within a tolerence (1e-3), false otherwise

References sdf::equal(), x, y, and z.

Friends And Related Function Documentation

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

Stream insertion operator.

Parameters
_outoutput stream
_ptVector3 to output
Returns
the stream
std::istream& operator>> ( std::istream &  _in,
Vector3 _pt 
)
friend

Stream extraction operator.

Parameters
_ininput stream
_ptvector3 to read values into
Returns
the stream

Member Data Documentation

double sdf::Vector3::x
double sdf::Vector3::y
double sdf::Vector3::z

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