OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | List of all members
osg::Vec2d Class Reference

#include <Vec2d.h>

Public Types

enum  { num_components = 2 }
 
typedef double value_type
 

Public Member Functions

 Vec2d ()
 
 Vec2d (value_type x, value_type y)
 
 Vec2d (const Vec2f &vec)
 
 operator Vec2f () const
 
bool operator== (const Vec2d &v) const
 
bool operator!= (const Vec2d &v) const
 
bool operator< (const Vec2d &v) const
 
value_typeptr ()
 
const value_typeptr () const
 
void set (value_type x, value_type y)
 
value_typeoperator[] (int i)
 
value_type operator[] (int i) const
 
value_typex ()
 
value_typey ()
 
value_type x () const
 
value_type y () const
 
bool valid () const
 
bool isNaN () const
 
value_type operator* (const Vec2d &rhs) const
 
const Vec2d operator* (value_type rhs) const
 
Vec2doperator*= (value_type rhs)
 
const Vec2d operator/ (value_type rhs) const
 
Vec2doperator/= (value_type rhs)
 
const Vec2d operator+ (const Vec2d &rhs) const
 
Vec2doperator+= (const Vec2d &rhs)
 
const Vec2d operator- (const Vec2d &rhs) const
 
Vec2doperator-= (const Vec2d &rhs)
 
const Vec2d operator- () const
 
value_type length () const
 
value_type length2 (void) const
 
value_type normalize ()
 

Public Attributes

value_type _v [2]
 

Detailed Description

General purpose double pair, uses include representation of texture coordinates. No support yet added for double * Vec2d - is it necessary? Need to define a non-member non-friend operator* etc. BTW: Vec2d * double is okay

Definition at line 28 of file Vec2d.h.

Member Typedef Documentation

typedef double osg::Vec2d::value_type

Data type of vector components.

Definition at line 33 of file Vec2d.h.

Member Enumeration Documentation

anonymous enum

Number of vector components.

Enumerator
num_components 

Definition at line 36 of file Vec2d.h.

Constructor & Destructor Documentation

osg::Vec2d::Vec2d ( )
inline

Constructor that sets all components of the vector to zero

Definition at line 41 of file Vec2d.h.

Here is the caller graph for this function:

osg::Vec2d::Vec2d ( value_type  x,
value_type  y 
)
inline

Definition at line 43 of file Vec2d.h.

Here is the call graph for this function:

osg::Vec2d::Vec2d ( const Vec2f vec)
inline

Definition at line 45 of file Vec2d.h.

Member Function Documentation

bool osg::Vec2d::isNaN ( ) const
inline

Returns true if at least one component has value NaN.

Definition at line 78 of file Vec2d.h.

Here is the call graph for this function:

Here is the caller graph for this function:

value_type osg::Vec2d::length ( ) const
inline

Length of the vector = sqrt( vec . vec )

Definition at line 151 of file Vec2d.h.

Here is the caller graph for this function:

value_type osg::Vec2d::length2 ( void  ) const
inline

Length squared of the vector = vec . vec

Definition at line 157 of file Vec2d.h.

value_type osg::Vec2d::normalize ( )
inline

Normalize the vector so that it has length unity. Returns the previous length of the vector.

Definition at line 165 of file Vec2d.h.

Here is the call graph for this function:

osg::Vec2d::operator Vec2f ( ) const
inline

Definition at line 47 of file Vec2d.h.

bool osg::Vec2d::operator!= ( const Vec2d v) const
inline

Definition at line 52 of file Vec2d.h.

value_type osg::Vec2d::operator* ( const Vec2d rhs) const
inline

Dot product.

Definition at line 81 of file Vec2d.h.

const Vec2d osg::Vec2d::operator* ( value_type  rhs) const
inline

Multiply by scalar.

Definition at line 87 of file Vec2d.h.

Here is the call graph for this function:

Vec2d& osg::Vec2d::operator*= ( value_type  rhs)
inline

Unary multiply by scalar.

Definition at line 93 of file Vec2d.h.

const Vec2d osg::Vec2d::operator+ ( const Vec2d rhs) const
inline

Binary vector add.

Definition at line 115 of file Vec2d.h.

Here is the call graph for this function:

Vec2d& osg::Vec2d::operator+= ( const Vec2d rhs)
inline

Unary vector add. Slightly more efficient because no temporary intermediate object.

Definition at line 123 of file Vec2d.h.

const Vec2d osg::Vec2d::operator- ( const Vec2d rhs) const
inline

Binary vector subtract.

Definition at line 131 of file Vec2d.h.

Here is the call graph for this function:

const Vec2d osg::Vec2d::operator- ( ) const
inline

Negation operator. Returns the negative of the Vec2d.

Definition at line 145 of file Vec2d.h.

Here is the call graph for this function:

Vec2d& osg::Vec2d::operator-= ( const Vec2d rhs)
inline

Unary vector subtract.

Definition at line 137 of file Vec2d.h.

const Vec2d osg::Vec2d::operator/ ( value_type  rhs) const
inline

Divide by scalar.

Definition at line 101 of file Vec2d.h.

Here is the call graph for this function:

Vec2d& osg::Vec2d::operator/= ( value_type  rhs)
inline

Unary divide by scalar.

Definition at line 107 of file Vec2d.h.

bool osg::Vec2d::operator< ( const Vec2d v) const
inline

Definition at line 54 of file Vec2d.h.

bool osg::Vec2d::operator== ( const Vec2d v) const
inline

Definition at line 50 of file Vec2d.h.

value_type& osg::Vec2d::operator[] ( int  i)
inline

Definition at line 66 of file Vec2d.h.

value_type osg::Vec2d::operator[] ( int  i) const
inline

Definition at line 67 of file Vec2d.h.

value_type* osg::Vec2d::ptr ( )
inline

Definition at line 61 of file Vec2d.h.

const value_type* osg::Vec2d::ptr ( ) const
inline

Definition at line 62 of file Vec2d.h.

void osg::Vec2d::set ( value_type  x,
value_type  y 
)
inline

Definition at line 64 of file Vec2d.h.

Here is the call graph for this function:

bool osg::Vec2d::valid ( ) const
inline

Returns true if all components have values that are not NaN.

Definition at line 76 of file Vec2d.h.

Here is the call graph for this function:

value_type& osg::Vec2d::x ( )
inline

Definition at line 69 of file Vec2d.h.

Here is the caller graph for this function:

value_type osg::Vec2d::x ( ) const
inline

Definition at line 72 of file Vec2d.h.

value_type& osg::Vec2d::y ( )
inline

Definition at line 70 of file Vec2d.h.

Here is the caller graph for this function:

value_type osg::Vec2d::y ( ) const
inline

Definition at line 73 of file Vec2d.h.

Member Data Documentation

value_type osg::Vec2d::_v[2]

Definition at line 38 of file Vec2d.h.


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