Main Page | Packages | Class Hierarchy | Class List | Directories | Class Members

IDVR.Tools.Vector4 Class Reference

#include <Vector4.h>

List of all members.


Detailed Description

Class for a 4 dimensional vector.

This class is part of the basic Tools namespace and contains a couple of methods for initialization and computing various 4-element vectors (4 dimensional vectors). Espacially the inner (see Vector4.DotProd) and outer (see Vector4.CrossProd) product methods.

For using vector with more or less elements (e.g. 2 or 3 elements) please see the following classes Vector2 and Vector3.

See also:
Vector2 the two dimensional vector.

Vector3 the four dimensional vector.

Author:
Bernhard Pflugfelder
Version:
1.0
Date:
02-17-2005


Public Member Functions

 Vector4 (void)
 This is the standard constructor.
 Vector4 (double n_X, double n_Y, double n_Z, double n_W)
 Constructor initialization by three parameters.
 Vector4 (double n_Value __gc[])
 Constructor initialization by an array parameters.
 Vector4 (Vector3 *n_Vector3, double n_W)
 Constructor initialization by an already existing Vector4 object.
__property double get_X (void)
 Returns the x element of the specific vector.
__property double get_Y (void)
 Returns the y element of the specific vector.
__property double get_Z (void)
 Returns the z element of the specific vector.
__property double get_W (void)
 Returns the w element of the specific vector.
__property void set_X (double n_X)
 Sets the x element of the existing vector.
__property void set_Y (double n_Y)
 Sets the y element of the existing vector.
__property void set_Z (double n_Z)
 Sets the z element of the existing vector.
__property void set_W (double n_W)
 Sets the w element of the existing vector.
double dotProd (Vector4 *v)
 This function returns the dot product (inner product) of the current Vector4 object and the specified vector parameter.
Vector4multSkalar (double d)
 This function returns the skalar product as a new Vector4 object of the current Vector4 object and the specified skalar parameter.
double magnitude (void)
 Returns the magnitude of the specific vector.
void normalize (void)
 This function normalizes the current vector.
double getItem (int index)
 This function returns the specific element of the current vector.
Vector4getNegativeVector (void)
 This function returns the negative vector of the current Vector4 object.
float getFloatArrayOfVector (void) __gc[]
 This function returns the all vector elements as an three element float array.
double getDoubleArrayOfVector (void) __gc[]
 This function returns the all vector elements as an three element double array.
Vector3getVector3 (void)
 This function returns a new instance of the Vector3 class which contains the firest three elements of the current Vector4 object divided by the w element.

Static Public Member Functions

static Vector4CreateNormalizedVector (Vector4 *v)
 This static function created a normalized vector of the specified vector parameter.
static Vector4Addition (Vector4 *v1, Vector4 *v2)
 This static function returns the sum vector of the two specified vector parameters.
static Vector4Subtraction (Vector4 *v1, Vector4 *v2)
 This static function returns the subtraction vector of the two specified vector parameters.
static Vector4CrossProd (Vector4 *v1, Vector4 *v2)
 This static function returns the cross product (outer product) vector of the two specified vector parameters.
static double DotProd (Vector4 *v1, Vector4 *v2)
 This static function returns the dot product (inner product) of the two specified vector parameters.
static Vector3GetVector3 (Vector4 *n_Vector4)
 This static function returns a new instance of the Vector3 class which contains the firest three elements of the current Vector4 object divided by the w element.
static Vector4GetVector4OfVector3 (Vector3 *n_Vector3)
 This static function initalizied a new Vector4 object by the specified Vector3 instance.

Private Attributes

double m_X
 The x element of the vector.
double m_Y
 The y element of the vector.
double m_Z
 The z element of the vector.
double m_W
 The w element of the vector.


Constructor & Destructor Documentation

Vector4::Vector4 void   ) 
 

This is the standard constructor.

This standard constructor initialized all four elements with zero.

Vector4::Vector4 double  n_X,
double  n_Y,
double  n_Z,
double  n_W
 

Constructor initialization by three parameters.

This constructor initialized all four element of the vector with the specified parameters.

Parameters:
n_X the value for the x element.
n_Y the value for the y element.
n_Z the value for the z element.
n_W the value for the w element.

Vector4::Vector4 double n_Value  __gc[]  ) 
 

Constructor initialization by an array parameters.

This constructor initialized all four element of the vector with the specified array parameter.

Parameters:
n_Value a four-element array for all three elements.

Vector4::Vector4 Vector3 n_Vector3,
double  n_W
 

Constructor initialization by an already existing Vector4 object.

This constructor initialized all three element of the vector with the values of the specified Vector4 object.

Parameters:
n_Vector3 the object containing thespecific element values.
n_W the fourth element of the vector.


Member Function Documentation

Vector4 * Vector4::Addition Vector4 v1,
Vector4 v2
[static]
 

This static function returns the sum vector of the two specified vector parameters.

Parameters:
v1 the first vector for addition.
v2 the second vector for addition.
Returns:
The sum vectoras a new instance.

Vector4 * Vector4::CreateNormalizedVector Vector4 v  )  [static]
 

This static function created a normalized vector of the specified vector parameter.

Parameters:
v the unnormalized vector.
Returns:
The normalized vector as a new instance.
See also:
Vector4.normalize the non-static method for vector normalization.

Vector4 * Vector4::CrossProd Vector4 v1,
Vector4 v2
[static]
 

This static function returns the cross product (outer product) vector of the two specified vector parameters.

Parameters:
v1 the first vector of the cross product.
v2 the second vector of the cross product.
Returns:
The cross product vector as a new instance.

double Vector4::DotProd Vector4 v1,
Vector4 v2
[static]
 

This static function returns the dot product (inner product) of the two specified vector parameters.

Parameters:
v1 the first vector of the the dot product.
v2 the second vector of the the dot product.
Returns:
The the dot product as a double value.
See also:
Vector3.dotProd the non-static method for the dot product.

double Vector4::dotProd Vector4 v  ) 
 

This function returns the dot product (inner product) of the current Vector4 object and the specified vector parameter.

Parameters:
v the second vector of the the dot product.
Returns:
The the dot product as a bouble value.
See also:
Vector4.DotProd the static method for the dot product.

double Vector4::get_W void   ) 
 

Returns the w element of the specific vector.

Returns:
The w element of the vector.

double Vector4::get_X void   ) 
 

Returns the x element of the specific vector.

Returns:
The x element of the vector.

double Vector4::get_Y void   ) 
 

Returns the y element of the specific vector.

Returns:
The y element of the vector.

double Vector4::get_Z void   ) 
 

Returns the z element of the specific vector.

Returns:
The z element of the vector.

double Vector4::getDoubleArrayOfVector void   ) 
 

This function returns the all vector elements as an three element double array.

Returns:
The three element double array containing all vector elements.
See also:
Vector4.getFloatArrayOfVector getting a float array containing all vector elements.

float Vector4::getFloatArrayOfVector void   ) 
 

This function returns the all vector elements as an three element float array.

Returns:
The three element float array containing all vector elements.
See also:
Vector4.getDoubleArrayOfVector getting a double array containing all vector elements.

double Vector4::getItem int  index  ) 
 

This function returns the specific element of the current vector.

This element is specified by the specified parameter whereas the following index enumeration is valid:

  • 0 means the x elements
  • 1 means the y elements
  • 2 means the z elements
  • 3 means the w elements
Parameters:
index the index for the specific element.
Returns:
The choosen vector element.

Vector4 * Vector4::getNegativeVector void   ) 
 

This function returns the negative vector of the current Vector4 object.

This means that the current vector is multiplied with -1 which is actually a skalar product.

Returns:
The negative vector as a new Vector4 object.

Vector3 * Vector4::GetVector3 Vector4 n_Vector4  )  [static]
 

This static function returns a new instance of the Vector3 class which contains the firest three elements of the current Vector4 object divided by the w element.

This means that the x,y and z element will be divided by the w element and afterwards copied to the new Vector3 instance.

Returns:
The new Vector3 instance containing the first thrre elements.
See also:
Vector4.getVector3 the non-static method for extacting a Vector3 instance

Vector3 * Vector4::getVector3 void   ) 
 

This function returns a new instance of the Vector3 class which contains the firest three elements of the current Vector4 object divided by the w element.

This means that the x,y and z element will be divided by the w element and afterwards copied to the new Vector3 instance.

Returns:
The new Vector3 instance containing the first thrre elements.
See also:
Vector4.GetVector3 the static method for extacting a Vector3 instance

initalizied a new Vector4 object by the specified Vector3 instance Hereby should be noted that the fourth element will be invariably set to zero *Vector4 * Vector4::GetVector4OfVector3 Vector3 n_Vector3  )  [static]
 

This static function initalizied a new Vector4 object by the specified Vector3 instance.

Hereby should be noted that the fourth element will be invariably set to zero.

Parameters:
n_Vector3 the Vector3 instance containing the initialization values.

double Vector4::magnitude void   ) 
 

Returns the magnitude of the specific vector.

Returns:
The magnitude of the vector.

Vector4 * Vector4::multSkalar double  d  ) 
 

This function returns the skalar product as a new Vector4 object of the current Vector4 object and the specified skalar parameter.

Parameters:
d the skalar value to multiply the vector.
Returns:
The the skalar product as a new Vector4 object.

void Vector4::normalize void   ) 
 

This function normalizes the current vector.

See also:
Vector3.CreateNormalizedVector the static method for vector normalization.

void Vector4::set_W double  n_W  ) 
 

Sets the w element of the existing vector.

Parameters:
n_W the w element of the vector.

void Vector4::set_X double  n_X  ) 
 

Sets the x element of the existing vector.

Parameters:
n_X the x element of the vector.

void Vector4::set_Y double  n_Y  ) 
 

Sets the y element of the existing vector.

Parameters:
n_Y the y element of the vector.

void Vector4::set_Z double  n_Z  ) 
 

Sets the z element of the existing vector.

Parameters:
n_Z the z element of the vector.

Vector4 * Vector4::Subtraction Vector4 v1,
Vector4 v2
[static]
 

This static function returns the subtraction vector of the two specified vector parameters.

Parameters:
v1 the first vector for subtraction.
v2 the second vector for subtraction.
Returns:
The subtraction vector as a new instance.


Member Data Documentation

double IDVR.Tools.Vector4.m_W [private]
 

The w element of the vector.

The w element is the fourth element and is based on a double variable.

double IDVR.Tools.Vector4.m_X [private]
 

The x element of the vector.

The x element is the first element and is based on a double variable.

double IDVR.Tools.Vector4.m_Y [private]
 

The y element of the vector.

The y element is the second element and is based on a double variable.

double IDVR.Tools.Vector4.m_Z [private]
 

The z element of the vector.

The z element is the third element and is based on a double variable.


The documentation for this class was generated from the following files:
Generated on Sat Apr 9 11:51:00 2005 for RayCaster wiht Importance Driven Volume Rendering (IDVR) by  doxygen 1.4.1