ReconstructMe SDK  1.1.739-75658
Real-time 3D reconstruction engine
 All Classes Files Functions Typedefs Enumerations Enumerator Groups Pages
Typedefs
Options

Generic options object to manipulate system settings. More...

Typedefs

typedef int reme_options_t
 Handle referencing an options object.
 
reme_error_t reme_options_create (reme_context_t c, reme_options_t *o)
 Create a new options binding.
 
reme_error_t reme_options_destroy (reme_context_t c, reme_options_t *o)
 Destroy a previously created options object.
 
reme_error_t reme_options_set (reme_context_t c, reme_options_t o, const char *field_name, const char *value)
 Set a specific options field.
 
reme_error_t reme_options_get (reme_context_t c, reme_options_t o, const char *field_name, const char **value, int *length)
 Get a specific repeated options field.
 
reme_error_t reme_options_get_repeated (reme_context_t c, reme_options_t o, const char *field_name, int repeated_index, const char **value, int *length)
 Get a specific repeated options field.
 
reme_error_t reme_options_get_repeated_count (reme_context_t c, reme_options_t o, const char *field_name, int *length)
 Return the number of elements in a repeated field.
 
reme_error_t reme_options_bind_message (reme_context_t c, reme_options_t o, const char *field_name, reme_options_t o_nested)
 Bind options object to a nested message.
 
reme_error_t reme_options_bind_repeated_message (reme_context_t c, reme_options_t o, const char *field_name, int repeated_index, reme_options_t o_nested)
 Bind options object to a nested repeated message.
 
reme_error_t reme_options_copy (reme_context_t c, reme_options_t o_src, reme_options_t o_dst)
 Copy the content of the source options to the destination options.
 
reme_error_t reme_options_load_from_file (reme_context_t c, reme_options_t o, const char *filename)
 Set options by loading a human readable options representation from file.
 
reme_error_t reme_options_save_to_file (reme_context_t c, reme_options_t o, const char *filename)
 Save options in a human readable file format.
 
reme_error_t reme_options_save_to_string (reme_context_t c, reme_options_t o, const char **message, int *length)
 Get options as string using a human readable serialization.
 
reme_error_t reme_options_set_bytes (reme_context_t c, reme_options_t o, const void *message, int length)
 Set options by reading a binary options representation.
 
reme_error_t reme_options_get_bytes (reme_context_t c, reme_options_t o, const void **message, int *length)
 Get options by serializing them in a binary options representation.
 

Detailed Description

Generic options object to manipulate system settings.

This module provides methods to interact and manipulate parameters and options generic way. Once a reme_options_t is created it is empty, as it does not represent any specific options. In order to manipulate specific options, you need to bind it to a specific options using a specific function that usually carries bind in its function name. The page Options Bindings lists all known binders. Each binder documents the available parameters in the method's detail section using Google Protocol Buffer format.

Once the options object is bound, it directly manipulates the bound options. You can query values using reme_options_get, manipulate values using reme_options_set, or export/import options from and to files using reme_options_save_to_file and reme_options_load_from_file.

See Accessing and Modifying Options for more details and examples.

Typedef Documentation

typedef int reme_options_t

Handle referencing an options object.

A reme_options_t references a specific options class. Internally ReconstructMe SDK uses Google's protocol buffers to represent options and parameters. Protocol buffers a language-neutral, platform-neutral, extensible mechanism for serializing structured data.

In order to manipulate these protocol buffer options you have two options:

Function Documentation

reme_error_t reme_options_create ( reme_context_t  c,
reme_options_t o 
)

Create a new options binding.

Creates an empty options binding.

Parameters
cA valid context object
oA pointer that will receive the options handle.
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_calibration.cpp, example_reconstructmesdk_options.cpp, example_reconstructmesdk_options_type_safe.cpp, example_reconstructmesdk_recorder.cpp, example_reconstructmesdk_sensor_multi_independent.cpp, and example_reconstructmesdk_surface.cpp.
reme_error_t reme_options_destroy ( reme_context_t  c,
reme_options_t o 
)

Destroy a previously created options object.

Parameters
cA pointer to a valid context object
oA mutable pointer to a valid options handle to destroy
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
reme_error_t reme_options_set ( reme_context_t  c,
reme_options_t  o,
const char *  field_name,
const char *  value 
)

Set a specific options field.

This method uses a reflection like mechanism to set the specified field value. Use the '.' character to separate nested fields. If any field encountered is repeated the first element is used.

Parameters
cA valid context object
oA valid options object
field_nameName of the field to manipulate
valueValue String representation of the value to set
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_calibration.cpp, example_reconstructmesdk_options.cpp, example_reconstructmesdk_recorder.cpp, and example_reconstructmesdk_surface.cpp.
reme_error_t reme_options_get ( reme_context_t  c,
reme_options_t  o,
const char *  field_name,
const char **  value,
int *  length 
)

Get a specific repeated options field.

This method uses a reflection like mechanism to get the specified field value. Use the '.' character to separate nested fields. If any field encountered is repeated the first element is used.

Parameters
cA valid context object
oA valid options object
field_nameName of the field to manipulate
valueMutable pointer to receive the option value
lengthLength of option value in characters.
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_options.cpp.
reme_error_t reme_options_get_repeated ( reme_context_t  c,
reme_options_t  o,
const char *  field_name,
int  repeated_index,
const char **  value,
int *  length 
)

Get a specific repeated options field.

This method uses a reflection like mechanism to get the specified field value. Use the '.' character to separate nested fields. The repeated_index only affects the last part of the field description. Any parent repeated messages are accessed with index zero.

Parameters
cA valid context object
oA valid options object
field_nameName of the field to manipulate
repeated_indexWhen the target field is repeated the command applies to the i-th field.
valueMutable pointer to receive the option value
lengthLength of option value in characters.
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
reme_error_t reme_options_get_repeated_count ( reme_context_t  c,
reme_options_t  o,
const char *  field_name,
int *  length 
)

Return the number of elements in a repeated field.

Parameters
cA valid context object
oA valid options object
field_nameName of the field to manipulate
lengthNumber of elements in repeated field. If field is not repeated, returns 1.
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_options.cpp.
reme_error_t reme_options_bind_message ( reme_context_t  c,
reme_options_t  o,
const char *  field_name,
reme_options_t  o_nested 
)

Bind options object to a nested message.

Parameters
cA valid context object
oA valid options object
field_nameName of the field containing the nested message
o_nestedA valid options object recieving the binding.
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_calibration.cpp.
reme_error_t reme_options_bind_repeated_message ( reme_context_t  c,
reme_options_t  o,
const char *  field_name,
int  repeated_index,
reme_options_t  o_nested 
)

Bind options object to a nested repeated message.

Parameters
cA valid context object
oA valid options object
field_nameName of the field containing the nested message
repeated_indexWhen the target message is repeated the command applies to the i-th field.
o_nestedA valid options object recieving the binding.
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_options.cpp.
reme_error_t reme_options_copy ( reme_context_t  c,
reme_options_t  o_src,
reme_options_t  o_dst 
)

Copy the content of the source options to the destination options.

This method requires the two option sets involved to be of the same type.

Parameters
cA valid context object
o_srcA valid options object to copy from
o_dstA valid options object to copy to
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_calibration.cpp.
reme_error_t reme_options_load_from_file ( reme_context_t  c,
reme_options_t  o,
const char *  filename 
)

Set options by loading a human readable options representation from file.

This method uses protobuf's text format parser to read in the content of the file. This text format is very similar to json.

Parameters
cA valid context object
oA valid options object
filenamePath to file.
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_options.cpp, example_reconstructmesdk_recorder.cpp, and example_reconstructmesdk_sensor_multi_independent.cpp.
reme_error_t reme_options_save_to_file ( reme_context_t  c,
reme_options_t  o,
const char *  filename 
)

Save options in a human readable file format.

This method uses protobuf's text format serializer to write in the content of the file. The output is similar to json.

Parameters
cA valid context object
oA valid options object
filenamePath to file.
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_calibration.cpp, and example_reconstructmesdk_options.cpp.
reme_error_t reme_options_save_to_string ( reme_context_t  c,
reme_options_t  o,
const char **  message,
int *  length 
)

Get options as string using a human readable serialization.

This method uses protobuf's text format serializer to write in the content of the file. The output is similar to json.

Parameters
cA valid context object
oA valid options object
messageA mutable pointer that will receive the content of the message
lengthA pointer that will receive the length of the serialized message in bytes
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
reme_error_t reme_options_set_bytes ( reme_context_t  c,
reme_options_t  o,
const void *  message,
int  length 
)

Set options by reading a binary options representation.

This method uses protobuf's standard serialization format (binary) to read in the desired options value.

Parameters
cA valid context object
oA valid options object
messageA valid pointer to the serialized message
lengthThe length of the serialized message in bytes.
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_options_type_safe.cpp.
reme_error_t reme_options_get_bytes ( reme_context_t  c,
reme_options_t  o,
const void **  message,
int *  length 
)

Get options by serializing them in a binary options representation.

This method uses protobuf's standard serialization format (binary) to serialize the current state of option values.

Parameters
cA valid context object
oA valid options object
messageA mutable pointer that will receive the address of the serialized message
lengthA pointer that will receive the length of the serialized message in bytes
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_options_type_safe.cpp.