get_AngularItem Method

WRAPPER_API AngularValue *get_AngularItem(const BmgChar *name) const;

 

Description

The get_AngularItem method returns the AngularValue that gives the value of the parameter with the specified name.  It is the users responsibility to free the returned object.  If the specified name does not correspond to parameter in this ParameterCollection, a GeoCalcException will be thrown with an ErrorCode indicating ParameterNotFound.  If the specified name corresponds to a parameter with a value that is not represented by an AngularValue, a GeoCalcException will be thrown with an ErrorCode indicating ParameterTypeMismatch.

This method will return a copy of the AngularValue used to represent the value of the parameter.  Therefore, any changes made to the returned AngularValue will not affect the value of the parameter.

 

Example

void ParameterCollection_getAngularItem()

{

GEOCALCPBW_NAMESPACE::ParameterCollection pc;

 

BmgChar * angularParName = L"AngularParameter";

GEOCALCPBW_NAMESPACE::AngularValue angularVal;

pc.AddAngularItem(angularParName);

pc.set_AngularItem(angularParName, angularVal);

GEOCALCPBW_NAMESPACE::AngularValue * av = pc.get_AngularItem(angularParName);

delete av;

 

BmgChar * floatParName = L"FloatParameter";

double floatVal = 12.34;

pc.AddFloatItem(floatParName);

pc.set_FloatItem(floatParName, floatVal);

floatVal = pc.get_FloatItem(floatParName);

 

BmgChar * intParName = L"IntegerParameter";

int intVal = 54;

pc.AddIntegerItem(intParName);

pc.set_IntegerItem(intParName, intVal);

intVal = pc.get_IntegerItem(intParName);

 

BmgChar * linearParName = L"LinearParameter";

GEOCALCPBW_NAMESPACE::LinearValue linearVal;

pc.AddLinearItem(linearParName);

pc.set_LinearItem(linearParName, linearVal);

GEOCALCPBW_NAMESPACE::LinearValue * lv = pc.get_LinearItem(linearParName);

delete lv;

 

BmgChar * stringParName = L"StringParameter";

BmgChar * stringVal = L"A Value";

pc.AddStringItem(stringParName);

pc.set_StringItem(stringParName, stringVal);

stringVal = const_cast<BmgChar *>(pc.get_StringItem(stringParName));

}