Ovis_Decoration_Info_Template_Range_Element_Add()
Abstract
Adds a range element to an Ovis template.
Syntax
Ovis_Decoration_Info_Template_Range_Element_Add (tmpl_ptr, element_name, min_value, max_value)
| Argument | Type | Description |
|---|---|---|
tmpl_ptr |
OvisT_Info_Template * |
Template |
element_name |
const char * |
Element name |
min_value |
double |
Minimum value of the range |
max_value |
double |
Maximum value of the range |
Return Type
OvisT_Compcode
OvisC_Compcode_Success if the range element could be added; OvisC_Compcode_Failure otherwise.
Header
ovis_decoration.h
Details
This function adds the range element to the Ovis template. It will appear in an instance as a small horizontal rectangle that is hollow if the value is less than min_value, filled if the value is more than max_value, and otherwise filled partially from the left side of the rectangle based on the value and the min/max range.
Example
#define NOISE_LEVEL_FIELD "noise"
OvisT_Info_Template * template;
OvisT_Info_Group * info;
OvisT_3D_Position pos;
template = Ovis_Decoration_Info_Template_Create ("Interference");
Ovis_Decoration_Info_Template_Range_Element_Add (template, NOISE_LEVEL_FIELD,
0, 10);
Ovis_Position_Geodetic_Set (&pos, 0, 0, 100);
info = Ovis_Decoration_Info_Group_Create (template, pos,
prg_color_from_string ("blue"), OPC_NIL, OPC_NIL, OPC_NIL);
Ovis_Decoration_Info_Group_Scalar_Element_Value_Set (info, NOISE_LEVEL_FIELD, 3);
Errors
- Template is NIL.
- No element name provided.
- Minimum value <value> must be less than maximum value <value>.
- Element "<name>" is already part of the template.
Reference
- Use the function
Ovis_Decoration_Info_Group_Scalar_Element_Value_Set()to set the value for that element in an instance of the template.