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

IDVR.Tools.Gradient Class Reference

#include <Gradient.h>

List of all members.


Detailed Description

Class for handling gradient vector types.

This class is part of the Tools namespace and its goal is the saving and handling of 3 element gradient vectors. The difference to ordinary 3 element vector of the Vector3 class is that gradients habe additional information about their length. Thus, the vector lenght (magnitude) of the gradient will be saved in an extra component for further uses and the gradient itself will be normalized to unit length. That means that the gradient vector is always an unit vector which gives information about a specified direction.
Espacially during the calculation of gradients in the volume data space which will be loaded from a specified data file this class will be used because both the actual direction in the data field and the original length are essential for correct rendering of the voxel set.

See also:
Vector3 - the 3 element vector class without seperate length handling.
Author:
Bernhard Pflugfelder
Version:
1.0
Date:
02-18-2005


Public Member Functions

 Gradient (void)
 This is the standard constructor.
 Gradient (Vector3 *n_Vector3)
 Constructor initialization by a specified instance of the Vector3 class.
 Gradient (Vector3 *n_Vector3, double n_ScaleFactor)
 Constructor initialization by a specified instance of the Vector3 class.
 Gradient (double n_X, double n_Y, double n_Z)
 Constructor initialization by three specified double parameters.
 Gradient (double n_X, double n_Y, double n_Z, double n_ScaleFactor)
 Constructor initialization by three specified double parameters.
 Gradient (float n_NewValues __gc[])
 Constructor initialization by an array of the gradient vector elements.
 Gradient (float n_NewValues __gc[], double n_ScaleFactor)
 Constructor initialization by an array of the gradient vector elements.
__property double get_Length (void)
 Returns the original length of the gradient vector.
__property double get_ScaledLength (void)
 Returns the scaled length of the gradient vector.
__property Vector3get_GradientVector (void)
 Returns the gradient vector as an instance of the Vector3 class.
__property void set_GradientVector (Vector3 *n_Vector3)
 Sets the gradient vector by an instance of the Vector3 class.
__property void set_ScaleFactor (double n_ScaleFactor)
 Sets the scale factor by an arbitrary user-defineed value.
void scale_Length (void)
 Calculates the scaled length with the current scale factor.

Static Public Member Functions

static GradientCreateNormalizedGradient (Gradient *n_Gradient)
 Creates a normalized gradient instance by the specified gradient vector.

Private Attributes

Vector3m_GradientVector
 Saves the actual direction.
double m_Length
 Saves the original length of the gradient vector.
double m_ScaledLength
 Saves the scaled length of the gradient between 0 and 1.
double m_ScaleFactor
 Gives information about the necessary scale gradient length factor.


Constructor & Destructor Documentation

Gradient::Gradient void   ) 
 

This is the standard constructor.

All elements of the gradient vector will be set to zero.

Gradient::Gradient Vector3 n_Vector3  ) 
 

Constructor initialization by a specified instance of the Vector3 class.

This constructor initialized all gradient elements with the corresponding elements of the Vector3 instance. The gradient length will be automatically normalized to unit length and the original length will be saved in Gradient.m_Length.

Parameters:
n_Vector3 the values for the gradient elements.
Note:
The gradient vector parameters need not to be normalized. This will be done automatically.

Gradient::Gradient Vector3 n_Vector3,
double  n_ScaleFactor
 

Constructor initialization by a specified instance of the Vector3 class.

This constructor initialized all gradient elements with the corresponding elements of the Vector3 instance. The gradient length will be automatically normalized to unit length and the original length will be saved in Gradient.m_Length. Additionally, a user-defined scale factor will be used instead of the basically defined scale factor of this class.

Parameters:
n_Vector3 the values for the gradient elements.
n_ScaleFactor the user-defined scale factor.
Note:
The gradient vector parameters need not to be normalized. This will be done automatically.

Gradient::Gradient double  n_X,
double  n_Y,
double  n_Z
 

Constructor initialization by three specified double parameters.

This constructor initialized all gradient elements with the corresponding elements of the double parameters. The gradient length will be automatically normalized to unit length and the original length will be saved in Gradient.m_Length.

Parameters:
n_X the x element of the gradient vector.
n_Y the y element of the gradient vector.
n_Z the z element of the gradient vector.
Note:
The gradient vector parameters need not to be normalized. This will be done automatically.

Gradient::Gradient double  n_X,
double  n_Y,
double  n_Z,
double  n_ScaleFactor
 

Constructor initialization by three specified double parameters.

This constructor initialized all gradient elements with the corresponding elements of the double parameters. The gradient length will be automatically normalized to unit length and the original length will be saved in Gradient.m_Length. Additionally, a user-defined scale factor will be used instead of the basically defined scale factor of this class.

Parameters:
n_X the x element of the gradient vector.
n_Y the y element of the gradient vector.
n_Z the z element of the gradient vector.
n_ScaleFactor the user-defined scale factor.
Note:
The gradient vector parameters need not to be normalized. This will be done automatically.

Gradient::Gradient float n_NewValues  __gc[]  ) 
 

Constructor initialization by an array of the gradient vector elements.

This constructor initialized all gradient elements with the corresponding elements of the double element array. The gradient length will be automatically normalized to unit length and the original length will be saved in Gradient.m_Length.

Parameters:
n_NewValues the array containing the gradient vector elements.
Note:
The gradient vector parameters need not to be normalized. This will be done automatically.

Gradient::Gradient float n_NewValues  __gc[],
double  n_ScaleFactor
 

Constructor initialization by an array of the gradient vector elements.

This constructor initialized all gradient elements with the corresponding elements of the double element array. The gradient length will be automatically normalized to unit length and the original length will be saved in Gradient.m_Length. Additionally, a user-defined scale factor will be used instead of the basically defined scale factor of this class.

Parameters:
n_NewValues the array containing the gradient vector elements.
n_ScaleFactor the user-defined scale factor.
Note:
The gradient vector parameters need not to be normalized. This will be done automatically.


Member Function Documentation

Gradient * Gradient::CreateNormalizedGradient Gradient n_Gradient  )  [static]
 

Creates a normalized gradient instance by the specified gradient vector.

Parameters:
n_Gradient the original gradient vector.
Returns:
A new instance of the normalized gradient parameter.

Vector3 * Gradient::get_GradientVector void   ) 
 

Returns the gradient vector as an instance of the Vector3 class.

Returns:
The original (unnormalized) length of the gradient vector.
Note:
This returned vector has always unit length.

double Gradient::get_Length void   ) 
 

Returns the original length of the gradient vector.

Returns:
The original (unnormalized) length of the gradient vector.

double Gradient::get_ScaledLength void   ) 
 

Returns the scaled length of the gradient vector.

The actual scaling mode deponds on the currently used scale factor Gradient.m_ScaleFactor.

Returns:
The scaled length of the gradient vector.

void Gradient::scale_Length void   ) 
 

Calculates the scaled length with the current scale factor.

The calculation of the scaled length will be applied by dividing the gradient length by the scale factor Gradient.m_ScaleFactor.

void Gradient::set_GradientVector Vector3 n_Vector3  ) 
 

Sets the gradient vector by an instance of the Vector3 class.

Parameters:
n_Vector3 the corresponding new values for the gradient vector.
Note:
This new gradient values need not to be normalized. This will be done automatically.

void Gradient::set_ScaleFactor double  n_ScaleFactor  ) 
 

Sets the scale factor by an arbitrary user-defineed value.

Parameters:
n_ScaleFactor the new user-defined scale factor.
Note:
The calculation of the new scaled gradient length will not be done automatically.


Member Data Documentation

Vector3* IDVR.Tools.Gradient.m_GradientVector [private]
 

Saves the actual direction.

This member variable is ordinary instance of the Vector3 class with unit length.

double IDVR.Tools.Gradient.m_Length [private]
 

Saves the original length of the gradient vector.

This double member variable is the actual length before the gradient vector will be normalized.

double IDVR.Tools.Gradient.m_ScaledLength [private]
 

Saves the scaled length of the gradient between 0 and 1.

The original gradient length saved in Gradient.m_Length is being scaled between 0 and 1 for better handling.

double IDVR.Tools.Gradient.m_ScaleFactor [private]
 

Gives information about the necessary scale gradient length factor.

For correct gradient length scaling a maximum lenght value has to be defined to corresponding scaled length 1.


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