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

IDVR.Tools.Vector3 Class Reference

#include <Vector3.h>

List of all members.


Detailed Description

Class for a 3 dimensional vector.

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

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

See also:
Vector2 the two dimensional vector.

Vector4 the four dimensional vector.

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


Public Member Functions

 Vector3 (void)
 This is the standard constructor.
 Vector3 (double n_X, double n_Y, double n_Z)
 Constructor initialization by three parameters.
 Vector3 (double n_Value __gc[])
 Constructor initialization by an array parameters.
 Vector3 (Vector3 *n_Vector3)
 Constructor initialization by an already existing Vector3 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 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.
double dotProd (Vector3 *v)
 This function returns the dot product (inner product) of the current Vector3 object and the specified vector parameter.
Vector3multSkalar (double d)
 This function returns the skalar product as a new Vector3 object of the current Vector3 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.
Vector3getNegativeVector (void)
 This function returns the negative vector of the current Vector3 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.
Vector3convertToOpenGLAlignedVector (void)
 This function converts the current vector to an OpenGL compatible vector form.

Static Public Member Functions

static Vector3CreateNormalizedVector (Vector3 *v)
 This static function created a normalized vector of the specified vector parameter.
static Vector3Addition (Vector3 *v1, Vector3 *v2)
 This static function returns the sum vector of the two specified vector parameters.
static Vector3Subtraction (Vector3 *v1, Vector3 *v2)
 This static function returns the subtraction vector of the two specified vector parameters.
static Vector3CrossProd (Vector3 *v1, Vector3 *v2)
 This static function returns the cross product (outer product) vector of the two specified vector parameters.
static double DotProd (Vector3 *v1, Vector3 *v2)
 This static function returns the dot product (inner product) of the two specified vector parameters.

Public 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.


Constructor & Destructor Documentation

Vector3::Vector3 void   ) 
 

This is the standard constructor.

This standard constructor initialzed all three elements with zero.

Vector3::Vector3 double  n_X,
double  n_Y,
double  n_Z
 

Constructor initialization by three parameters.

This constructor initialized all three 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.

Vector3::Vector3 double n_Value  __gc[]  ) 
 

Constructor initialization by an array parameters.

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

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

Vector3::Vector3 Vector3 n_Vector3  ) 
 

Constructor initialization by an already existing Vector3 object.

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

Parameters:
n_Vector3 the object containing thespecific element values.


Member Function Documentation

Vector3 * Vector3::Addition Vector3 v1,
Vector3 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.

Vector3 * Vector3::convertToOpenGLAlignedVector void   ) 
 

This function converts the current vector to an OpenGL compatible vector form.

For correct drawing in OpenGL the x and y elements of an existing Vector3 object must be inverted, only after this invertion a correct drawing in OpenGL is guaranteed (is basically a reflextion about the y and z axis).

Returns:
The inverted vector as a new Vector3 object.

Vector3 * Vector3::CreateNormalizedVector Vector3 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:
Vector3.normalize the non-static method for vector normalization.

Vector3 * Vector3::CrossProd Vector3 v1,
Vector3 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 Vector3::DotProd Vector3 v1,
Vector3 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 Vector3::dotProd Vector3 v  ) 
 

This function returns the dot product (inner product) of the current Vector3 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:
Vector3.DotProd the static method for the dot product.

double Vector3::get_X void   ) 
 

Returns the x element of the specific vector.

Returns:
The x element of the vector.

double Vector3::get_Y void   ) 
 

Returns the y element of the specific vector.

Returns:
The y element of the vector.

double Vector3::get_Z void   ) 
 

Returns the z element of the specific vector.

Returns:
The z element of the vector.

double Vector3::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:
Vector3.getFloatArrayOfVector getting a float array containing all vector elements.

float Vector3::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:
Vector3.getDoubleArrayOfVector getting a double array containing all vector elements.

double Vector3::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
Parameters:
index the index for the specific element.
Returns:
The choosen vector element.

Vector3 * Vector3::getNegativeVector void   ) 
 

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

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

Returns:
The negative vector as a new Vector3 object.

double Vector3::magnitude void   ) 
 

Returns the magnitude of the specific vector.

Returns:
The magnitude of the vector.

Vector3 * Vector3::multSkalar double  d  ) 
 

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

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

void Vector3::normalize void   ) 
 

This function normalizes the current vector.

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

void Vector3::set_X double  n_X  ) 
 

Sets the x element of the existing vector.

Parameters:
n_X the x element of the vector.

void Vector3::set_Y double  n_Y  ) 
 

Sets the y element of the existing vector.

Parameters:
n_Y the y element of the vector.

void Vector3::set_Z double  n_Z  ) 
 

Sets the z element of the existing vector.

Parameters:
n_Z the z element of the vector.

Vector3 * Vector3::Subtraction Vector3 v1,
Vector3 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.Vector3.m_X
 

The x element of the vector.

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

double IDVR.Tools.Vector3.m_Y
 

The y element of the vector.

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

double IDVR.Tools.Vector3.m_Z
 

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