OpenStructure
Public Member Functions | Data Fields
Vec2 Class Reference

#include <vec2.hh>

Public Member Functions

 Vec2 ()
 Vec2 (Real px, Real py)
 Vec2 (const Vec2 &v)
 Vec2 (const Vec3 &v)
 Vec2 (const Vec4 &v)
 Vec2 (const float v[2])
 Vec2 (const double v[2])
Real GetX () const
Real GetY () const
void SetX (Real d)
void SetY (Real d)
bool operator== (const Vec2 &rhs) const
Realoperator[] (std::size_t indx)
const Realoperator[] (std::size_t indx) const
Vec2operator+= (const Vec2 &rhs)
Vec2operator+= (Real d)
Vec2operator-= (const Vec2 &rhs)
Vec2operator-= (Real d)
Vec2 operator- () const
Vec2operator*= (Real d)
Vec2operator/= (Real d)
RealData ()
const RealData () const

Data Fields

Real x
Real y

Detailed Description

Definition at line 41 of file vec2.hh.


Constructor & Destructor Documentation

Vec2 ( )
inline

Default initialization, all components are set to zero.

Definition at line 49 of file vec2.hh.

Vec2 ( Real  px,
Real  py 
)
inline

Initialization with x, y and z component.

Definition at line 52 of file vec2.hh.

Vec2 ( const Vec2 v)
inline

copy ctor

Definition at line 55 of file vec2.hh.

Vec2 ( const Vec3 v)
inlineexplicit

explicit initialization with 3D vector

Definition at line 178 of file vec2.hh.

Vec2 ( const Vec4 v)
inlineexplicit

explicit initialization with a 4D homogeneous vector

Definition at line 181 of file vec2.hh.

Vec2 ( const float  v[2])
inlineexplicit

explicit initialization with an array of doubles

Definition at line 64 of file vec2.hh.

Vec2 ( const double  v[2])
inlineexplicit

explicit initialization with an array of floats

Definition at line 68 of file vec2.hh.


Member Function Documentation

Real* Data ( )
inline

Definition at line 153 of file vec2.hh.

const Real* Data ( ) const
inline

Definition at line 154 of file vec2.hh.

Real GetX ( ) const
inline

Definition at line 71 of file vec2.hh.

Real GetY ( ) const
inline

Definition at line 72 of file vec2.hh.

Vec2& operator*= ( Real  d)
inline

multipliable

Definition at line 137 of file vec2.hh.

Vec2& operator+= ( const Vec2 rhs)
inline

addable op

Definition at line 102 of file vec2.hh.

Vec2& operator+= ( Real  d)
inline

Definition at line 109 of file vec2.hh.

Vec2 operator- ( ) const
inline

negateable

Definition at line 131 of file vec2.hh.

Vec2& operator-= ( const Vec2 rhs)
inline

subtractable op

Definition at line 117 of file vec2.hh.

Vec2& operator-= ( Real  d)
inline

Definition at line 124 of file vec2.hh.

Vec2& operator/= ( Real  d)
inline

dividable

Definition at line 145 of file vec2.hh.

bool operator== ( const Vec2 rhs) const
inline

comparable

Definition at line 78 of file vec2.hh.

Real& operator[] ( std::size_t  indx)
inline

element access

Definition at line 84 of file vec2.hh.

const Real& operator[] ( std::size_t  indx) const
inline

const element access

Definition at line 93 of file vec2.hh.

void SetX ( Real  d)
inline

Definition at line 74 of file vec2.hh.

void SetY ( Real  d)
inline

Definition at line 75 of file vec2.hh.


Field Documentation

Real x

Definition at line 156 of file vec2.hh.

Real y

Definition at line 157 of file vec2.hh.


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