#include <Gradient.h>
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.
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 Vector3 * | get_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 Gradient * | CreateNormalizedGradient (Gradient *n_Gradient) |
Creates a normalized gradient instance by the specified gradient vector. | |
Private Attributes | |
Vector3 * | m_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. |
|
This is the standard constructor. All elements of the gradient vector will be set to zero. |
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
Creates a normalized gradient instance by the specified gradient vector.
|
|
Returns the gradient vector as an instance of the Vector3 class.
|
|
Returns the original length of the gradient vector.
|
|
Returns the scaled length of the gradient vector. The actual scaling mode deponds on the currently used scale factor Gradient.m_ScaleFactor.
|
|
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. |
|
Sets the gradient vector by an instance of the Vector3 class.
|
|
Sets the scale factor by an arbitrary user-defineed value.
|
|
Saves the actual direction. This member variable is ordinary instance of the Vector3 class with unit length. |
|
Saves the original length of the gradient vector. This double member variable is the actual length before the gradient vector will be normalized. |
|
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. |
|
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. |