AnimatLab
2
Test
|
Standard lookup table. More...
#include <StdLookupTable.h>
Public Member Functions | |
CStdLookupTable () | |
Default constructor. More... | |
virtual | ~CStdLookupTable () |
Destructor. More... | |
void | AddPoint (double dblX, double dblY) |
Adds a point to the initial points. More... | |
void | Clear () |
Clears this lookup table. More... | |
double | Delta () |
Gets the delta. More... | |
double | EndX () |
Gets the ends x coordinate. More... | |
double | Evaluate (double dblX) |
Evaluates a x value to get the calculated y value. More... | |
double | HighLimitValue () |
Gets the high limit value. More... | |
void | HighLimitValue (double dblVal) |
Sets the high limit value. More... | |
void | Initialize () |
Initializes this lookup table. More... | |
CStdDPoint | InitialPoint (int iIndex) |
Gets the initial point at the specified index. More... | |
int | InitialPointCount () |
Gets the initial point count. More... | |
virtual void | Load (CStdXml &oXml, std::string strParamName, bool bThrowError=false) |
Loads the lookup table. More... | |
double | LowLimitValue () |
Gets the low limit value. More... | |
void | LowLimitValue (double dblVal) |
Sets the low limit value. More... | |
virtual void | Save (CStdXml &oXml, std::string strParamName) |
Saves this lookup table.. More... | |
double | StartX () |
Gets the start x coordinate. More... | |
int | TableSize () |
Gets the table size. More... | |
bool | UseHighLimitValue () |
Gets the use high limit value. More... | |
void | UseHighLimitValue (bool bVal) |
Sets the use high limit value. More... | |
bool | UseLowLimitValue () |
Gets the use low limit value. More... | |
void | UseLowLimitValue (bool bVal) |
Sets the use low limit value. More... | |
Protected Attributes | |
double * | m_aryB |
The array of intercepts. | |
CStdArray< CStdDPoint > | m_aryInitialPoints |
The initial points for the lines. | |
double * | m_aryM |
The array of slopes. | |
bool | m_bUseHighLimitValue |
true to use high limit value | |
bool | m_bUseLowLimitValue |
true to use low limit value | |
double | m_dblDelta |
The delta. | |
double | m_dblEndX |
The end x coordinate. | |
double | m_dblHighLimitValue |
The double high limit value. | |
double | m_dblLowLimitValue |
The double low limit value. | |
double | m_dblStartX |
The start x coordinate. | |
int | m_iTableSize |
Size of the table. | |
Standard lookup table.
This class allows you to specify a sequence of lines to implement a curve. You can then specify an x point on that curve, and it will calculate the y point from the appropriate line.
Definition at line 20 of file StdLookupTable.h.
StdUtils::CStdLookupTable::CStdLookupTable | ( | ) |
Default constructor.
Definition at line 19 of file StdLookupTable.cpp.
References m_aryB, m_aryM, m_bUseHighLimitValue, m_bUseLowLimitValue, m_dblDelta, m_dblEndX, m_dblHighLimitValue, m_dblLowLimitValue, m_dblStartX, and m_iTableSize.
|
virtual |
Destructor.
Definition at line 40 of file StdLookupTable.cpp.
References Clear(), and StdUtils::Std_TraceMsg().
void StdUtils::CStdLookupTable::AddPoint | ( | double | dblX, |
double | dblY | ||
) |
Adds a point to the initial points.
dblX | The double x coordinate. |
dblY | The double y coordinate. |
Definition at line 76 of file StdLookupTable.cpp.
References m_aryInitialPoints.
void StdUtils::CStdLookupTable::Clear | ( | ) |
Clears this lookup table.
Definition at line 56 of file StdLookupTable.cpp.
References m_aryB, m_aryInitialPoints, and m_aryM.
Referenced by ~CStdLookupTable().
|
inline |
|
inline |
Gets the ends x coordinate.
Definition at line 120 of file StdLookupTable.h.
double StdUtils::CStdLookupTable::Evaluate | ( | double | dblX | ) |
Evaluates a x value to get the calculated y value.
dblX | The double x coordinate. |
Definition at line 191 of file StdLookupTable.cpp.
References m_aryB, m_aryM, m_bUseLowLimitValue, m_dblDelta, m_dblEndX, m_dblLowLimitValue, m_dblStartX, and m_iTableSize.
|
inline |
Gets the high limit value.
Definition at line 190 of file StdLookupTable.h.
|
inline |
Sets the high limit value.
dblVal | The double value. |
Definition at line 200 of file StdLookupTable.h.
void StdUtils::CStdLookupTable::Initialize | ( | ) |
Initializes this lookup table.
Definition at line 107 of file StdLookupTable.cpp.
References StdUtils::CompareDataPoints(), m_aryB, m_aryInitialPoints, m_aryM, m_dblDelta, m_dblEndX, m_dblStartX, and m_iTableSize.
|
inline |
Gets the initial point at the specified index.
iIndex | Zero-based index of the initial point. |
Definition at line 80 of file StdLookupTable.h.
|
inline |
Gets the initial point count.
Definition at line 68 of file StdLookupTable.h.
|
virtual |
Loads the lookup table.
[in,out] | oXml | The xml to load. |
strParamName | Name of the xml parameter. | |
bThrowError | true to throw error if there is a problem. |
Definition at line 230 of file StdLookupTable.cpp.
References StdUtils::CStdXml::FindChildElement(), StdUtils::CStdXml::GetChildBool(), StdUtils::CStdXml::GetChildDouble(), StdUtils::CStdXml::IntoElem(), m_aryInitialPoints, m_bUseHighLimitValue, m_bUseLowLimitValue, m_dblHighLimitValue, m_dblLowLimitValue, StdUtils::CStdXml::NumberOfChildren(), StdUtils::CStdXml::OutOfElem(), and StdUtils::Std_LoadPoint().
|
inline |
Gets the low limit value.
Definition at line 170 of file StdLookupTable.h.
|
inline |
Sets the low limit value.
dblVal | The double value. |
Definition at line 180 of file StdLookupTable.h.
|
virtual |
Saves this lookup table..
[in,out] | oXml | The xml to save. |
strParamName | Name of the xml parameter. |
Definition at line 264 of file StdLookupTable.cpp.
|
inline |
Gets the start x coordinate.
Definition at line 110 of file StdLookupTable.h.
|
inline |
|
inline |
Gets the use high limit value.
Definition at line 150 of file StdLookupTable.h.
|
inline |
Sets the use high limit value.
bVal | true to value. |
Definition at line 160 of file StdLookupTable.h.
|
inline |
Gets the use low limit value.
Definition at line 130 of file StdLookupTable.h.
|
inline |
Sets the use low limit value.
bVal | true to value. |
Definition at line 140 of file StdLookupTable.h.