ReconstructMe SDK  2.6.43-0
Real-time 3D reconstruction engine
Options

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

Typedefs

typedef int reme_options_t
 Handle referencing an options object. More...
 
reme_error_t reme_options_create (reme_context_t c, reme_options_t *o)
 Create a new options binding. More...
 
reme_error_t reme_options_destroy (reme_context_t c, reme_options_t *o)
 Destroy a previously created options object. More...
 
reme_error_t reme_options_set (reme_context_t c, reme_options_t o, const char *field_name, const char *value)
 Set the value of options field. More...
 
reme_error_t reme_options_set_int (reme_context_t c, reme_options_t o, const char *field_name, int value)
 Set a specific integer options field. More...
 
reme_error_t reme_options_set_real (reme_context_t c, reme_options_t o, const char *field_name, float value)
 Set a specific real options field. More...
 
reme_error_t reme_options_set_bool (reme_context_t c, reme_options_t o, const char *field_name, bool value)
 Set a specific boolean options field. More...
 
reme_error_t reme_options_get (reme_context_t c, reme_options_t o, const char *field_name, char *value, int length, int index=0)
 Get the value of an options field as string. More...
 
reme_error_t reme_options_get_int (reme_context_t c, reme_options_t o, const char *field_name, int *value, int index=0)
 Get the value of an integer options field. More...
 
reme_error_t reme_options_get_real (reme_context_t c, reme_options_t o, const char *field_name, float *value, int index=0)
 Get the value of a real options field. More...
 
reme_error_t reme_options_get_bool (reme_context_t c, reme_options_t o, const char *field_name, bool *value, int index=0)
 Get the value of a boolean options field. More...
 
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. More...
 
reme_error_t reme_options_clear (reme_context_t c, reme_options_t o)
 Clear options. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
reme_error_t reme_options_load_from_string (reme_context_t c, reme_options_t o, const char *message, int length)
 Set options by loading a human readable options representation from a given string. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

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

◆ reme_options_t

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_options_create()

◆ reme_options_destroy()

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_options_set()

reme_error_t reme_options_set ( reme_context_t  c,
reme_options_t  o,
const char *  field_name,
const char *  value 
)

Set the value of 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
valueString to set
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_bust.cpp, example_reconstructmesdk_calibration.cpp, example_reconstructmesdk_color_tracking.cpp, example_reconstructmesdk_colorize.cpp, example_reconstructmesdk_marker.cpp, example_reconstructmesdk_point_and_shoot_with_colors.cpp, example_reconstructmesdk_recorder.cpp, example_reconstructmesdk_recorder_update_fileformat.cpp, example_reconstructmesdk_remote_reconstruction.cpp, and example_reconstructmesdk_sensor.cpp.

◆ reme_options_set_int()

reme_error_t reme_options_set_int ( reme_context_t  c,
reme_options_t  o,
const char *  field_name,
int  value 
)

Set a specific integer 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 to set
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_color_tracking.cpp, example_reconstructmesdk_csg.cpp, example_reconstructmesdk_marker.cpp, example_reconstructmesdk_options.cpp, example_reconstructmesdk_scan_tilt.cpp, example_reconstructmesdk_sensor.cpp, example_reconstructmesdk_sensor_external.cpp, example_reconstructmesdk_sensor_printing.cpp, and example_reconstructmesdk_surface.cpp.

◆ reme_options_set_real()

reme_error_t reme_options_set_real ( reme_context_t  c,
reme_options_t  o,
const char *  field_name,
float  value 
)

Set a specific real 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 to set
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_color_tracking.cpp, example_reconstructmesdk_colorize.cpp, example_reconstructmesdk_csg.cpp, example_reconstructmesdk_marker.cpp, example_reconstructmesdk_point_and_shoot_with_colors.cpp, and example_reconstructmesdk_sensor_external.cpp.

◆ reme_options_set_bool()

reme_error_t reme_options_set_bool ( reme_context_t  c,
reme_options_t  o,
const char *  field_name,
bool  value 
)

Set a specific boolean 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 to set
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_bust.cpp, example_reconstructmesdk_color_tracking.cpp, example_reconstructmesdk_colorize.cpp, example_reconstructmesdk_marker.cpp, example_reconstructmesdk_point_and_shoot_with_colors.cpp, example_reconstructmesdk_remote_reconstruction.cpp, and example_reconstructmesdk_surface.cpp.

◆ reme_options_get()

reme_error_t reme_options_get ( reme_context_t  c,
reme_options_t  o,
const char *  field_name,
char *  value,
int  length,
int  index = 0 
)

Get the value of an options field as string.

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 access
valuePre-allocated buffer to assign the string to
lengthLength of buffer
indexRepeated field index
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_error_handling.cpp, and example_reconstructmesdk_options.cpp.

◆ reme_options_get_int()

reme_error_t reme_options_get_int ( reme_context_t  c,
reme_options_t  o,
const char *  field_name,
int *  value,
int  index = 0 
)

Get the value of an integer 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 access
valueValue to assign to
indexRepeated field index
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_options.cpp, example_reconstructmesdk_scan_tilt.cpp, example_reconstructmesdk_sensor.cpp, and example_reconstructmesdk_volume.cpp.

◆ reme_options_get_real()

reme_error_t reme_options_get_real ( reme_context_t  c,
reme_options_t  o,
const char *  field_name,
float *  value,
int  index = 0 
)

Get the value of a real 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 access
valueValue to assign to
indexRepeated field index
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure

◆ reme_options_get_bool()

reme_error_t reme_options_get_bool ( reme_context_t  c,
reme_options_t  o,
const char *  field_name,
bool *  value,
int  index = 0 
)

Get the value of a boolean 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 access
valueValue to assign to
indexRepeated field index
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_sensor.cpp.

◆ reme_options_get_repeated_count()

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_error_handling.cpp, and example_reconstructmesdk_options.cpp.

◆ reme_options_clear()

reme_error_t reme_options_clear ( reme_context_t  c,
reme_options_t  o 
)

Clear options.

Clearing option values means to reset them into an empty state. If you retrieve a value from an empty field, the fields default value (see associated .proto file) will be returned. When the field does not have any default value assigned, an error will be returned.

Clearing is useful when one wants to introduce an optional state. For example, reme_sensor_apply_capture_options will only apply those capture options that are not empty. Take note that by default the bound capture options, i.e reme_sensor_bind_capture_options will contain the current set values. Therefore, clear those options before setting individual option values.

Parameters
cA valid context object
oA valid options object
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_error_handling.cpp, example_reconstructmesdk_scan_tilt.cpp, and example_reconstructmesdk_sensor.cpp.

◆ reme_options_bind_message()

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_options_bind_repeated_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.

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_options_copy()

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_options_load_from_file()

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, and example_reconstructmesdk_recorder.cpp.

◆ reme_options_load_from_string()

reme_error_t reme_options_load_from_string ( reme_context_t  c,
reme_options_t  o,
const char *  message,
int  length 
)

Set options by loading a human readable options representation from a given string.

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

Parameters
cA valid context object
oA valid options object
messageImmutable pointer to start of string.
lengthNumber of characters in string.
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure

◆ reme_options_save_to_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.

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_options_save_to_string()

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_options_set_bytes()

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_options_get_bytes()

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.