Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

CSIBCVector2D Class Reference

General purpose 2D vector class. More...

#include <SIBCVector.h>

List of all members.

Public Methods

Public Attributes


Detailed Description

General purpose 2D vector class.

Representation of a 2D vector, defining operations to access, modify and perform calculations on 2D vectors. This class uses single precision floating-point numbers for represent its data, and in its operations. There are seperate similar classes for 3D and 4D vectors, CSIBCVector3D and CSIBCVector4D, respectively, which also use single precision.

Furthermore, there is another set of vector classes which use double precision floating-point numbers, CSIBCVector2Dd, CSIBCVector3Dd and CSIBCVector4Dd for 2D, 3D and 4D vectors respectively. Quaternions represented as 4D vectors are also available in CSIBCQuaternion and CSIBCQuaterniond with single precision and double precision, repspectively.


Constructor & Destructor Documentation

CSIBCVector2D::CSIBCVector2D   [inline]
 

Default constructor. Sets the values of each component of this vector to zero.

CSIBCVector2D::CSIBCVector2D const CSIBCVector2D &    in_vct [inline]
 

Copy constructor. Sets the new vector's component values to be the same as i_vVector.

Parameters:
i_vVector  Vector to use for new vector's component values.

CSIBCVector2D::CSIBCVector2D const SI_Float    in_dX,
const SI_Float    in_dY
[inline]
 

Constructor. Sets the new vector to have i_fX and i_fY for its X and Y components, respectively.

Parameters:
i_fX  The value for the X component of the new vector.
i_fY  The value for the Y component of the new vector.


Member Function Documentation

CSIBCVector2D & CSIBCVector2D::Add const CSIBCVector2D &    in_vct [inline]
 

Adds this vector to i_vVector, and stores the result in this vector.

Parameters:
i_vVector  The vector to add to this vector.
Returns:
CSIBCVector2D& Reference to this vector.
See also:
CSIBCVector2D::Sub

CSIBCVector2D & CSIBCVector2D::DivComp const CSIBCVector2D &    in_vct [inline]
 

Divides each component in this vector by its corresponding component in i_vVector. The result is stored in this vector.

Parameters:
i_vVector  Vector to divide components with this vector.
Returns:
CSIBCVector2D& Reference to this vector.
See also:
CSIBCVector2D::operator/ , CSIBCVector2D::MulComp

void CSIBCVector2D::Dump  
 

Outputs the memory location of this object, and the values of each of its components.

See also:
SIBCVector2D::Get

void CSIBCVector2D::Get SI_Float *    out_dX,
SI_Float *    out_dY
const [inline]
 

Gets the values of the vector components.

Parameters:
o_fX  Pointer to an SI_Float to receive the value of the X component.
o_fY  Pointer to an SI_Float to receive the value of the Y component.
See also:
CSIBCVector2D::GetX , CSIBCVector2D::GetY , CSIBCVector2D::Set

SI_Float CSIBCVector2D::GetDistanceFrom const CSIBCVector2D &    in_vct const [inline]
 

Returns the distance between this vector and i_vVector.

Parameters:
i_vVector  Vector to determine distance from.
Returns:
SI_Float Distance from this vector to i_vVector.
See also:
CSIBCVector2D::GetLength

SI_Float CSIBCVector2D::GetDot const CSIBCVector2D &    in_vct const [inline]
 

Computes the dot product between this vector and i_vVector.

Parameters:
i_vVector  Vector to dot-product with this vector.
Returns:
SI_Float Dot product of the two vectors.
See also:
CSIBCVector2D::IsOrthogonalTo

SI_Float CSIBCVector2D::GetLength   const [inline]
 

Returns the length of this vector.

Returns:
SI_Float The length of this vector.
See also:
CSIBCVector2D::GetSquaredLength , CSIBCVector2D::GetMaxComponent , CSIBCVector2D::GetMinComponent

SI_Float CSIBCVector2D::GetMaxComponent SI_Int *    idx const
 

Returns the value and index of the maximum component of this vector.

Parameters:
o_nIndex  Pointer to an SI_Int to hold the value of the index that had the maximum component (0 == X, 1 == Y).
Returns:
SI_Float The value of the maximum component of this vector.
See also:
CSIBCVector2D::Get

SI_Float CSIBCVector2D::GetMinComponent SI_Int *    idx const
 

Returns the value and index of the minimum component of this vector.

Parameters:
o_nIndex  Pointer to an SI_Int to hold the value of the index that had the maximum component (0 == X, 1 == Y).
Returns:
SI_Float The value of the maximum component of this vector.
See also:
CSIBCVector2D::Get

SI_Float CSIBCVector2D::GetSquaredLength   const [inline]
 

Returns the squared length of this vector.

Returns:
SI_Float The squared length of this vector.
See also:
CSIBCVector2D::GetLength , CSIBCVector2D::GetMaxComponent , CSIBCVector2D::GetMinComponent

const SI_Float CSIBCVector2D::GetX   const [inline]
 

Gets the X component of this vector.

Returns:
SI_Float The value of the X component of this vector.
See also:
CSIBCVector2D::GetY , CSIBCVector2D::Get , CSIBCVector2D::SetX

const SI_Float CSIBCVector2D::GetY   const [inline]
 

Gets the Y component of this vector.

Returns:
SI_Float The value of the Y component of this vector.
See also:
CSIBCVector2D::GetX , CSIBCVector2D::Get , CSIBCVector2D::SetY

SI_Bool CSIBCVector2D::IsAlmostEqualTo const CSIBCVector2D &    in_vct,
const SI_Float    in_dEpsilon
[inline]
 

Determines whether this vector and i_vVector are equal to each other, within a threshhold value given by i_fEpsilon.

Parameters:
i_vVector  Vector to compare equality with.
i_fEpsilon  Error range for floating-point comparison.
Returns:
SI_Bool TRUE if the vectors are equal, FALSE otherwise.
See also:
CSIBCVector2D::IsOrthogonalTo , CSIBCVector2D::IsNull , CSIBCVector2D::operator==

SI_Bool CSIBCVector2D::IsNull   const [inline]
 

Determines whether all of the components of this vector are zero. This function uses a floating-point comparison error of PICO_EPS.

Returns:
SI_Bool TRUE if all of the vector's components are zero, FALSE otherwise.
See also:
CSIBCVector2D::IsAlmostEqualTo , CSIBCVector2D::IsNull

SI_Bool CSIBCVector2D::IsOrthogonalTo const CSIBCVector2D &    in_vct [inline]
 

Determines whether this vector and i_vVector are orthogonal (at 90 degrees to each other). This function uses a floating-point comparison error of PICO_EPS.

Parameters:
i_vVector  The vector to compare orthogonality with.
Returns:
SI_Bool TRUE if the vectors are orthogonal, FALSE otherwise.
See also:
CSIBCVector2D::IsAlmostEqualTo , CSIBCVector2D::IsNull , CSIBCVector2D::GetDot

CSIBCVector2D & CSIBCVector2D::MulComp const CSIBCVector2D &    in_vct [inline]
 

Multiplies each component in this vector by its corresponding component in i_vVector. The result is stored in this vector.

Parameters:
i_vVector  Vector to multiply components with this vector.
Returns:
CSIBCVector2D& Reference to this vector
See also:
CSIBCVector2D::DivComp

CSIBCVector2D & CSIBCVector2D::Negate void    [inline]
 

Sets all the components of this vector to be the negatives of their current values.

Returns:
CSIBCVector2D& Reference to this vector.
See also:
CSIBCVector2D::Set

CSIBCVector2D & CSIBCVector2D::Normalize   [inline]
 

Normalizes the vector to a length of one. If the vector is null, then it is initialized to (1.0f, 0.0f).

Returns:
CSIBCVector2D& Reference to this vector.
See also:
CSIBCVector2D::SetLength , CSIBCVector2D::GetLength

CSIBCVector2D CSIBCVector2D::operator * const SI_Float    in_flt const [inline]
 

Multiplies each component of this vector by i_fFloat.

Parameters:
i_fFloat  The amount to scale each component of this vector by.
Returns:
CSIBCVector2D The result of the scaling.
See also:
CSIBCVector2D::Scale , CSIBCVector2D::MulComp

SI_Bool CSIBCVector2D::operator!= const CSIBCVector2D &    in_vct const [inline]
 

Determines whether this vector and i_vVector are not-equal. Note that this function does not use any floating-point comparison error, thus the two vectors must be exactly the same for a FALSE return value.

Parameters:
i_vVector  Vector to compare inequality with.
Returns:
SI_Bool TRUE if the vectors are not equal, FALSE otherwise.
See also:
CSIBCVector2D::IsAlmostEqualTo , CSIBCVector2D::operator==

CSIBCVector2D CSIBCVector2D::operator+ const CSIBCVector2D &    in_vtx const [inline]
 

Computes the vector addition between this vector and i_vVector.

Parameters:
i_vVector  The vector to add this vector with.
Returns:
CSIBCVector2D The result of the addition.
See also:
CSIBCVector2D::Add , CSIBCVector2D::operator-

CSIBCVector2D CSIBCVector2D::operator- const CSIBCVector2D &    in_vtx const [inline]
 

Computes the vector subtraction of i_vVector from this vector.

Parameters:
i_vVector  The vector to subtract from this vector.
Returns:
CSIBCVector2D The result of the subtraction.
See also:
CSIBCVector2D::Sub , CSIBCVector2D::operator+

CSIBCVector2D CSIBCVector2D::operator/ const CSIBCVector2D &    in_vtx const [inline]
 

Divides each component in this vector by its corresponding component in i_vVector.

Parameters:
i_vVector  Vector to divide components with this vector.
Returns:
CSIBCVector2D The result of the divisions.
See also:
CSIBCVector2D::DivComp

SI_Bool CSIBCVector2D::operator== const CSIBCVector2D &    in_v const [inline]
 

Determines whether this vector and i_vVector are equal. Note that this function does not use any floating-point comparison error, thus the two vectors must be exactly the same.

Parameters:
i_vVector  Vector to compare equality with.
Returns:
SI_Bool TRUE if the vectors are equal, FALSE otherwise.
See also:
CSIBCVector2D::IsAlmostEqualTo , CSIBCVector2D::operator!=

CSIBCVector2D & CSIBCVector2D::Scale const SI_Float    in_dFactor [inline]
 

Scales all components of this vector by i_fScale.

Parameters:
i_fScale  The amount to scale each of the components of this vector by.
Returns:
CSIBCVector2D& Reference to this vector.
See also:
CSIBCVector2D::operator * , CSIBCVector2D::SetLength

CSIBCVector2D & CSIBCVector2D::Set SI_Float    in_dX,
SI_Float    in_dY
[inline]
 

Sets the values of the X and Y components of this vector.

Parameters:
i_fX  The new value for the X component of this vector.
i_fY  The new value for the Y component of this vector.
Returns:
CSIBCVector2D& Reference to this vector.
See also:
CSIBCVector2D::SetX , CSIBCVector2D::SetY , CSIBCVector2D::Get

CSIBCVector2D & CSIBCVector2D::SetLength const SI_Float    in_dLength [inline]
 

Sets the length of this vector to be i_fLength. If the vector is null (See CSIBCVector2D::IsNull), then the vector is unchanged.

Parameters:
i_fLength  New length of the vector.
Returns:
CSIBCVector2D& Reference to this vector.
See also:
CSIBCVector2D::GetLength , CSIBCVector2D::Set

CSIBCVector2D & CSIBCVector2D::SetNull   [inline]
 

Sets this vector to null. (Components equal 0.0f).

Returns:
CSIBCVector2D& Reference to this vector.
See also:
CSIBCVector2D::IsNull , CSIBCVector2D::Set

const void CSIBCVector2D::SetX const SI_Float    i_fX [inline]
 

Sets the value of the X component of this vector.

Parameters:
i_fX  The new value of the X component of this vector.
See also:
CSIBCVector2D::SetY , CSIBCVector2D::Set , CSIBCVector2D::GetX

const void CSIBCVector2D::SetY const SI_Float    i_fY [inline]
 

Sets the value of the Y component of this vector.

Parameters:
i_fY  The new value of the Y component of this vector.
See also:
CSIBCVector2D::SetX , CSIBCVector2D::Set , CSIBCVector2D::GetY

CSIBCVector2D & CSIBCVector2D::Sub const CSIBCVector2D &    in_vct [inline]
 

Subtracts i_vVector from this vector, and stores the result in this vector.

Parameters:
i_vVector  The vector to subtract from this vector.
Returns:
CSIBCVector2D& Reference to this vector.
See also:
CSIBCVector2D::Add


Member Data Documentation

float CSIBCVector2D::m_fX
 

The X component of this vector.

float CSIBCVector2D::m_fY
 

The Y component of this vector.


The documentation for this class was generated from the following files: © Copyright 2001-2003 Avid Technology, Inc. All rights reserved.

© Copyright 2001-2003 Avid Technology, Inc. All rights reserved.