OpenStructure
Public Member Functions | Data Fields
Vec2 Class Reference

#include <vec2.hh>

Inherits equality_comparable< Vec2 >, additive< Vec2 >, additive< Vec2, Real >, and multiplicative< Vec2, Real >.

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
 
RealAt (size_t indx)
 
const RealAt (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 42 of file vec2.hh.

Constructor & Destructor Documentation

◆ Vec2() [1/7]

Vec2 ( )
inline

Default initialization, all components are set to zero.

Definition at line 50 of file vec2.hh.

◆ Vec2() [2/7]

Vec2 ( Real  px,
Real  py 
)
inline

Initialization with x, y and z component.

Definition at line 53 of file vec2.hh.

◆ Vec2() [3/7]

Vec2 ( const Vec2 v)
inline

copy ctor

Definition at line 56 of file vec2.hh.

◆ Vec2() [4/7]

Vec2 ( const Vec3 v)
inlineexplicit

explicit initialization with 3D vector

Definition at line 189 of file vec2.hh.

◆ Vec2() [5/7]

Vec2 ( const Vec4 v)
inlineexplicit

explicit initialization with a 4D homogeneous vector

Definition at line 192 of file vec2.hh.

◆ Vec2() [6/7]

Vec2 ( const float  v[2])
inlineexplicit

explicit initialization with an array of doubles

Definition at line 65 of file vec2.hh.

◆ Vec2() [7/7]

Vec2 ( const double  v[2])
inlineexplicit

explicit initialization with an array of floats

Definition at line 69 of file vec2.hh.

Member Function Documentation

◆ At() [1/2]

Real& At ( size_t  indx)
inline

Definition at line 98 of file vec2.hh.

◆ At() [2/2]

const Real& At ( size_t  indx) const
inline

Definition at line 105 of file vec2.hh.

◆ Data() [1/2]

Real* Data ( )
inline

Definition at line 164 of file vec2.hh.

◆ Data() [2/2]

const Real* Data ( ) const
inline

Definition at line 165 of file vec2.hh.

◆ GetX()

Real GetX ( ) const
inline

Definition at line 72 of file vec2.hh.

◆ GetY()

Real GetY ( ) const
inline

Definition at line 73 of file vec2.hh.

◆ operator*=()

Vec2& operator*= ( Real  d)
inline

multipliable

Definition at line 148 of file vec2.hh.

◆ operator+=() [1/2]

Vec2& operator+= ( const Vec2 rhs)
inline

addable op

Definition at line 113 of file vec2.hh.

◆ operator+=() [2/2]

Vec2& operator+= ( Real  d)
inline

Definition at line 120 of file vec2.hh.

◆ operator-()

Vec2 operator- ( ) const
inline

negateable

Definition at line 142 of file vec2.hh.

◆ operator-=() [1/2]

Vec2& operator-= ( const Vec2 rhs)
inline

subtractable op

Definition at line 128 of file vec2.hh.

◆ operator-=() [2/2]

Vec2& operator-= ( Real  d)
inline

Definition at line 135 of file vec2.hh.

◆ operator/=()

Vec2& operator/= ( Real  d)
inline

dividable

Definition at line 156 of file vec2.hh.

◆ operator==()

bool operator== ( const Vec2 rhs) const
inline

comparable

Definition at line 79 of file vec2.hh.

◆ operator[]() [1/2]

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

element access

Definition at line 85 of file vec2.hh.

◆ operator[]() [2/2]

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

const element access

Definition at line 92 of file vec2.hh.

◆ SetX()

void SetX ( Real  d)
inline

Definition at line 75 of file vec2.hh.

◆ SetY()

void SetY ( Real  d)
inline

Definition at line 76 of file vec2.hh.

Field Documentation

◆ x

Real x

Definition at line 167 of file vec2.hh.

◆ y

Real y

Definition at line 168 of file vec2.hh.


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